Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
('PUpLipMid', (0,0)),
('PLoLipMid', (0,0)),
('PJaw', (0,0.8)),
('PTongue', (0,0))],
'R' : [
('PMouth', (-0.5,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.2)),
('PLoLipMid', (0,0.2)),
('PJaw', (0,0)),
('PTongue', (0,0))],
'FV' : [
('PMouth', (-0.2,0)),
('PMouthMid', (0,1.0)),
('PUpLipMid', (0,0)),
('PLoLipMid', (-0.6,-0.3)),
('PJaw', (0,0)),
('PTongue', (0,0))],
'S' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.5)),
('PLoLipMid', (0,0.7)),
('PJaw', (0,0)),
('PTongue', (0,0))],
'SH' : [
('PMouth', (-0.8,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-1.0)),
('PLoLipMid', (0,1.0)),
('PJaw', (0,0)),
('PTongue', (0,0))],
'EE' : [
('PMouth', (0.2,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.6)),
('PLoLipMid', (0,0.6)),
('PJaw', (0,0.05)),
('PTongue', (0,0))],
'AH' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.4)),
('PLoLipMid', (0,0)),
('PJaw', (0,0.7)),
('PTongue', (0,0))],
'EH' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.5)),
('PLoLipMid', (0,0.6)),
('PJaw', (0,0.25)),
('PTongue', (0,0))],
'TH' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,0)),
('PLoLipMid', (0,0)),
('PJaw', (0,0.2)),
('PTongue', (1.0,1.0))],
'L' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.5)),
('PLoLipMid', (0,0.5)),
('PJaw', (0,-0.2)),
('PTongue', (1.0,1.0))],
'G' : [
('PMouth', (0,0)),
('PMouthMid', (0,0)),
('PUpLipMid', (0,-0.5)),
('PLoLipMid', (0,0.5)),
('PJaw', (0,-0.2)),
('PTongue', (-1.0,0))],
'Blink' : [('PUpLid', (0,1.0)), ('PLoLid', (0,-1.0))],
'Unblink' : [('PUpLid', (0,0)), ('PLoLid', (0,0))],
})
VisemeList = [
('Rest', 'Etc', 'AH'),
('MBP', 'OO', 'O'),
('R', 'FV', 'S'),
('SH', 'EE', 'EH'),
('TH', 'L', 'G')
]
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
#
# makeVisemes(ob, scn):
# class VIEW3D_OT_MhxMakeVisemesButton(bpy.types.Operator):
#
def makeVisemes(ob, scn):
if ob.type != 'MESH':
print("Active object %s is not a mesh" % ob)
return
if not ob.data.shape_keys:
print("%s has no shapekeys" % ob)
return
adata = ob.data.shape_keys.animation_data
if not adata:
print("Shapekeys have not drivers")
return
try:
ob.data.shape_keys.key_blocks["VIS_Rest"]
print("Visemes already created")
return
except:
pass
rig = ob.parent
scale = rig.data.bones['PFace'].length*0.2
boneShapes = {}
for fcu in adata.drivers:
name = fcu.data_path.split('"')[1]
for var in fcu.driver.variables:
if var.type == 'TRANSFORMS':
targ = var.targets[0]
fmod = fcu.modifiers[0]
try:
list = boneShapes[targ.bone_target]
except:
list = []
boneShapes[targ.bone_target] = list
list.append((targ.transform_type, fmod, ob.data.shape_keys.key_blocks[name]))
verts = ob.data.vertices
for (vis,bones) in bodyLanguageVisemes.items():
if vis in ['Blink', 'Unblink']:
continue
vkey = ob.shape_key_add(name="VIS_%s" % vis)
print(vkey.name)
for n,v in enumerate(verts):
vkey.data[n].co = v.co
for (bone, xz) in bones:
try:
boneShapes[bone]
single = True
except:
single = False
if single:
addToVisShapeKey(boneShapes[bone], vkey, verts, xz, 1, scale)
else:
try:
boneShapes[bone+"_L"]
double = True
except:
double = False
if double:
addToVisShapeKey(boneShapes[bone+"_L"], vkey, verts, xz, 1, scale)
#addToVisShapeKey(boneShapes[bone+"_R"], vkey, verts, xz, -1, scale)
print("Visemes made")
return
def addToVisShapeKey(shapes, vkey, verts, xz, sign, scale):
for (typ, fmod, skey) in shapes:
factor = fmod.coefficients[1]*scale
(x,z) = xz
if typ == 'LOC_X':
k = factor*sign*x
elif typ == 'LOC_Z':
k = factor*z
if k < skey.slider_min:
k = skey.slider_min
if k > skey.slider_max:
k = skey.slider_max
if abs(k) < 0.001:
continue
print(" %s %.3f %.3f %.3f %.3f" % (skey.name, factor, x, z, k))
for n,v in enumerate(verts):
vkey.data[n].co += k*(skey.data[n].co - v.co)
return
class VIEW3D_OT_MhxMakeVisemesButton(bpy.types.Operator):
bl_idname = "mhx.make_visemes"
bl_label = "Generate viseme shapekeys"
def execute(self, context):
makeVisemes(context.object, context.scene)
return{'FINISHED'}
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
#
# mohoVisemes
# magpieVisemes
#
mohoVisemes = dict({
'rest' : 'Rest',
'etc' : 'Etc',
'AI' : 'AH',
'O' : 'O',
'U' : 'OO',
'WQ' : 'AH',
'L' : 'L',
'E' : 'EH',
'MBP' : 'MBP',
'FV' : 'FV',
})
magpieVisemes = dict({
"CONS" : "t,d,k,g,T,D,s,z,S,Z,h,n,N,j,r,tS",
"AI" : "i,&,V,aU,I,0,@,aI",
"E" : "eI,3,e",
"O" : "O,@U,oI",
"UW" : "U,u,w",
"MBP" : "m,b,p",
"L" : "l",
"FV" : "f,v",
"Sh" : "dZ",
})
#
# setViseme(context, vis, setKey, frame):
# setBoneLocation(context, pbone, loc, mirror, setKey, frame):
# class VIEW3D_OT_MhxVisemeButton(bpy.types.Operator):
#
def getVisemeSet(context, rig):
try:
visset = rig['MhxVisemeSet']
except:
return bodyLanguageVisemes
if visset == 'StopStaring':
return stopStaringVisemes
elif visset == 'BodyLanguage':
return bodyLanguageVisemes
else:
raise NameError("Unknown viseme set %s" % visset)
def setViseme(context, vis, setKey, frame):
rig = getMhxRig(context.object)
pbones = rig.pose.bones
try:
scale = pbones['PFace'].bone.length
except:
return
visemes = getVisemeSet(context, rig)
for (b, (x, z)) in visemes[vis]:
loc = mathutils.Vector((float(x),0,float(z)))
try:
pb = pbones[b]
except:
pb = None
if pb:
setBoneLocation(context, pb, scale, loc, False, setKey, frame)
else:
setBoneLocation(context, pbones[b+'_L'], scale, loc, False, setKey, frame)
setBoneLocation(context, pbones[b+'_R'], scale, loc, True, setKey, frame)
updatePose(rig)
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
return
def setBoneLocation(context, pb, scale, loc, mirror, setKey, frame):
if mirror:
loc[0] = -loc[0]
pb.location = loc*scale*0.2
if setKey or context.tool_settings.use_keyframe_insert_auto:
for n in range(3):
pb.keyframe_insert('location', index=n, frame=frame, group=pb.name)
return
class VIEW3D_OT_MhxVisemeButton(bpy.types.Operator):
bl_idname = 'mhx.pose_viseme'
bl_label = 'Viseme'
viseme = StringProperty()
def invoke(self, context, event):
setViseme(context, self.viseme, False, context.scene.frame_current)
return{'FINISHED'}
#
# openFile(context, filepath):
# readMoho(context, filepath, offs):
# readMagpie(context, filepath, offs):
#
def openFile(context, filepath):
(path, fileName) = os.path.split(filepath)
(name, ext) = os.path.splitext(fileName)
return open(filepath, "rU")
def readMoho(context, filepath, offs):
rig = getMhxRig(context.object)
context.scene.objects.active = rig
bpy.ops.object.mode_set(mode='POSE')
fp = openFile(context, filepath)
for line in fp:
words= line.split()
if len(words) < 2:
pass
else:
vis = mohoVisemes[words[1]]
setViseme(context, vis, True, int(words[0])+offs)
fp.close()
setInterpolation(rig)
updatePose(rig)
print("Moho file %s loaded" % filepath)
return
def readMagpie(context, filepath, offs):
rig = getMhxRig(context.object)
context.scene.objects.active = rig
bpy.ops.object.mode_set(mode='POSE')
fp = openFile(context, filepath)
for line in fp:
words= line.split()
if len(words) < 3:
pass
elif words[2] == 'X':
vis = magpieVisemes[words[3]]
setViseme(context, vis, True, int(words[0])+offs)
fp.close()
setInterpolation(rig)
updatePose(rig)
print("Magpie file %s loaded" % filepath)
return
#
# class VIEW3D_OT_MhxLoadMohoButton(bpy.types.Operator):
#
class VIEW3D_OT_MhxLoadMohoButton(bpy.types.Operator):
bl_idname = "mhx.pose_load_moho"
bl_label = "Moho (.dat)"
filepath = StringProperty(subtype='FILE_PATH')
startFrame = IntProperty(name="Start frame", description="First frame to import", default=1)
def execute(self, context):
import bpy, os, mathutils
readMoho(context, self.properties.filepath, self.properties.startFrame-1)
return{'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
#
# class VIEW3D_OT_MhxLoadMagpieButton(bpy.types.Operator):
#
class VIEW3D_OT_MhxLoadMagpieButton(bpy.types.Operator):
bl_idname = "mhx.pose_load_magpie"
bl_label = "Magpie (.mag)"
filepath = StringProperty(subtype='FILE_PATH')
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
startFrame = IntProperty(name="Start frame", description="First frame to import", default=1)
def execute(self, context):
import bpy, os, mathutils
readMagpie(context, self.properties.filepath, self.properties.startFrame-1)
return{'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
#
# class MhxLipsyncPanel(bpy.types.Panel):
#
class MhxLipsyncPanel(bpy.types.Panel):
bl_label = "MHX Lipsync"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
return context.object
def draw(self, context):
rig = getMhxRig(context.object)
if not rig:
return
layout = self.layout
layout.label(text="Visemes")
for (vis1, vis2, vis3) in VisemeList:
row = layout.row()
row.operator("mhx.pose_viseme", text=vis1).viseme = vis1
row.operator("mhx.pose_viseme", text=vis2).viseme = vis2
row.operator("mhx.pose_viseme", text=vis3).viseme = vis3
layout.separator()
row = layout.row()
row.operator("mhx.pose_viseme", text="Blink").viseme = 'Blink'
row.operator("mhx.pose_viseme", text="Unblink").viseme = 'Unblink'
layout.label(text="Load file")
row = layout.row()
row.operator("mhx.pose_load_moho")
row.operator("mhx.pose_load_magpie")
layout.operator("mhx.update")
layout.separator()
layout.operator("mhx.make_visemes")
#
# updatePose(rig):
# class VIEW3D_OT_MhxUpdateButton(bpy.types.Operator):
#
def updatePose(rig):
pb = rig.pose.bones["PFaceDisp"]
pb.location = pb.location
return
class VIEW3D_OT_MhxUpdateButton(bpy.types.Operator):
bl_idname = "mhx.update"
bl_label = "Update"
def execute(self, context):
rig = getMhxRig(context.object)
updatePose(rig)
return{'FINISHED'}
###################################################################################
#
# Expression panel
#
###################################################################################
#
# class VIEW3D_OT_MhxResetExpressionsButton(bpy.types.Operator):
#
class VIEW3D_OT_MhxResetExpressionsButton(bpy.types.Operator):
bl_idname = "mhx.pose_reset_expressions"
bl_label = "Reset expressions"
def execute(self, context):
rig = getMhxRig(context.object)
props = getShapeProps(rig)
for (prop, name) in props:
rig[prop] = 0.0
updatePose(rig)
return{'FINISHED'}
#
# class VIEW3D_OT_MhxKeyExpressionButton(bpy.types.Operator):
#
class VIEW3D_OT_MhxKeyExpressionsButton(bpy.types.Operator):
bl_idname = "mhx.pose_key_expressions"
bl_label = "Key expressions"
def execute(self, context):
rig = getMhxRig(context.object)
props = getShapeProps(rig)
frame = context.scene.frame_current
for (prop, name) in props:
rig.keyframe_insert('["%s"]' % prop, frame=frame)
updatePose(rig)
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
return{'FINISHED'}
#
# class VIEW3D_OT_MhxPinExpressionButton(bpy.types.Operator):
#
class VIEW3D_OT_MhxPinExpressionButton(bpy.types.Operator):
bl_idname = "mhx.pose_pin_expression"
bl_label = "Pin"
expression = StringProperty()
def execute(self, context):
rig = getMhxRig(context.object)
props = getShapeProps(rig)
if context.tool_settings.use_keyframe_insert_auto:
frame = context.scene.frame_current
for (prop, name) in props:
old = rig[prop]
if prop == self.expression:
rig[prop] = 1.0
else:
rig[prop] = 0.0
if abs(rig[prop] - old) > 1e-3:
rig.keyframe_insert('["%s"]' % prop, frame=frame)
else:
for (prop, name) in props:
if prop == self.expression:
rig[prop] = 1.0
else:
rig[prop] = 0.0
updatePose(rig)
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
return{'FINISHED'}
#
# getShapeProps(ob):
#
def getShapeProps(rig):
props = []
plist = list(rig.keys())
plist.sort()
for prop in plist:
if prop[0] == '*':
props.append((prop, prop[1:]))
return props
#
# class MhxExpressionsPanel(bpy.types.Panel):
#
class MhxExpressionsPanel(bpy.types.Panel):
bl_label = "MHX Expressions"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
return context.object
def draw(self, context):
rig = getMhxRig(context.object)
if not rig:
return
props = getShapeProps(rig)
if not props:
return
layout = self.layout
layout.label(text="Expressions")
layout.operator("mhx.pose_reset_expressions")
layout.operator("mhx.pose_key_expressions")
#layout.operator("mhx.update")
layout.separator()
for (prop, name) in props:
Thomas Larsson
committed
row = layout.split(0.85)
row.prop(rig, '["%s"]' % prop, text=name)
Thomas Larsson
committed
row.operator("mhx.pose_pin_expression", text="", icon='UNPINNED').expression = prop
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
return
###################################################################################
#
# Posing panel
#
###################################################################################
#
# class MhxDriversPanel(bpy.types.Panel):
#
class MhxDriversPanel(bpy.types.Panel):
bl_label = "MHX Drivers"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
return pollMhxRig(context.object)
def draw(self, context):
lProps = []
rProps = []
props = []
plist = list(context.object.keys())
plist.sort()
for prop in plist:
Thomas Larsson
committed
if prop[0] == '&':
prop1 = prop[1:]
else:
continue
if prop[-2:] == '_L':
Thomas Larsson
committed
lProps.append((prop, prop1[:-2]))
elif prop[-2:] == '_R':
Thomas Larsson
committed
rProps.append((prop, prop1[:-2]))
Thomas Larsson
committed
props.append((prop, prop1))
ob = context.object
layout = self.layout
Thomas Larsson
committed
for (prop, pname) in props:
layout.prop(ob, '["%s"]' % prop, text=pname)
layout.label("Left")
for (prop, pname) in lProps:
layout.prop(ob, '["%s"]' % prop, text=pname)
layout.label("Right")
for (prop, pname) in rProps:
layout.prop(ob, '["%s"]' % prop, text=pname)
return
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
###################################################################################
#
# Visibility panel
#
###################################################################################
#
# class MhxVisibilityPanel(bpy.types.Panel):
#
class MhxVisibilityPanel(bpy.types.Panel):
bl_label = "MHX Visibility"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
return pollMhxRig(context.object)
def draw(self, context):
ob = context.object
props = list(ob.keys())
props.sort()
for prop in props:
if prop[0:4] == "Hide":
self.layout.prop(ob, '["%s"]' % prop)
return
###################################################################################
#
# Layers panel
#
###################################################################################
MhxLayers = [
(( 0, 'Root', 'MhxRoot'),
( 8, 'Face', 'MhxFace')),
(( 9, 'Tweak', 'MhxTweak'),
(10, 'Head', 'MhxHead')),
(( 1, 'FK Spine', 'MhxFKSpine'),
(17, 'IK Spine', 'MhxIKSpine')),
((13, 'Inv FK Spine', 'MhxInvFKSpine'),
(16, 'Clothes', 'MhxClothes')),
('Left', 'Right'),
(( 2, 'IK Arm', 'MhxIKArm'),
(18, 'IK Arm', 'MhxIKArm')),
(( 3, 'FK Arm', 'MhxFKArm'),
(19, 'FK Arm', 'MhxFKArm')),
(( 4, 'IK Leg', 'MhxIKLeg'),
(20, 'IK Leg', 'MhxIKLeg')),
(( 5, 'FK Leg', 'MhxFKLeg'),
(21, 'FK Leg', 'MhxFKLeg')),
((12, 'Extra', 'MhxExtra'),
(28, 'Extra', 'MhxExtra')),
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
(( 6, 'Fingers', 'MhxFingers'),
(22, 'Fingers', 'MhxFingers')),
(( 7, 'Links', 'MhxLinks'),
(23, 'Links', 'MhxLinks')),
((11, 'Palm', 'MhxPalm'),
(27, 'Palm', 'MhxPalm')),
]
#
# class MhxLayersPanel(bpy.types.Panel):
#
class MhxLayersPanel(bpy.types.Panel):
bl_label = "MHX Layers"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
return pollMhxRig(context.object)
def draw(self, context):
layout = self.layout
Thomas Larsson
committed
layout.operator("mhx.pose_enable_all_layers")
layout.operator("mhx.pose_disable_all_layers")
amt = context.object.data
for (left,right) in MhxLayers:
row = layout.row()
if type(left) == str:
row.label(left)
row.label(right)
else:
for (n, name, prop) in [left,right]:
row.prop(amt, "layers", index=n, toggle=True, text=name)
return
Thomas Larsson
committed
class VIEW3D_OT_MhxEnableAllLayersButton(bpy.types.Operator):
bl_idname = "mhx.pose_enable_all_layers"
bl_label = "Enable all layers"
def execute(self, context):
rig = getMhxRig(context.object)
for (left,right) in MhxLayers:
if type(left) != str:
for (n, name, prop) in [left,right]:
Thomas Larsson
committed
rig.data.layers[n] = True
return{'FINISHED'}
class VIEW3D_OT_MhxDisableAllLayersButton(bpy.types.Operator):
bl_idname = "mhx.pose_disable_all_layers"
bl_label = "Disable all layers"
def execute(self, context):
rig = getMhxRig(context.object)
layers = 32*[False]
pb = context.active_pose_bone
if pb:
for n in range(32):
if pb.bone.layers[n]:
layers[n] = True
break
else:
layers[0] = True
rig.data.layers = layers
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
return{'FINISHED'}
###################################################################################
#
# Common functions
#
###################################################################################
#
# pollMhxRig(ob):
# getMhxRig(ob):
#
def pollMhxRig(ob):
try:
return (ob["MhxRig"] == "MHX")
except:
return False
def getMhxRig(ob):
if ob.type == 'ARMATURE':
rig = ob
elif ob.type == 'MESH':
rig = ob.parent
else:
return None
try:
if (rig["MhxRig"] == "MHX"):
return rig
else:
return None
except:
return None
#
# setInterpolation(rig):
#
def setInterpolation(rig):
if not rig.animation_data:
return
act = rig.animation_data.action
if not act:
return
for fcu in act.fcurves:
for pt in fcu.keyframe_points:
pt.interpolation = 'LINEAR'
fcu.extrapolation = 'CONSTANT'
return
###################################################################################
#
# initialize and register
#
###################################################################################
def menu_func(self, context):
self.layout.operator(ImportMhx.bl_idname, text="MakeHuman (.mhx)...")
Campbell Barton
committed
bpy.utils.register_module(__name__)
Campbell Barton
committed
bpy.utils.unregister_module(__name__)
try:
unregister()
except:
pass
register()