Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rigify/rigs/pitchipoy/limbs')
-rw-r--r--rigify/rigs/pitchipoy/limbs/arm.py18
-rw-r--r--rigify/rigs/pitchipoy/limbs/leg.py68
-rw-r--r--rigify/rigs/pitchipoy/limbs/limb_utils.py14
-rw-r--r--rigify/rigs/pitchipoy/limbs/paw.py24
-rw-r--r--rigify/rigs/pitchipoy/limbs/super_limb.py138
-rw-r--r--rigify/rigs/pitchipoy/limbs/ui.py10
6 files changed, 136 insertions, 136 deletions
diff --git a/rigify/rigs/pitchipoy/limbs/arm.py b/rigify/rigs/pitchipoy/limbs/arm.py
index 43327ec8..17bf5535 100644
--- a/rigify/rigs/pitchipoy/limbs/arm.py
+++ b/rigify/rigs/pitchipoy/limbs/arm.py
@@ -27,26 +27,26 @@ from rna_prop_ui import rna_idprop_ui_prop_get
def create_arm( cls, bones ):
org_bones = cls.org_bones
-
+
bpy.ops.object.mode_set(mode='EDIT')
eb = cls.obj.data.edit_bones
ctrl = get_bone_name( org_bones[2], 'ctrl', 'ik' )
-
+
# Create IK arm control
ctrl = copy_bone( cls.obj, org_bones[2], ctrl )
- # clear parent (so that rigify will parent to root)
+ # clear parent (so that rigify will parent to root)
eb[ ctrl ].parent = None
eb[ ctrl ].use_connect = False
- # Parent
+ # Parent
eb[ bones['ik']['mch_target'] ].parent = eb[ ctrl ]
eb[ bones['ik']['mch_target'] ].use_connect = False
-
+
# Set up constraints
# Constrain mch target bone to the ik control and mch stretch
-
+
make_constraint( cls, bones['ik']['mch_target'], {
'constraint' : 'COPY_LOCATION',
'subtarget' : bones['ik']['mch_str'],
@@ -80,7 +80,7 @@ def create_arm( cls, bones ):
# Create ik/fk switch property
pb_parent = pb[ bones['parent'] ]
-
+
pb_parent['IK_Strertch'] = 1.0
prop = rna_idprop_ui_prop_get( pb_parent, 'IK_Strertch', create=True )
prop["min"] = 0.0
@@ -93,7 +93,7 @@ def create_arm( cls, bones ):
b = bones['ik']['mch_str']
drv = pb[b].constraints[-1].driver_add("influence").driver
drv.type = 'SUM'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -102,7 +102,7 @@ def create_arm( cls, bones ):
pb_parent.path_from_id() + '['+ '"' + prop.name + '"' + ']'
drv_modifier = cls.obj.animation_data.drivers[-1].modifiers[0]
-
+
drv_modifier.mode = 'POLYNOMIAL'
drv_modifier.poly_order = 1
drv_modifier.coefficients[0] = 1.0
diff --git a/rigify/rigs/pitchipoy/limbs/leg.py b/rigify/rigs/pitchipoy/limbs/leg.py
index 9176bd92..14fd6f13 100644
--- a/rigify/rigs/pitchipoy/limbs/leg.py
+++ b/rigify/rigs/pitchipoy/limbs/leg.py
@@ -31,7 +31,7 @@ def create_leg( cls, bones ):
)
bones['ik']['ctrl']['terminal'] = []
-
+
bpy.ops.object.mode_set(mode='EDIT')
eb = cls.obj.data.edit_bones
@@ -49,7 +49,7 @@ def create_leg( cls, bones ):
ctrl = get_bone_name( org_bones[2], 'ctrl', 'ik' )
ctrl = copy_bone( cls.obj, org_bones[2], ctrl )
- # clear parent (so that rigify will parent to root)
+ # clear parent (so that rigify will parent to root)
eb[ ctrl ].parent = None
eb[ ctrl ].use_connect = False
@@ -64,7 +64,7 @@ def create_leg( cls, bones ):
orient_bone( cls, eb[ ctrl ], 'y', reverse = True )
eb[ ctrl ].length = l
- # Parent
+ # Parent
eb[ heel ].use_connect = False
eb[ heel ].parent = eb[ ctrl ]
@@ -91,38 +91,38 @@ def create_leg( cls, bones ):
# Create 2nd roll mch, and two rock mch bones
roll2_mch = get_bone_name( tmp_heel, 'mch', 'roll' )
- roll2_mch = copy_bone( cls.obj, org_bones[3], roll2_mch )
+ roll2_mch = copy_bone( cls.obj, org_bones[3], roll2_mch )
eb[ roll2_mch ].use_connect = False
eb[ roll2_mch ].parent = None
-
- put_bone(
- cls.obj,
- roll2_mch,
+
+ put_bone(
+ cls.obj,
+ roll2_mch,
( eb[ tmp_heel ].head + eb[ tmp_heel ].tail ) / 2
)
eb[ roll2_mch ].length /= 4
-
+
# Rock MCH bones
rock1_mch = get_bone_name( tmp_heel, 'mch', 'rock' )
- rock1_mch = copy_bone( cls.obj, tmp_heel, rock1_mch )
+ rock1_mch = copy_bone( cls.obj, tmp_heel, rock1_mch )
eb[ rock1_mch ].use_connect = False
- eb[ rock1_mch ].parent = None
-
+ eb[ rock1_mch ].parent = None
+
orient_bone( cls, eb[ rock1_mch ], 'y', 1.0, reverse = True )
eb[ rock1_mch ].length = eb[ tmp_heel ].length / 2
-
+
rock2_mch = get_bone_name( tmp_heel, 'mch', 'rock' )
rock2_mch = copy_bone( cls.obj, tmp_heel, rock2_mch )
eb[ rock2_mch ].use_connect = False
- eb[ rock2_mch ].parent = None
+ eb[ rock2_mch ].parent = None
orient_bone( cls, eb[ rock2_mch ], 'y', 1.0 )
eb[ rock2_mch ].length = eb[ tmp_heel ].length / 2
-
+
# Parent rock and roll MCH bones
eb[ roll1_mch ].parent = eb[ roll2_mch ]
eb[ roll2_mch ].parent = eb[ rock1_mch ]
@@ -135,7 +135,7 @@ def create_leg( cls, bones ):
'subtarget' : heel,
'owner_space' : 'LOCAL',
'target_space' : 'LOCAL'
- })
+ })
make_constraint( cls, roll1_mch, {
'constraint' : 'LIMIT_ROTATION',
'use_limit_x' : True,
@@ -150,15 +150,15 @@ def create_leg( cls, bones ):
'invert_x' : True,
'owner_space' : 'LOCAL',
'target_space' : 'LOCAL'
- })
+ })
make_constraint( cls, roll2_mch, {
'constraint' : 'LIMIT_ROTATION',
'use_limit_x' : True,
'max_x' : math.radians(360),
'owner_space' : 'LOCAL'
- })
+ })
- pb = cls.obj.pose.bones
+ pb = cls.obj.pose.bones
for i,b in enumerate([ rock1_mch, rock2_mch ]):
head_tail = pb[b].head - pb[tmp_heel].head
if '.L' in b:
@@ -176,7 +176,7 @@ def create_leg( cls, bones ):
min_y = 0
max_y = math.radians(360)
-
+
make_constraint( cls, b, {
'constraint' : 'COPY_ROTATION',
'subtarget' : heel,
@@ -184,14 +184,14 @@ def create_leg( cls, bones ):
'use_z' : False,
'owner_space' : 'LOCAL',
'target_space' : 'LOCAL'
- })
+ })
make_constraint( cls, b, {
'constraint' : 'LIMIT_ROTATION',
'use_limit_y' : True,
'min_y' : min_y,
'max_y' : max_y,
'owner_space' : 'LOCAL'
- })
+ })
# Constrain 4th ORG to roll2 MCH bone
make_constraint( cls, org_bones[3], {
@@ -201,7 +201,7 @@ def create_leg( cls, bones ):
# Set up constraints
# Constrain mch target bone to the ik control and mch stretch
-
+
make_constraint( cls, bones['ik']['mch_target'], {
'constraint' : 'COPY_LOCATION',
'subtarget' : bones['ik']['mch_str'],
@@ -235,7 +235,7 @@ def create_leg( cls, bones ):
# Create ik/fk switch property
pb_parent = pb[ bones['parent'] ]
-
+
pb_parent['IK_Strertch'] = 1.0
prop = rna_idprop_ui_prop_get( pb_parent, 'IK_Strertch', create=True )
prop["min"] = 0.0
@@ -248,7 +248,7 @@ def create_leg( cls, bones ):
b = bones['ik']['mch_str']
drv = pb[b].constraints[-1].driver_add("influence").driver
drv.type = 'AVERAGE'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -257,7 +257,7 @@ def create_leg( cls, bones ):
pb_parent.path_from_id() + '['+ '"' + prop.name + '"' + ']'
drv_modifier = cls.obj.animation_data.drivers[-1].modifiers[0]
-
+
drv_modifier.mode = 'POLYNOMIAL'
drv_modifier.poly_order = 1
drv_modifier.coefficients[0] = 1.0
@@ -284,7 +284,7 @@ def create_leg( cls, bones ):
eb[ toes ].use_connect = False
eb[ toes ].parent = eb[ org_bones[3] ]
-
+
# Constrain toes def bones
make_constraint( cls, bones['def'][-2], {
'constraint' : 'DAMPED_TRACK',
@@ -293,8 +293,8 @@ def create_leg( cls, bones ):
make_constraint( cls, bones['def'][-2], {
'constraint' : 'STRETCH_TO',
'subtarget' : toes
- })
-
+ })
+
make_constraint( cls, bones['def'][-1], {
'constraint' : 'COPY_TRANSFORMS',
'subtarget' : toes
@@ -303,12 +303,12 @@ def create_leg( cls, bones ):
# Find IK/FK switch property
pb = cls.obj.pose.bones
prop = rna_idprop_ui_prop_get( pb[ bones['parent'] ], 'IK/FK' )
-
+
# Add driver to limit scale constraint influence
b = org_bones[3]
drv = pb[b].constraints[-1].driver_add("influence").driver
drv.type = 'AVERAGE'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -317,17 +317,17 @@ def create_leg( cls, bones ):
pb_parent.path_from_id() + '['+ '"' + prop.name + '"' + ']'
drv_modifier = cls.obj.animation_data.drivers[-1].modifiers[0]
-
+
drv_modifier.mode = 'POLYNOMIAL'
drv_modifier.poly_order = 1
drv_modifier.coefficients[0] = 1.0
drv_modifier.coefficients[1] = -1.0
-
+
# Create toe circle widget
create_circle_widget(cls.obj, toes, radius=0.4, head_tail=0.5)
bones['ik']['ctrl']['terminal'] += [ toes ]
bones['ik']['ctrl']['terminal'] += [ heel, ctrl ]
-
+
return bones
diff --git a/rigify/rigs/pitchipoy/limbs/limb_utils.py b/rigify/rigs/pitchipoy/limbs/limb_utils.py
index 73e4f472..ce6a0761 100644
--- a/rigify/rigs/pitchipoy/limbs/limb_utils.py
+++ b/rigify/rigs/pitchipoy/limbs/limb_utils.py
@@ -7,13 +7,13 @@ bilateral_suffixes = ['.L','.R']
def orient_bone( cls, eb, axis, scale = 1.0, reverse = False ):
v = Vector((0,0,0))
-
+
setattr(v,axis,scale)
if reverse:
tail_vec = v * cls.obj.matrix_world
eb.head[:] = eb.tail
- eb.tail[:] = eb.head + tail_vec
+ eb.tail[:] = eb.head + tail_vec
else:
tail_vec = v * cls.obj.matrix_world
eb.tail[:] = eb.head + tail_vec
@@ -29,22 +29,22 @@ def make_constraint( cls, bone, constraint ):
constraint['target'] = cls.obj
- # filter contraint props to those that actually exist in the currnet
+ # filter contraint props to those that actually exist in the currnet
# type of constraint, then assign values to each
for p in [ k for k in constraint.keys() if k in dir(const) ]:
if p in dir( const ):
setattr( const, p, constraint[p] )
else:
raise MetarigError(
- "RIGIFY ERROR: property %s does not exist in %s constraint" % (
+ "RIGIFY ERROR: property %s does not exist in %s constraint" % (
p, constraint['constraint']
))
def get_bone_name( name, btype, suffix = '' ):
# RE pattern match right or left parts
- # match the letter "L" (or "R"), followed by an optional dot (".")
+ # match the letter "L" (or "R"), followed by an optional dot (".")
# and 0 or more digits at the end of the the string
- pattern = r'^(\S+)(\.\S+)$'
+ pattern = r'^(\S+)(\.\S+)$'
name = strip_org( name )
@@ -60,7 +60,7 @@ def get_bone_name( name, btype, suffix = '' ):
if suffix:
results = re.match( pattern, name )
bname, addition = ('','')
-
+
if results:
bname, addition = results.groups()
name = bname + "_" + suffix + addition
diff --git a/rigify/rigs/pitchipoy/limbs/paw.py b/rigify/rigs/pitchipoy/limbs/paw.py
index 89de5e90..03ccd25f 100644
--- a/rigify/rigs/pitchipoy/limbs/paw.py
+++ b/rigify/rigs/pitchipoy/limbs/paw.py
@@ -32,7 +32,7 @@ def create_paw( cls, bones ):
bones['ik']['ctrl']['terminal'] = []
-
+
bpy.ops.object.mode_set(mode='EDIT')
eb = cls.obj.data.edit_bones
@@ -57,7 +57,7 @@ def create_paw( cls, bones ):
eb[ heel ].use_connect = False
flip_bone( cls.obj, heel )
-
+
eb[ bones['ik']['mch_target'] ].parent = eb[ heel ]
eb[ bones['ik']['mch_target'] ].use_connect = False
@@ -68,7 +68,7 @@ def create_paw( cls, bones ):
# Set up constraints
# Constrain mch target bone to the ik control and mch stretch
-
+
make_constraint( cls, bones['ik']['mch_target'], {
'constraint' : 'COPY_LOCATION',
'subtarget' : bones['ik']['mch_str'],
@@ -104,7 +104,7 @@ def create_paw( cls, bones ):
# Create ik/fk switch property
pb_parent = pb[ bones['parent'] ]
-
+
pb_parent['IK_Strertch'] = 1.0
prop = rna_idprop_ui_prop_get( pb_parent, 'IK_Strertch', create=True )
prop["min"] = 0.0
@@ -117,7 +117,7 @@ def create_paw( cls, bones ):
b = bones['ik']['mch_str']
drv = pb[b].constraints[-1].driver_add("influence").driver
drv.type = 'AVERAGE'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -126,7 +126,7 @@ def create_paw( cls, bones ):
pb_parent.path_from_id() + '['+ '"' + prop.name + '"' + ']'
drv_modifier = cls.obj.animation_data.drivers[-1].modifiers[0]
-
+
drv_modifier.mode = 'POLYNOMIAL'
drv_modifier.poly_order = 1
drv_modifier.coefficients[0] = 1.0
@@ -151,7 +151,7 @@ def create_paw( cls, bones ):
eb[ toes ].use_connect = False
eb[ toes ].parent = eb[ org_bones[3] ]
-
+
# Create toes mch bone
toes_mch = get_bone_name( org_bones[3], 'mch' )
toes_mch = copy_bone( cls.obj, org_bones[3], toes_mch )
@@ -160,7 +160,7 @@ def create_paw( cls, bones ):
eb[ toes_mch ].parent = eb[ ctrl ]
eb[ toes_mch ].length /= 4
-
+
# Constrain 4th ORG to toes MCH bone
make_constraint( cls, org_bones[3], {
'constraint' : 'COPY_TRANSFORMS',
@@ -184,12 +184,12 @@ def create_paw( cls, bones ):
# Find IK/FK switch property
pb = cls.obj.pose.bones
prop = rna_idprop_ui_prop_get( pb[ bones['parent'] ], 'IK/FK' )
-
+
# Add driver to limit scale constraint influence
b = org_bones[3]
drv = pb[b].constraints[-1].driver_add("influence").driver
drv.type = 'AVERAGE'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -198,12 +198,12 @@ def create_paw( cls, bones ):
pb_parent.path_from_id() + '['+ '"' + prop.name + '"' + ']'
drv_modifier = cls.obj.animation_data.drivers[-1].modifiers[0]
-
+
drv_modifier.mode = 'POLYNOMIAL'
drv_modifier.poly_order = 1
drv_modifier.coefficients[0] = 1.0
drv_modifier.coefficients[1] = -1.0
-
+
# Create toe circle widget
create_circle_widget(cls.obj, toes, radius=0.4, head_tail=0.5)
diff --git a/rigify/rigs/pitchipoy/limbs/super_limb.py b/rigify/rigs/pitchipoy/limbs/super_limb.py
index 40447097..b1d58ea7 100644
--- a/rigify/rigs/pitchipoy/limbs/super_limb.py
+++ b/rigify/rigs/pitchipoy/limbs/super_limb.py
@@ -47,7 +47,7 @@ class Rig:
def create_parent( self ):
org_bones = self.org_bones
-
+
bpy.ops.object.mode_set(mode ='EDIT')
eb = self.obj.data.edit_bones
@@ -58,9 +58,9 @@ class Rig:
eb[ mch ].length = eb[ org_bones[0] ].length / 4
eb[ mch ].parent = eb[ org_bones[0] ].parent
-
+
eb[ mch ].roll = 0.0
-
+
# Constraints
make_constraint( self, mch, {
'constraint' : 'COPY_ROTATION',
@@ -71,7 +71,7 @@ class Rig:
'constraint' : 'COPY_SCALE',
'subtarget' : 'root'
})
-
+
# Limb Follow Driver
pb = self.obj.pose.bones
@@ -79,7 +79,7 @@ class Rig:
pb[ mch ][ name ] = 0.0
prop = rna_idprop_ui_prop_get( pb[ mch ], name, create = True )
-
+
prop["min"] = 0.0
prop["max"] = 1.0
prop["soft_min"] = 0.0
@@ -100,11 +100,11 @@ class Rig:
def create_tweak( self ):
org_bones = self.org_bones
-
+
bpy.ops.object.mode_set(mode ='EDIT')
eb = self.obj.data.edit_bones
- tweaks = {}
+ tweaks = {}
tweaks['ctrl'] = []
tweaks['mch' ] = []
@@ -116,15 +116,15 @@ class Rig:
# MCH
name = get_bone_name( strip_org(org), 'mch', 'tweak' )
mch = copy_bone( self.obj, org, name )
-
+
# CTRL
name = get_bone_name( strip_org(org), 'ctrl', 'tweak' )
ctrl = copy_bone( self.obj, org, name )
-
+
eb[ mch ].length /= self.segments
eb[ ctrl ].length /= self.segments
- # If we have more than one segments, place the head of the
+ # If we have more than one segments, place the head of the
# 2nd and onwards at the correct position
if j > 0:
put_bone(self.obj, mch, eb[ tweaks['mch' ][-1] ].tail)
@@ -137,23 +137,23 @@ class Rig:
eb[ mch ].parent = eb[ org ]
eb[ ctrl ].parent = eb[ mch ]
- else: # Last limb bone - is not subdivided
- name = get_bone_name( strip_org(org), 'mch', 'tweak' )
+ else: # Last limb bone - is not subdivided
+ name = get_bone_name( strip_org(org), 'mch', 'tweak' )
mch = copy_bone( self.obj, org_bones[i-1], name )
eb[ mch ].length = eb[org].length / 4
put_bone(
- self.obj,
+ self.obj,
mch,
eb[org_bones[i-1]].tail
- )
-
+ )
+
ctrl = get_bone_name( strip_org(org), 'ctrl', 'tweak' )
ctrl = copy_bone( self.obj, org, ctrl )
- eb[ ctrl ].length = eb[org].length / 2
+ eb[ ctrl ].length = eb[org].length / 2
tweaks['mch'] += [ mch ]
tweaks['ctrl'] += [ ctrl ]
-
+
# Parenting the tweak ctrls to mchs
eb[ mch ].parent = eb[ org ]
eb[ ctrl ].parent = eb[ mch ]
@@ -256,19 +256,19 @@ class Rig:
pb[t].lock_scale = False, True, False
create_sphere_widget(self.obj, t, bone_transform_name=None)
-
+
if self.tweak_layers:
- pb[t].bone.layers = self.tweak_layers
-
+ pb[t].bone.layers = self.tweak_layers
+
return tweaks
def create_def( self, tweaks ):
org_bones = self.org_bones
-
+
bpy.ops.object.mode_set(mode ='EDIT')
eb = self.obj.data.edit_bones
-
+
def_bones = []
for i,org in enumerate(org_bones):
if i < len(org_bones) - 1:
@@ -276,7 +276,7 @@ class Rig:
for j in range( self.segments ):
name = get_bone_name( strip_org(org), 'def' )
def_name = copy_bone( self.obj, org, name )
-
+
eb[ def_name ].length /= self.segments
# If we have more than one segments, place the 2nd and
@@ -338,7 +338,7 @@ class Rig:
pb[t][name] = 1.0
prop = rna_idprop_ui_prop_get( pb[t], name, create=True )
-
+
prop["min"] = 0.0
prop["max"] = 2.0
prop["soft_min"] = 0.0
@@ -365,13 +365,13 @@ class Rig:
var.targets[0].id = self.obj
var.targets[0].data_path = pb[tweaks[d]].path_from_id() + \
'[' + '"' + name + '"' + ']'
-
+
return def_bones
-
-
+
+
def create_ik( self, parent ):
org_bones = self.org_bones
-
+
bpy.ops.object.mode_set(mode ='EDIT')
eb = self.obj.data.edit_bones
@@ -387,7 +387,7 @@ class Rig:
# Create MCH Stretch
mch_str = copy_bone(
- self.obj,
+ self.obj,
org_bones[0],
get_bone_name( org_bones[0], 'mch', 'ik_stretch' )
)
@@ -396,13 +396,13 @@ class Rig:
eb[ mch_str ].tail = eb[ org_bones[-1] ].head
else:
eb[ mch_str ].tail = eb[ org_bones[-2] ].head
-
+
# Parenting
eb[ ctrl ].parent = eb[ parent ]
eb[ mch_str ].parent = eb[ parent ]
eb[ mch_ik ].parent = eb[ ctrl ]
-
-
+
+
make_constraint( self, mch_ik, {
'constraint' : 'IK',
'subtarget' : mch_target,
@@ -421,13 +421,13 @@ class Rig:
# Locks and Widget
pb[ ctrl ].lock_rotation = True, False, True
create_ikarrow_widget( self.obj, ctrl, bone_transform_name=None )
-
- return { 'ctrl' : { 'limb' : ctrl },
- 'mch_ik' : mch_ik,
+
+ return { 'ctrl' : { 'limb' : ctrl },
+ 'mch_ik' : mch_ik,
'mch_target' : mch_target,
'mch_str' : mch_str
}
-
+
def create_fk( self, parent ):
org_bones = self.org_bones.copy()
@@ -438,19 +438,19 @@ class Rig:
bpy.ops.object.mode_set(mode ='EDIT')
eb = self.obj.data.edit_bones
- ctrls = []
+ ctrls = []
for o in org_bones:
bone = copy_bone( self.obj, o, get_bone_name( o, 'ctrl', 'fk' ) )
ctrls.append( bone )
-
+
# MCH
- mch = copy_bone(
+ mch = copy_bone(
self.obj, org_bones[-1], get_bone_name( o, 'mch', 'fk' )
)
eb[ mch ].length /= 4
-
+
# Parenting
eb[ ctrls[0] ].parent = eb[ parent ]
eb[ ctrls[1] ].parent = eb[ ctrls[0] ]
@@ -464,7 +464,7 @@ class Rig:
'constraint' : 'COPY_SCALE',
'subtarget' : 'root'
})
-
+
# Locks and widgets
pb = self.obj.pose.bones
pb[ ctrls[2] ].lock_location = True, True, True
@@ -479,7 +479,7 @@ class Rig:
pb[c].bone.layers = self.fk_layers
return { 'ctrl' : ctrls, 'mch' : mch }
-
+
def org_parenting_and_switch( self, org, ik, fk, parent ):
bpy.ops.object.mode_set(mode ='EDIT')
@@ -517,11 +517,11 @@ class Rig:
'constraint' : 'COPY_TRANSFORMS',
'subtarget' : f
})
-
+
# Add driver to relevant constraint
drv = pb[o].constraints[-1].driver_add("influence").driver
drv.type = 'AVERAGE'
-
+
var = drv.variables.new()
var.name = prop.name
var.type = "SINGLE_PROP"
@@ -547,48 +547,48 @@ class Rig:
for bone in self.org_bones[1:]:
eb[bone].use_connect = False
eb[bone].parent = None
-
+
bones = {}
# Create mch limb parent
bones['parent'] = self.create_parent()
- bones['tweak'] = self.create_tweak()
+ bones['tweak'] = self.create_tweak()
bones['def'] = self.create_def( bones['tweak']['ctrl'] )
bones['ik'] = self.create_ik( bones['parent'] )
bones['fk'] = self.create_fk( bones['parent'] )
- self.org_parenting_and_switch(
- self.org_bones, bones['ik'], bones['fk']['ctrl'], bones['parent']
+ self.org_parenting_and_switch(
+ self.org_bones, bones['ik'], bones['fk']['ctrl'], bones['parent']
)
bones = self.create_terminal( self.limb_type, bones )
-
+
return [ create_script( bones, self.limb_type ) ]
-
+
def add_parameters( params ):
""" Add the parameters of this rig type to the
RigifyParameters PropertyGroup
"""
items = [
- ('arm', 'Arm', ''),
- ('leg', 'Leg', ''),
+ ('arm', 'Arm', ''),
+ ('leg', 'Leg', ''),
('paw', 'Paw', '')
]
params.limb_type = bpy.props.EnumProperty(
- items = items,
- name = "Limb Type",
+ items = items,
+ name = "Limb Type",
default = 'arm'
)
items = [
- ('x', 'X', ''),
- ('y', 'Y', ''),
+ ('x', 'X', ''),
+ ('y', 'Y', ''),
('z', 'Z', '')
]
params.rotation_axis = bpy.props.EnumProperty(
- items = items,
- name = "Rotation Axis",
+ items = items,
+ name = "Rotation Axis",
default = 'x'
)
@@ -598,7 +598,7 @@ def add_parameters( params ):
min = 1,
description = 'Number of segments'
)
-
+
params.bbones = bpy.props.IntProperty(
name = 'bbone segments',
default = 10,
@@ -607,9 +607,9 @@ def add_parameters( params ):
)
# Setting up extra layers for the FK and tweak
- params.tweak_extra_layers = bpy.props.BoolProperty(
- name = "tweak_extra_layers",
- default = True,
+ params.tweak_extra_layers = bpy.props.BoolProperty(
+ name = "tweak_extra_layers",
+ default = True,
description = ""
)
@@ -618,11 +618,11 @@ def add_parameters( params ):
description = "Layers for the tweak controls to be on",
default = tuple( [ i == 1 for i in range(0, 32) ] )
)
-
+
# Setting up extra layers for the FK and tweak
- params.fk_extra_layers = bpy.props.BoolProperty(
- name = "fk_extra_layers",
- default = True,
+ params.fk_extra_layers = bpy.props.BoolProperty(
+ name = "fk_extra_layers",
+ default = True,
description = ""
)
@@ -638,7 +638,7 @@ def parameters_ui(layout, params):
r = layout.row()
r.prop(params, "limb_type")
-
+
r = layout.row()
r.prop(params, "rotation_axis")
@@ -652,7 +652,7 @@ def parameters_ui(layout, params):
r = layout.row()
r.prop(params, layer + "_extra_layers")
r.active = params.tweak_extra_layers
-
+
col = r.column(align=True)
row = col.row(align=True)
@@ -716,7 +716,7 @@ def create_sample(obj):
except AttributeError:
pass
try:
- pbone.rigify_parameters.ik_layers = [
+ pbone.rigify_parameters.ik_layers = [
False, False, False, False, False, False, False, False, True, False,
False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False, False,
diff --git a/rigify/rigs/pitchipoy/limbs/ui.py b/rigify/rigs/pitchipoy/limbs/ui.py
index 37921dc0..a7ed95a7 100644
--- a/rigify/rigs/pitchipoy/limbs/ui.py
+++ b/rigify/rigs/pitchipoy/limbs/ui.py
@@ -29,15 +29,15 @@ if is_selected( controls ):
for t in tweaks:
if is_selected( t ):
layout.prop( pose_bones[ t ], '["%s"]', slider = True )
-
+
# IK Stretch on IK Control bone
if is_selected( ik_ctrl ):
layout.prop( pose_bones[ parent ], '["%s"]', slider = True )
-
+
# FK limb follow
if is_selected( fk_ctrl ):
layout.prop( pose_bones[ parent ], '["%s"]', slider = True )
-"""
+"""
script_leg = """
controls = [%s]
@@ -95,8 +95,8 @@ def create_script( bones, limb_type=None):
# All tweaks have their own bbone prop
tweaks = bones['tweak']['ctrl'][1:-1]
tweaks_string = ", ".join(["'" + x + "'" for x in tweaks])
-
- # IK ctrl has IK stretch
+
+ # IK ctrl has IK stretch
ik_ctrl = [ bones['ik']['ctrl']['terminal'][-1] ]
ik_ctrl += [ bones['ik']['mch_ik'] ]
ik_ctrl += [ bones['ik']['mch_target'] ]