Changed name of Mocap constraints to mocap fixes, for user clarity.
This commit is contained in:
@@ -59,7 +59,7 @@ def addNewConstraint(m_constraint, cons_obj):
|
|||||||
c_type = "LIMIT_LOCATION"
|
c_type = "LIMIT_LOCATION"
|
||||||
#create and store the new constraint within m_constraint
|
#create and store the new constraint within m_constraint
|
||||||
real_constraint = cons_obj.constraints.new(c_type)
|
real_constraint = cons_obj.constraints.new(c_type)
|
||||||
real_constraint.name = "Mocap constraint " + str(len(cons_obj.constraints))
|
real_constraint.name = "Mocap fix " + str(len(cons_obj.constraints))
|
||||||
m_constraint.real_constraint_bone = consObjToBone(cons_obj)
|
m_constraint.real_constraint_bone = consObjToBone(cons_obj)
|
||||||
m_constraint.real_constraint = real_constraint.name
|
m_constraint.real_constraint = real_constraint.name
|
||||||
#set the rest of the constraint properties
|
#set the rest of the constraint properties
|
||||||
@@ -336,7 +336,7 @@ def bakeAllConstraints(obj, s_frame, e_frame, bones):
|
|||||||
simpleBake += [end_bone]
|
simpleBake += [end_bone]
|
||||||
for bone in selectedBones:
|
for bone in selectedBones:
|
||||||
bone.bone.select = True
|
bone.bone.select = True
|
||||||
constraintTrack = obj.animation_data.nla_tracks["Mocap constraints"]
|
constraintTrack = obj.animation_data.nla_tracks["Mocap fixes"]
|
||||||
constraintStrip = constraintTrack.strips[0]
|
constraintStrip = constraintTrack.strips[0]
|
||||||
constraintStrip.action_frame_start = s_frame
|
constraintStrip.action_frame_start = s_frame
|
||||||
constraintStrip.action_frame_end = e_frame
|
constraintStrip.action_frame_end = e_frame
|
||||||
@@ -375,7 +375,7 @@ def unbakeConstraints(context):
|
|||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
bones = obj.pose.bones
|
bones = obj.pose.bones
|
||||||
scene = bpy.context.scene
|
scene = bpy.context.scene
|
||||||
constraintTrack = obj.animation_data.nla_tracks["Mocap constraints"]
|
constraintTrack = obj.animation_data.nla_tracks["Mocap fixes"]
|
||||||
constraintStrip = constraintTrack.strips[0]
|
constraintStrip = constraintTrack.strips[0]
|
||||||
action = constraintStrip.action
|
action = constraintStrip.action
|
||||||
# delete the fcurves on the strip
|
# delete the fcurves on the strip
|
||||||
|
|||||||
@@ -384,9 +384,9 @@ def NLASystemInitialize(enduser_obj, s_frame):
|
|||||||
mocapTrack.name = "Base Mocap Track"
|
mocapTrack.name = "Base Mocap Track"
|
||||||
mocapStrip = mocapTrack.strips.new("Base Mocap", s_frame, mocapAction)
|
mocapStrip = mocapTrack.strips.new("Base Mocap", s_frame, mocapAction)
|
||||||
constraintTrack = anim_data.nla_tracks.new()
|
constraintTrack = anim_data.nla_tracks.new()
|
||||||
constraintTrack.name = "Mocap constraints"
|
constraintTrack.name = "Mocap fixes"
|
||||||
constraintAction = bpy.data.actions.new("Mocap constraints")
|
constraintAction = bpy.data.actions.new("Mocap fixes")
|
||||||
constraintStrip = constraintTrack.strips.new("Mocap constraints", s_frame, constraintAction)
|
constraintStrip = constraintTrack.strips.new("Mocap fixes", s_frame, constraintAction)
|
||||||
constraintStrip.extrapolation = "NOTHING"
|
constraintStrip.extrapolation = "NOTHING"
|
||||||
userTrack = anim_data.nla_tracks.new()
|
userTrack = anim_data.nla_tracks.new()
|
||||||
userTrack.name = "Mocap manual fix"
|
userTrack.name = "Mocap manual fix"
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ from mocap_constraints import *
|
|||||||
|
|
||||||
class MocapConstraint(bpy.types.PropertyGroup):
|
class MocapConstraint(bpy.types.PropertyGroup):
|
||||||
name = bpy.props.StringProperty(name="Name",
|
name = bpy.props.StringProperty(name="Name",
|
||||||
default="Mocap Constraint",
|
default="Mocap Fix",
|
||||||
description="Name of Mocap Constraint",
|
description="Name of Mocap Fix",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
constrained_bone = bpy.props.StringProperty(name="Bone",
|
constrained_bone = bpy.props.StringProperty(name="Bone",
|
||||||
default="",
|
default="",
|
||||||
@@ -53,11 +53,11 @@ class MocapConstraint(bpy.types.PropertyGroup):
|
|||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
s_frame = bpy.props.IntProperty(name="S",
|
s_frame = bpy.props.IntProperty(name="S",
|
||||||
default=1,
|
default=1,
|
||||||
description="Start frame of constraint",
|
description="Start frame of Fix",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
e_frame = bpy.props.IntProperty(name="E",
|
e_frame = bpy.props.IntProperty(name="E",
|
||||||
default=500,
|
default=500,
|
||||||
description="End frame of constrain",
|
description="End frame of Fix",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
smooth_in = bpy.props.IntProperty(name="In",
|
smooth_in = bpy.props.IntProperty(name="In",
|
||||||
default=10,
|
default=10,
|
||||||
@@ -71,22 +71,22 @@ class MocapConstraint(bpy.types.PropertyGroup):
|
|||||||
min=0)
|
min=0)
|
||||||
targetMesh = bpy.props.StringProperty(name="Mesh",
|
targetMesh = bpy.props.StringProperty(name="Mesh",
|
||||||
default="",
|
default="",
|
||||||
description="Target of Constraint - Mesh (optional, depends on type)",
|
description="Target of Fix - Mesh (optional, depends on type)",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
active = bpy.props.BoolProperty(name="Active",
|
active = bpy.props.BoolProperty(name="Active",
|
||||||
default=True,
|
default=True,
|
||||||
description="Constraint is active",
|
description="Fix is active",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
show_expanded = bpy.props.BoolProperty(name="Show Expanded",
|
show_expanded = bpy.props.BoolProperty(name="Show Expanded",
|
||||||
default=True,
|
default=True,
|
||||||
description="Constraint is fully shown")
|
description="Fix is fully shown")
|
||||||
targetPoint = bpy.props.FloatVectorProperty(name="Point", size=3,
|
targetPoint = bpy.props.FloatVectorProperty(name="Point", size=3,
|
||||||
subtype="XYZ", default=(0.0, 0.0, 0.0),
|
subtype="XYZ", default=(0.0, 0.0, 0.0),
|
||||||
description="Target of Constraint - Point",
|
description="Target of Fix - Point",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
targetDist = bpy.props.FloatProperty(name="Offset",
|
targetDist = bpy.props.FloatProperty(name="Offset",
|
||||||
default=0.0,
|
default=0.0,
|
||||||
description="Distance and Floor Constraints - Desired offset",
|
description="Distance and Floor Fixes - Desired offset",
|
||||||
update=setConstraint)
|
update=setConstraint)
|
||||||
targetSpace = bpy.props.EnumProperty(
|
targetSpace = bpy.props.EnumProperty(
|
||||||
items=[("WORLD", "World Space", "Evaluate target in global space"),
|
items=[("WORLD", "World Space", "Evaluate target in global space"),
|
||||||
@@ -100,7 +100,7 @@ class MocapConstraint(bpy.types.PropertyGroup):
|
|||||||
("freeze", "Maintain Position at frame", "Bone does not move from location specified in target frame"),
|
("freeze", "Maintain Position at frame", "Bone does not move from location specified in target frame"),
|
||||||
("floor", "Stay above", "Bone does not cross specified mesh object eg floor"),
|
("floor", "Stay above", "Bone does not cross specified mesh object eg floor"),
|
||||||
("distance", "Maintain distance", "Target bones maintained specified distance")],
|
("distance", "Maintain distance", "Target bones maintained specified distance")],
|
||||||
description="Type of constraint",
|
description="Type of Fix",
|
||||||
update=updateConstraintBoneType)
|
update=updateConstraintBoneType)
|
||||||
real_constraint = bpy.props.StringProperty()
|
real_constraint = bpy.props.StringProperty()
|
||||||
real_constraint_bone = bpy.props.StringProperty()
|
real_constraint_bone = bpy.props.StringProperty()
|
||||||
@@ -241,7 +241,7 @@ class MocapPanel(bpy.types.Panel):
|
|||||||
|
|
||||||
class MocapConstraintsPanel(bpy.types.Panel):
|
class MocapConstraintsPanel(bpy.types.Panel):
|
||||||
#Motion capture constraints panel
|
#Motion capture constraints panel
|
||||||
bl_label = "Mocap constraints"
|
bl_label = "Mocap Fixes"
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "WINDOW"
|
bl_region_type = "WINDOW"
|
||||||
bl_context = "object"
|
bl_context = "object"
|
||||||
@@ -472,13 +472,13 @@ class OBJECT_OT_ScaleFixArmature(bpy.types.Operator):
|
|||||||
class MOCAP_OT_AddMocapFix(bpy.types.Operator):
|
class MOCAP_OT_AddMocapFix(bpy.types.Operator):
|
||||||
'''Add a post-retarget fix - useful for fixing certain artifacts following the retarget'''
|
'''Add a post-retarget fix - useful for fixing certain artifacts following the retarget'''
|
||||||
bl_idname = "mocap.addmocapfix"
|
bl_idname = "mocap.addmocapfix"
|
||||||
bl_label = "Add constraint to target armature"
|
bl_label = "Add Mocap Fix to target armature"
|
||||||
type = bpy.props.EnumProperty(name="Type of constraint",
|
type = bpy.props.EnumProperty(name="Type of Fix",
|
||||||
items=[("point", "Maintain Position", "Bone is at a specific point"),
|
items=[("point", "Maintain Position", "Bone is at a specific point"),
|
||||||
("freeze", "Maintain Position at frame", "Bone does not move from location specified in target frame"),
|
("freeze", "Maintain Position at frame", "Bone does not move from location specified in target frame"),
|
||||||
("floor", "Stay above", "Bone does not cross specified mesh object eg floor"),
|
("floor", "Stay above", "Bone does not cross specified mesh object eg floor"),
|
||||||
("distance", "Maintain distance", "Target bones maintained specified distance")],
|
("distance", "Maintain distance", "Target bones maintained specified distance")],
|
||||||
description="Type of constraint")
|
description="Type of fix")
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
enduser_obj = bpy.context.active_object
|
enduser_obj = bpy.context.active_object
|
||||||
@@ -496,7 +496,7 @@ class MOCAP_OT_AddMocapFix(bpy.types.Operator):
|
|||||||
class OBJECT_OT_RemoveMocapConstraint(bpy.types.Operator):
|
class OBJECT_OT_RemoveMocapConstraint(bpy.types.Operator):
|
||||||
'''Remove this post-retarget fix'''
|
'''Remove this post-retarget fix'''
|
||||||
bl_idname = "mocap.removeconstraint"
|
bl_idname = "mocap.removeconstraint"
|
||||||
bl_label = "Removes constraints from target armature"
|
bl_label = "Removes fixes from target armature"
|
||||||
constraint = bpy.props.IntProperty()
|
constraint = bpy.props.IntProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
@@ -520,7 +520,7 @@ class OBJECT_OT_RemoveMocapConstraint(bpy.types.Operator):
|
|||||||
class OBJECT_OT_BakeMocapConstraints(bpy.types.Operator):
|
class OBJECT_OT_BakeMocapConstraints(bpy.types.Operator):
|
||||||
'''Bake all post-retarget fixes to the Retarget Fixes NLA Track'''
|
'''Bake all post-retarget fixes to the Retarget Fixes NLA Track'''
|
||||||
bl_idname = "mocap.bakeconstraints"
|
bl_idname = "mocap.bakeconstraints"
|
||||||
bl_label = "Bake all constraints to target armature"
|
bl_label = "Bake all fixes to target armature"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
bakeConstraints(context)
|
bakeConstraints(context)
|
||||||
@@ -535,7 +535,7 @@ class OBJECT_OT_BakeMocapConstraints(bpy.types.Operator):
|
|||||||
class OBJECT_OT_UnbakeMocapConstraints(bpy.types.Operator):
|
class OBJECT_OT_UnbakeMocapConstraints(bpy.types.Operator):
|
||||||
'''Unbake all post-retarget fixes - removes the baked data from the Retarget Fixes NLA Track'''
|
'''Unbake all post-retarget fixes - removes the baked data from the Retarget Fixes NLA Track'''
|
||||||
bl_idname = "mocap.unbakeconstraints"
|
bl_idname = "mocap.unbakeconstraints"
|
||||||
bl_label = "Unbake all constraints to target armature"
|
bl_label = "Unbake all fixes to target armature"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
unbakeConstraints(context)
|
unbakeConstraints(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user