Remove trailing whitespace
This commit is contained in:
666
__init__.py
666
__init__.py
File diff suppressed because it is too large
Load Diff
@@ -3,12 +3,12 @@ import bpy
|
||||
##################### Layers Schemes Operators ############################
|
||||
|
||||
######## Compact Scheme ########
|
||||
class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
|
||||
bl_idname = "blenrig5.layers_scheme_compact"
|
||||
bl_label = "BlenRig Compact Layers Scheme"
|
||||
bl_description = "Organize layers in a compact scheme relying on bone auto-hiding "
|
||||
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}
|
||||
class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
|
||||
bl_idname = "blenrig5.layers_scheme_compact"
|
||||
bl_label = "BlenRig Compact Layers Scheme"
|
||||
bl_description = "Organize layers in a compact scheme relying on bone auto-hiding "
|
||||
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -17,8 +17,8 @@ class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
else:
|
||||
return (bpy.context.object.type=='ARMATURE' and context.mode=='POSE')
|
||||
for prop in bpy.context.object.data.items():
|
||||
if prop[0] == 'rig_type' and prop[1] == 'Biped':
|
||||
return True
|
||||
if prop[0] == 'rig_type' and prop[1] == 'Biped':
|
||||
return True
|
||||
|
||||
def set_layers(self, context, N, L):
|
||||
|
||||
@@ -26,7 +26,7 @@ class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
|
||||
for b in pbones:
|
||||
layers = L
|
||||
if b.name == N:
|
||||
if b.name == N:
|
||||
b.bone.layers = [(x in layers) for x in range(32)]
|
||||
|
||||
def compact_layers(self, context):
|
||||
@@ -2251,14 +2251,14 @@ class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
self.set_layers(context, 'eyeglasses_mstr', [17, 25])
|
||||
self.set_layers(context, 'accessory_mstr', [26])
|
||||
self.set_layers(context, 'accessory', [17, 25])
|
||||
|
||||
|
||||
def set_data_props(self, context):
|
||||
scene = bpy.context.view_layer
|
||||
bpy.context.active_object.data['bone_auto_hide'] = 1.0
|
||||
bpy.context.active_object.data['custom_layers'] = 0.0
|
||||
bpy.context.active_object.data['layers_count'] = 10
|
||||
bpy.context.active_object.data['layer_list'] = 'BODY, BODY 2, FINGERS - TOES, FACIAL 1, FACIAL 2, FACIAL 3, TOON 1, TOON 2, SCALE, EXTRAS, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, OPTIONALS, PROTECTED, MECH, DEFORMATION, ACTIONS, BONE-ROLLS, SNAPPING, REPROPORTION'
|
||||
scene.update()
|
||||
scene.update()
|
||||
|
||||
def update_scene(self, context):
|
||||
current = bpy.context.scene.frame_current
|
||||
@@ -2266,19 +2266,19 @@ class Operator_BlenRig_Layers_Scheme_Compact(bpy.types.Operator):
|
||||
bpy.context.scene.frame_set(current, subframe=0)
|
||||
|
||||
def execute(self, context):
|
||||
self.compact_layers(context)
|
||||
self.set_data_props(context)
|
||||
self.update_scene(context)
|
||||
|
||||
self.compact_layers(context)
|
||||
self.set_data_props(context)
|
||||
self.update_scene(context)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
######## Expanded Scheme ########
|
||||
class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
|
||||
bl_idname = "blenrig5.layers_scheme_expanded"
|
||||
bl_label = "BlenRig Expanded Layers Scheme"
|
||||
bl_description = "Organize layers by body parts and FK / IK "
|
||||
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}
|
||||
######## Expanded Scheme ########
|
||||
class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
|
||||
bl_idname = "blenrig5.layers_scheme_expanded"
|
||||
bl_label = "BlenRig Expanded Layers Scheme"
|
||||
bl_description = "Organize layers by body parts and FK / IK "
|
||||
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -2287,8 +2287,8 @@ class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
else:
|
||||
return (bpy.context.object.type=='ARMATURE' and context.mode=='POSE')
|
||||
for prop in bpy.context.object.data.items():
|
||||
if prop[0] == 'rig_type' and prop[1] == 'Biped':
|
||||
return True
|
||||
if prop[0] == 'rig_type' and prop[1] == 'Biped':
|
||||
return True
|
||||
|
||||
def set_layers(self, context, N, L):
|
||||
|
||||
@@ -2296,7 +2296,7 @@ class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
|
||||
for b in pbones:
|
||||
layers = L
|
||||
if b.name == N:
|
||||
if b.name == N:
|
||||
b.bone.layers = [(x in layers) for x in range(32)]
|
||||
|
||||
def expanded_layers(self, context):
|
||||
@@ -4521,14 +4521,18 @@ class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
self.set_layers(context, 'eyeglasses_mstr', [11, 25])
|
||||
self.set_layers(context, 'accessory_mstr', [26])
|
||||
self.set_layers(context, 'accessory', [11, 25])
|
||||
|
||||
|
||||
def set_data_props(self, context):
|
||||
<<<<<<< HEAD
|
||||
scene = bpy.context.view_layer
|
||||
=======
|
||||
scene = bpy.context.scene
|
||||
>>>>>>> Remove trailing whitespace
|
||||
bpy.context.active_object.data['bone_auto_hide'] = 0.0
|
||||
bpy.context.active_object.data['custom_layers'] = 1.0
|
||||
bpy.context.active_object.data['layers_count'] = 24
|
||||
bpy.context.active_object.data['layer_list'] = 'FACIAL 1, FACIAL 2, FACIAL 3, ARM_R FK, NECK FK, ARM_L FK, ARM_R IK, NECK IK, ARM_L IK, FINGERS, TORSO FK, FINGERS IK, LEG_R FK, TORSO IK, LEG_L FK, LEG_R IK, TORSO INV, LEG_L IK, TOES, EXTRAS, TOES FK, TOON 1, TOON 2, SCALE, OPTIONALS, PROTECTED, MECH, DEFORMATION, ACTIONS, BONE-ROLLS, SNAPPING, REPROPORTION'
|
||||
scene.update()
|
||||
scene.update()
|
||||
|
||||
def update_scene(self, context):
|
||||
current = bpy.context.scene.frame_current
|
||||
@@ -4541,9 +4545,9 @@ class Operator_BlenRig_Layers_Scheme_Expanded(bpy.types.Operator):
|
||||
b.bone.hide = False
|
||||
|
||||
def execute(self, context):
|
||||
self.expanded_layers(context)
|
||||
self.set_data_props(context)
|
||||
self.update_scene(context)
|
||||
self.expanded_layers(context)
|
||||
self.set_data_props(context)
|
||||
self.update_scene(context)
|
||||
self.unhide_bones(context)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
return {'FINISHED'}
|
||||
@@ -14,115 +14,115 @@ def biped_update_1001(self, context):
|
||||
for C in b.constraints:
|
||||
if C.name == 'Transformation_torso_ik_ctrl':
|
||||
b.constraints.remove(C)
|
||||
|
||||
|
||||
if b.name == 'spine_2_ik':
|
||||
for C in b.constraints:
|
||||
b.constraints.remove(C)
|
||||
b.constraints.remove(C)
|
||||
cnst = pbones['spine_2_ik'].constraints.new('COPY_ROTATION')
|
||||
cnst.name = 'Copy Rotation'
|
||||
cnst.influence = 1.0
|
||||
cnst.name = 'Copy Rotation'
|
||||
cnst.influence = 1.0
|
||||
cnst.mute = False
|
||||
cnst.invert_x = False
|
||||
cnst.invert_y = False
|
||||
cnst.invert_z = False
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_2_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.use_offset = False
|
||||
cnst.use_x = True
|
||||
cnst.use_y = True
|
||||
cnst.invert_x = False
|
||||
cnst.invert_y = False
|
||||
cnst.invert_z = False
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_2_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.use_offset = False
|
||||
cnst.use_x = True
|
||||
cnst.use_y = True
|
||||
cnst.use_z = True
|
||||
cnst = pbones['spine_2_ik'].constraints.new('TRANSFORM')
|
||||
cnst.name = 'Transformation_torso_ik_ctrl'
|
||||
cnst.influence = 1.0
|
||||
cnst.name = 'Transformation_torso_ik_ctrl'
|
||||
cnst.influence = 1.0
|
||||
cnst.mute = False
|
||||
cnst.from_max_x = 0.0
|
||||
cnst.from_max_x_rot = 0.0
|
||||
cnst.from_max_x_scale = 0.0
|
||||
cnst.from_max_y = 0.0
|
||||
cnst.from_max_y_rot = 0.01745329238474369
|
||||
cnst.from_max_y_scale = 0.0
|
||||
cnst.from_max_z = 0.0
|
||||
cnst.from_max_z_rot = 0.0
|
||||
cnst.from_max_z_scale = 0.0
|
||||
cnst.from_min_x = 0.0
|
||||
cnst.from_min_x_rot = 0.0
|
||||
cnst.from_min_x_scale = 0.0
|
||||
cnst.from_min_y = 0.0
|
||||
cnst.from_min_y_rot = 0.0
|
||||
cnst.from_min_y_scale = 0.0
|
||||
cnst.from_min_z = 0.0
|
||||
cnst.from_min_z_rot = 0.0
|
||||
cnst.from_min_z_scale = 0.0
|
||||
cnst.map_to = 'ROTATION'
|
||||
cnst.map_to_x_from = 'X'
|
||||
cnst.name = 'Transformation_torso_ik_ctrl'
|
||||
cnst.map_to_y_from = 'Y'
|
||||
cnst.map_to_z_from = 'Z'
|
||||
cnst.map_from = 'ROTATION'
|
||||
cnst.owner_space = 'LOCAL'
|
||||
cnst.subtarget = 'torso_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'LOCAL'
|
||||
cnst.to_max_x = 0.0
|
||||
cnst.to_max_x_rot = 0.0
|
||||
cnst.to_max_x_scale = 0.0
|
||||
cnst.to_max_y = 0.0
|
||||
cnst.to_max_y_rot = 0.008726646192371845
|
||||
cnst.to_max_y_scale = 0.0
|
||||
cnst.to_max_z = 0.0
|
||||
cnst.to_max_z_rot = 0.0
|
||||
cnst.to_max_z_scale = 0.0
|
||||
cnst.to_min_x = 0.0
|
||||
cnst.to_min_x_rot = 0.0
|
||||
cnst.to_min_x_scale = 0.0
|
||||
cnst.to_min_y = 0.0
|
||||
cnst.to_min_y_rot = 0.0
|
||||
cnst.to_min_y_scale = 0.0
|
||||
cnst.to_min_z = 0.0
|
||||
cnst.to_min_z_rot = 0.0
|
||||
cnst.to_min_z_scale = 0.0
|
||||
cnst.from_max_x = 0.0
|
||||
cnst.from_max_x_rot = 0.0
|
||||
cnst.from_max_x_scale = 0.0
|
||||
cnst.from_max_y = 0.0
|
||||
cnst.from_max_y_rot = 0.01745329238474369
|
||||
cnst.from_max_y_scale = 0.0
|
||||
cnst.from_max_z = 0.0
|
||||
cnst.from_max_z_rot = 0.0
|
||||
cnst.from_max_z_scale = 0.0
|
||||
cnst.from_min_x = 0.0
|
||||
cnst.from_min_x_rot = 0.0
|
||||
cnst.from_min_x_scale = 0.0
|
||||
cnst.from_min_y = 0.0
|
||||
cnst.from_min_y_rot = 0.0
|
||||
cnst.from_min_y_scale = 0.0
|
||||
cnst.from_min_z = 0.0
|
||||
cnst.from_min_z_rot = 0.0
|
||||
cnst.from_min_z_scale = 0.0
|
||||
cnst.map_to = 'ROTATION'
|
||||
cnst.map_to_x_from = 'X'
|
||||
cnst.name = 'Transformation_torso_ik_ctrl'
|
||||
cnst.map_to_y_from = 'Y'
|
||||
cnst.map_to_z_from = 'Z'
|
||||
cnst.map_from = 'ROTATION'
|
||||
cnst.owner_space = 'LOCAL'
|
||||
cnst.subtarget = 'torso_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'LOCAL'
|
||||
cnst.to_max_x = 0.0
|
||||
cnst.to_max_x_rot = 0.0
|
||||
cnst.to_max_x_scale = 0.0
|
||||
cnst.to_max_y = 0.0
|
||||
cnst.to_max_y_rot = 0.008726646192371845
|
||||
cnst.to_max_y_scale = 0.0
|
||||
cnst.to_max_z = 0.0
|
||||
cnst.to_max_z_rot = 0.0
|
||||
cnst.to_max_z_scale = 0.0
|
||||
cnst.to_min_x = 0.0
|
||||
cnst.to_min_x_rot = 0.0
|
||||
cnst.to_min_x_scale = 0.0
|
||||
cnst.to_min_y = 0.0
|
||||
cnst.to_min_y_rot = 0.0
|
||||
cnst.to_min_y_scale = 0.0
|
||||
cnst.to_min_z = 0.0
|
||||
cnst.to_min_z_rot = 0.0
|
||||
cnst.to_min_z_scale = 0.0
|
||||
cnst.use_motion_extrapolate = True
|
||||
cnst = pbones['spine_2_ik'].constraints.new('COPY_SCALE')
|
||||
cnst.name = 'Copy Scale'
|
||||
cnst.influence = 1.0
|
||||
cnst.name = 'Copy Scale'
|
||||
cnst.influence = 1.0
|
||||
cnst.mute = False
|
||||
cnst.owner_space = 'POSE'
|
||||
cnst.subtarget = 'master_torso_pivot'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'POSE'
|
||||
cnst.use_offset = True
|
||||
cnst.use_x = True
|
||||
cnst.use_y = True
|
||||
cnst.owner_space = 'POSE'
|
||||
cnst.subtarget = 'master_torso_pivot'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'POSE'
|
||||
cnst.use_offset = True
|
||||
cnst.use_x = True
|
||||
cnst.use_y = True
|
||||
cnst.use_z = True
|
||||
cnst = pbones['spine_2_ik'].constraints.new('DAMPED_TRACK')
|
||||
cnst.name = 'Damped Track'
|
||||
cnst.influence = 1.0
|
||||
cnst.name = 'Damped Track'
|
||||
cnst.influence = 1.0
|
||||
cnst.mute = False
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_3_inv_ik'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.head_tail = 1.0
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_3_inv_ik'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.head_tail = 1.0
|
||||
cnst.track_axis = 'TRACK_Y'
|
||||
cnst = pbones['spine_2_ik'].constraints.new('STRETCH_TO')
|
||||
cnst.name = 'Stretch To_REPROP'
|
||||
cnst.influence = 1.0
|
||||
cnst.name = 'Stretch To_REPROP'
|
||||
cnst.influence = 1.0
|
||||
cnst.mute = True
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_3_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.head_tail = 0.0
|
||||
cnst.keep_axis = 'PLANE_X'
|
||||
cnst.rest_length = 0.1161453053355217
|
||||
cnst.volume = 'NO_VOLUME'
|
||||
cnst.bulge = 1.0
|
||||
cnst.bulge_max = 1.0
|
||||
cnst.bulge_min = 1.0
|
||||
cnst.bulge_smooth = 0.0
|
||||
cnst.use_bulge_max = False
|
||||
cnst.owner_space = 'WORLD'
|
||||
cnst.subtarget = 'spine_3_ik_ctrl'
|
||||
cnst.target = bpy.context.active_object
|
||||
cnst.target_space = 'WORLD'
|
||||
cnst.head_tail = 0.0
|
||||
cnst.keep_axis = 'PLANE_X'
|
||||
cnst.rest_length = 0.1161453053355217
|
||||
cnst.volume = 'NO_VOLUME'
|
||||
cnst.bulge = 1.0
|
||||
cnst.bulge_max = 1.0
|
||||
cnst.bulge_min = 1.0
|
||||
cnst.bulge_smooth = 0.0
|
||||
cnst.use_bulge_max = False
|
||||
cnst.use_bulge_min = False
|
||||
arm_data['rig_version'] = 1.001
|
||||
self.report({'INFO'}, 'BlenRig Armature updated to 1.001')
|
||||
arm_data['rig_version'] = 1.001
|
||||
self.report({'INFO'}, 'BlenRig Armature updated to 1.001')
|
||||
File diff suppressed because one or more lines are too long
@@ -15,29 +15,26 @@ V 1.002
|
||||
- General changes:
|
||||
|
||||
- New Layer Scheme option in Layer Settings tab (Compact and Expanded Scheme)
|
||||
|
||||
- Updated version of generate_customprops script to work with the new armature layer schemes
|
||||
|
||||
- Updated version of generate_customprops script to work with the new armature layer schemes
|
||||
|
||||
- Biped Armature updated to 1.005:
|
||||
|
||||
|
||||
- Fixed shoulder offset when using FK and Hinge in arms
|
||||
|
||||
|
||||
- Removed Rotation locks in forearm and shin FK controllers
|
||||
|
||||
|
||||
- New lattice_eye_L and R controller in TOON 2 layer
|
||||
|
||||
|
||||
- Look_l and R scaling now makes the eye scale with the Lattice of the eye, giving a smoother result
|
||||
|
||||
|
||||
_ Various bone layers and bone shapes fixes
|
||||
|
||||
|
||||
- Bug Fixes:
|
||||
|
||||
|
||||
- Fix for timeline scrubbing slowdown bug
|
||||
|
||||
|
||||
- Fix for error when adding BlenRig to the scene while using local view or local layers
|
||||
|
||||
V 1.003
|
||||
=======
|
||||
|
||||
- Scropt spaces cleanup
|
||||
|
||||
@@ -47,3 +44,6 @@ V 1.004
|
||||
- Port to Blender 2.80
|
||||
|
||||
|
||||
=======
|
||||
|
||||
|
||||
|
||||
698
ops_alignment.py
698
ops_alignment.py
File diff suppressed because it is too large
Load Diff
110
ops_baking.py
110
ops_baking.py
@@ -8,19 +8,19 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
bl_label = "BlenRig 5 Mesh Baker"
|
||||
bl_idname = "blenrig5.mesh_pose_baker"
|
||||
bl_description = "Bake current pose to mesh"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not bpy.context.object:
|
||||
return False
|
||||
return (bpy.context.object.type == "MESH" and context.mode=='OBJECT')
|
||||
|
||||
#Baking
|
||||
|
||||
#Baking
|
||||
def bake(self, context):
|
||||
props = context.window_manager.blenrig_5_props
|
||||
props = context.window_manager.blenrig_5_props
|
||||
if not bpy.context.object:
|
||||
return False
|
||||
return False
|
||||
old_ob = bpy.context.active_object
|
||||
bake_meshes = [ob.name for ob in bpy.context.selected_objects if ob.type=="MESH"]
|
||||
|
||||
@@ -35,8 +35,8 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
if mod.type == 'SUBSURF':
|
||||
old_state = mod.show_viewport
|
||||
mod.show_viewport = False
|
||||
|
||||
|
||||
|
||||
|
||||
# --- get a mesh from the object ---
|
||||
depsgraph = bpy.context.evaluated_depsgraph_get()
|
||||
mesh_owner = ob.evaluated_get(depsgraph)
|
||||
@@ -46,16 +46,16 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
if mod.type == 'SUBSURF':
|
||||
mod.show_viewport = old_state
|
||||
|
||||
# If Bake to shape option is off
|
||||
if props.bake_to_shape == False:
|
||||
# Check if there are shapekeys in object
|
||||
try:
|
||||
# If Bake to shape option is off
|
||||
if props.bake_to_shape == False:
|
||||
# Check if there are shapekeys in object
|
||||
try:
|
||||
if ob.data.shape_keys.key_blocks:
|
||||
key = ob.data.shape_keys
|
||||
shapekeys = key.key_blocks
|
||||
shapekeys = key.key_blocks
|
||||
# Transfer vertex locations to Basis key
|
||||
for vert in ob.data.vertices:
|
||||
shapekeys['Basis'].data[vert.index].co = mesh.vertices[vert.index].co
|
||||
shapekeys['Basis'].data[vert.index].co = mesh.vertices[vert.index].co
|
||||
|
||||
# Make baked shape active
|
||||
for i in range(len(shapekeys)):
|
||||
@@ -63,20 +63,20 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
if shape.name == 'Basis':
|
||||
ob.active_shape_key_index = i
|
||||
except (AttributeError):
|
||||
# Transfer vertex locations to Mesh
|
||||
# Transfer vertex locations to Mesh
|
||||
for vert in ob.data.vertices:
|
||||
vert.co = mesh.vertices[vert.index].co
|
||||
vert.co = mesh.vertices[vert.index].co
|
||||
|
||||
# If Bake to shape option is on
|
||||
else:
|
||||
|
||||
# If Bake to shape option is on
|
||||
else:
|
||||
|
||||
# Check if there are shapekeys in object
|
||||
try:
|
||||
ob.data.shape_keys.key_blocks
|
||||
except (AttributeError):
|
||||
Basis = ob.shape_key_add(from_mix=False)
|
||||
Basis.name = 'Basis'
|
||||
|
||||
|
||||
# Create new shape for storing the bake
|
||||
|
||||
baked_shape = ob.shape_key_add(from_mix=False)
|
||||
@@ -85,7 +85,7 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
|
||||
# Transfer vertex locations
|
||||
for vert in ob.data.vertices:
|
||||
baked_shape.data[vert.index].co = mesh.vertices[vert.index].co
|
||||
baked_shape.data[vert.index].co = mesh.vertices[vert.index].co
|
||||
|
||||
# Make baked shape active
|
||||
for i in range(len(ob.data.shape_keys.key_blocks)):
|
||||
@@ -102,10 +102,10 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
#Unbind Mdef modifier if object is bound
|
||||
def mdef_unbind(self, context):
|
||||
if not bpy.context.object:
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
old_ob = bpy.context.active_object
|
||||
|
||||
|
||||
bake_meshes = [ob.name for ob in bpy.context.selected_objects if ob.type=="MESH"]
|
||||
for name in bake_meshes:
|
||||
if name in bpy.data.objects:
|
||||
@@ -122,26 +122,26 @@ class ARMATURE_OT_mesh_pose_baker(bpy.types.Operator):
|
||||
bpy.context.view_layer.objects.active = old_ob
|
||||
|
||||
def execute(self, context):
|
||||
self.bake(context)
|
||||
self.mdef_unbind(context)
|
||||
self.bake(context)
|
||||
self.mdef_unbind(context)
|
||||
self.report({'INFO'}, "Baking done")
|
||||
return{'FINISHED'}
|
||||
return{'FINISHED'}
|
||||
|
||||
# Hook Reset operator
|
||||
class ARMATURE_OT_reset_hooks(bpy.types.Operator):
|
||||
bl_label = "BlenRig 5 Reset Hooks"
|
||||
bl_idname = "blenrig5.reset_hooks"
|
||||
bl_description = "Reset Hooks on Lattices and Curves"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not bpy.context.object:
|
||||
return False
|
||||
return (bpy.context.object.type == "LATTICE", "CURVE" and context.mode=='OBJECT')
|
||||
|
||||
|
||||
def reset_hooks(self,context):
|
||||
|
||||
|
||||
selected_lattices = [ob.name for ob in bpy.context.selected_objects if ob.type=="LATTICE"]
|
||||
|
||||
for name in selected_lattices:
|
||||
@@ -155,7 +155,7 @@ class ARMATURE_OT_reset_hooks(bpy.types.Operator):
|
||||
for mod in ob.modifiers:
|
||||
if mod.type == 'HOOK':
|
||||
bpy.ops.object.hook_reset(modifier=mod.name)
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
selected_curves = [ob.name for ob in bpy.context.selected_objects if ob.type=="CURVE"]
|
||||
|
||||
@@ -170,20 +170,20 @@ class ARMATURE_OT_reset_hooks(bpy.types.Operator):
|
||||
for mod in ob.modifiers:
|
||||
if mod.type == 'HOOK':
|
||||
bpy.ops.object.hook_reset(modifier=mod.name)
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
def execute(self, context):
|
||||
self.reset_hooks(context)
|
||||
self.reset_hooks(context)
|
||||
self.report({'INFO'}, "Hooks Reseted")
|
||||
return{'FINISHED'}
|
||||
return{'FINISHED'}
|
||||
|
||||
# Reset Armature related Lattices and Curves operator
|
||||
class ARMATURE_OT_reset_deformers(bpy.types.Operator):
|
||||
bl_label = "BlenRig 5 Reset Deformers"
|
||||
bl_idname = "blenrig5.reset_deformers"
|
||||
bl_description = "Reset Armature related Lattices and Curves"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not bpy.context.object:
|
||||
@@ -191,9 +191,9 @@ class ARMATURE_OT_reset_deformers(bpy.types.Operator):
|
||||
else:
|
||||
return (bpy.context.object.type=='ARMATURE' and \
|
||||
context.mode=='POSE')
|
||||
|
||||
|
||||
def reset_deformers(self, context):
|
||||
|
||||
|
||||
# preparing scene
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
old_active = bpy.context.active_object
|
||||
@@ -205,7 +205,7 @@ class ARMATURE_OT_reset_deformers(bpy.types.Operator):
|
||||
# Armature related lattices and curves
|
||||
deformers_collection = []
|
||||
selected_deformers = []
|
||||
|
||||
|
||||
for ob in bpy.data.objects:
|
||||
if ob.type in 'LATTICE' or 'CURVE':
|
||||
for mod in ob.modifiers:
|
||||
@@ -221,7 +221,7 @@ class ARMATURE_OT_reset_deformers(bpy.types.Operator):
|
||||
coll.hide_viewport = False
|
||||
ob.select_set(True)
|
||||
selected_deformers.append(ob.name)
|
||||
|
||||
|
||||
for name in selected_deformers:
|
||||
if name in bpy.data.objects:
|
||||
ob = bpy.data.objects[name]
|
||||
@@ -244,13 +244,13 @@ class ARMATURE_OT_reset_deformers(bpy.types.Operator):
|
||||
ob.select_set(True)
|
||||
bpy.ops.object.mode_set(mode='POSE')
|
||||
#Hack for updating objects
|
||||
bpy.context.scene.frame_set(bpy.context.scene.frame_current)
|
||||
bpy.context.scene.frame_set(bpy.context.scene.frame_current)
|
||||
|
||||
def execute(self, context):
|
||||
self.reset_deformers(context)
|
||||
self.report({'INFO'}, "Lattices and Curves Reset")
|
||||
return{'FINISHED'}
|
||||
|
||||
|
||||
|
||||
|
||||
# Armature Baker operator
|
||||
@@ -258,8 +258,8 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
bl_label = "BlenRig 5 Armature Baker"
|
||||
bl_idname = "blenrig5.armature_baker"
|
||||
bl_description = "Bake current pose to armature"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not bpy.context.object:
|
||||
@@ -267,9 +267,9 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
else:
|
||||
return (bpy.context.object.type=='ARMATURE' and \
|
||||
context.mode=='POSE')
|
||||
|
||||
|
||||
def bake_armature(self, context):
|
||||
|
||||
|
||||
# preparing scene
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
old_active = bpy.context.active_object
|
||||
@@ -278,7 +278,7 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
for ob in old_selected:
|
||||
ob.select_set(False)
|
||||
|
||||
|
||||
|
||||
# unparenting external objects related to the armature
|
||||
deformers_collection = []
|
||||
parent_pairs = []
|
||||
@@ -296,7 +296,7 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
ob.select_set(True)
|
||||
parent_pairs.append([ob, ob.parent, ob.parent_bone])
|
||||
bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')
|
||||
|
||||
|
||||
#Back to Armature
|
||||
for ob in bpy.context.selected_objects:
|
||||
ob.select_set(False)
|
||||
@@ -306,12 +306,12 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
|
||||
bpy.ops.object.mode_set(mode='POSE')
|
||||
posebones = bpy.context.object.pose.bones
|
||||
|
||||
|
||||
# Bake Armature
|
||||
bpy.ops.pose.armature_apply()
|
||||
|
||||
|
||||
arm = bpy.context.object.data
|
||||
|
||||
|
||||
# Reset Constraints
|
||||
for b in posebones:
|
||||
for con in b.constraints:
|
||||
@@ -341,7 +341,7 @@ class ARMATURE_OT_armature_baker(bpy.types.Operator):
|
||||
ob, parent, bone = pp
|
||||
ob.parent = parent
|
||||
ob.parent_type = 'BONE'
|
||||
ob.parent_bone == bone
|
||||
ob.parent_bone == bone
|
||||
#Reseting Hooks
|
||||
ob.select_set(True)
|
||||
bpy.ops.blenrig5.reset_hooks()
|
||||
@@ -373,7 +373,7 @@ class ARMATURE_OT_reset_constraints(bpy.types.Operator):
|
||||
bl_label = "BlenRig 5 Reset Constraints"
|
||||
bl_idname = "blenrig5.reset_constraints"
|
||||
bl_description = "Reset all posebone constraints"
|
||||
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not bpy.context.object:
|
||||
@@ -381,14 +381,14 @@ class ARMATURE_OT_reset_constraints(bpy.types.Operator):
|
||||
else:
|
||||
return (bpy.context.object.type=='ARMATURE' and \
|
||||
context.mode=='POSE')
|
||||
|
||||
|
||||
def invoke(self, context, event):
|
||||
pbones = context.active_object.pose.bones
|
||||
edit_bones = context.active_object.data.edit_bones
|
||||
if len(pbones) < 1:
|
||||
self.report({'INFO'}, "No bones found")
|
||||
return{'FINISHED'}
|
||||
|
||||
|
||||
amount = 0
|
||||
arm = bpy.context.object.data
|
||||
|
||||
|
||||
4657
ops_picker_body.py
4657
ops_picker_body.py
File diff suppressed because it is too large
Load Diff
3518
ops_picker_face.py
3518
ops_picker_face.py
File diff suppressed because it is too large
Load Diff
@@ -4,10 +4,10 @@ import bpy
|
||||
|
||||
# Biped
|
||||
|
||||
class Operator_Biped_Updater(bpy.types.Operator):
|
||||
bl_idname = "blenrig5.biped_updater"
|
||||
bl_label = "BlenRig 5 Biped Rig Updater"
|
||||
bl_description = "Update BlenRig 5 biped rig to the latest version"
|
||||
class Operator_Biped_Updater(bpy.types.Operator):
|
||||
bl_idname = "blenrig5.biped_updater"
|
||||
bl_label = "BlenRig 5 Biped Rig Updater"
|
||||
bl_description = "Update BlenRig 5 biped rig to the latest version"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
@@ -19,7 +19,7 @@ class Operator_Biped_Updater(bpy.types.Operator):
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
for propb in bpy.context.active_object.data.items():
|
||||
if propb[0] == 'rig_type' and propb[1] == 'Biped':
|
||||
return True
|
||||
return True
|
||||
|
||||
def execute(self, context):
|
||||
arm = bpy.context.active_object
|
||||
@@ -29,7 +29,7 @@ class Operator_Biped_Updater(bpy.types.Operator):
|
||||
from .blenrig_biped.updates.update_1001 import (biped_update_1001)
|
||||
# Apply
|
||||
biped_update_1001(self, context)
|
||||
|
||||
|
||||
#### Update 0.005 ####
|
||||
if arm.data['rig_version'] < 1.005:
|
||||
# Load Update Functions
|
||||
@@ -45,7 +45,7 @@ class Operator_Biped_Updater(bpy.types.Operator):
|
||||
biped_update_1005_functions_script,
|
||||
biped_update_1005_layer_scheme,
|
||||
biped_update_1005_update_version
|
||||
)
|
||||
)
|
||||
# Apply
|
||||
biped_update_1005_drivers(self, context)
|
||||
biped_update_1005_locks(self, context)
|
||||
@@ -58,7 +58,7 @@ class Operator_Biped_Updater(bpy.types.Operator):
|
||||
biped_update_1005_functions_script(self, context)
|
||||
biped_update_1005_layer_scheme(self, context)
|
||||
biped_update_1005_update_version(self, context)
|
||||
|
||||
|
||||
else:
|
||||
self.report({'INFO'}, 'Armature already up to date')
|
||||
return {"FINISHED"}
|
||||
self.report({'INFO'}, 'Armature already up to date')
|
||||
return {"FINISHED"}
|
||||
1440
ops_snapping.py
1440
ops_snapping.py
File diff suppressed because it is too large
Load Diff
26
readme.rst
26
readme.rst
@@ -41,14 +41,14 @@ For a detailed step by step tutorial, check the `BlenRig Tutorials <https://clou
|
||||
|
||||
|
||||
|
||||
System Requirements for animation:
|
||||
System Requirements for animation:
|
||||
----------------------------------
|
||||
|
||||
**Minimum Processor spec:** Intel i3 or AMD equivalent.
|
||||
**Minimum Processor spec:** Intel i3 or AMD equivalent.
|
||||
|
||||
In this type of computer a high resolution character will roughly reach 24 fps.
|
||||
|
||||
**Recommended Processor spec:** Intel i7 or AMD equivalent.
|
||||
**Recommended Processor spec:** Intel i7 or AMD equivalent.
|
||||
|
||||
In this type of computer most rigged high resolution characters will run at 35+ fps. Low resolution proxy versions may run at 50+ fps.
|
||||
|
||||
@@ -73,27 +73,27 @@ V 1.002
|
||||
- General changes:
|
||||
|
||||
- New Layer Scheme option in Layer Settings tab (Compact and Expanded Scheme)
|
||||
|
||||
|
||||
- Updated version of generate_customprops script to work with the new armature layer schemes
|
||||
|
||||
|
||||
- New Armature UPDATE button (to update the user's rig with the latest improvements)
|
||||
|
||||
- Biped Armature updated to 1.005:
|
||||
|
||||
|
||||
- Fixed shoulder offset when using FK and Hinge in arms
|
||||
|
||||
|
||||
- Removed Rotation locks in forearm and shin FK controllers
|
||||
|
||||
|
||||
- New lattice_eye_L and R controller in TOON 2 layer
|
||||
|
||||
|
||||
- Look_l and R scaling now makes the eye scale with the Lattice of the eye, giving a smoother result
|
||||
|
||||
|
||||
- Various bone layers and bone shapes fixes
|
||||
|
||||
|
||||
- Bug Fixes:
|
||||
|
||||
|
||||
- Fix for timeline scrubbing slowdown bug
|
||||
|
||||
|
||||
- Fix for error when adding BlenRig to the scene while using local view or local layers
|
||||
|
||||
V 1.003
|
||||
|
||||
514
rig_functions.py
514
rig_functions.py
@@ -7,544 +7,544 @@ import bpy
|
||||
from bpy.props import FloatProperty, IntProperty, BoolProperty
|
||||
|
||||
|
||||
def bone_auto_hide(context):
|
||||
def bone_auto_hide(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
for b_prop in bpy.context.active_object.data.items():
|
||||
if b_prop[0] == 'bone_auto_hide' and b_prop[1] == 0:
|
||||
return False
|
||||
return False
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
|
||||
arm = bpy.context.active_object.data
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
|
||||
arm = bpy.context.active_object.data
|
||||
p_bones = bpy.context.active_object.pose.bones
|
||||
|
||||
|
||||
for b in p_bones:
|
||||
if ('properties' in b.name):
|
||||
if ('torso' in b.name):
|
||||
|
||||
# Torso FK/IK
|
||||
# Torso FK/IK
|
||||
prop = int(b.ik_torso)
|
||||
prop_inv = int(b.inv_torso)
|
||||
|
||||
for bone in arm.bones:
|
||||
prop_inv = int(b.inv_torso)
|
||||
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_ik']):
|
||||
if prop == 1 or prop_inv == 1:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk']):
|
||||
if prop != 1 or prop_inv == 1:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
|
||||
# Torso INV
|
||||
for bone in arm.bones:
|
||||
bone.hide = 0
|
||||
|
||||
# Torso INV
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_inv']):
|
||||
if prop_inv == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
if ('head' in b.name):
|
||||
# Neck FK/IK
|
||||
# Neck FK/IK
|
||||
prop = int(b.ik_head)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik']):
|
||||
if prop == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
|
||||
# Head Hinge
|
||||
# Head Hinge
|
||||
prop_hinge = int(b.hinge_head)
|
||||
for bone in arm.bones:
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_hinge']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_hinge']):
|
||||
if prop == 0 or prop_hinge == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
#Left Properties
|
||||
if ('_L' in b.name):
|
||||
bone.hide = 1
|
||||
#Left Properties
|
||||
if ('_L' in b.name):
|
||||
if ('arm' in b.name):
|
||||
|
||||
# Arm_L FK/IK
|
||||
|
||||
# Arm_L FK/IK
|
||||
prop = int(b.ik_arm_L)
|
||||
prop_hinge = int(b.hinge_hand_L)
|
||||
for bone in arm.bones:
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_L']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_L']):
|
||||
if prop == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
|
||||
# HAND_L
|
||||
if arm['rig_type'] == "Biped":
|
||||
if (bone.name in b['bones_ik_hand_L']):
|
||||
if arm['rig_type'] == "Biped":
|
||||
if (bone.name in b['bones_ik_hand_L']):
|
||||
if prop == 1 and prop_hinge == 0:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_hand_L']):
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_hand_L']):
|
||||
if prop_hinge == 1:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_ik_palm_L']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_ik_palm_L']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_palm_L']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_palm_L']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
|
||||
# Fingers_L
|
||||
prop_ik_all = int(b.ik_fing_all_L)
|
||||
prop_hinge_all = int(b.hinge_fing_all_L)
|
||||
|
||||
def fingers_hide(b_name):
|
||||
bone.hide = 1
|
||||
|
||||
# Fingers_L
|
||||
prop_ik_all = int(b.ik_fing_all_L)
|
||||
prop_hinge_all = int(b.hinge_fing_all_L)
|
||||
|
||||
def fingers_hide(b_name):
|
||||
for bone in arm.bones:
|
||||
ik_bones = [b_name]
|
||||
ik_bones = [b_name]
|
||||
if (bone.name == b_name):
|
||||
if prop == 1 or prop_hinge == 1 or prop_ik_all == 1 or prop_hinge_all == 1:
|
||||
bone.hide = 0
|
||||
if prop == 0 and prop_hinge == 0 and prop_ik_all == 0 and prop_hinge_all == 0:
|
||||
bone.hide = 1
|
||||
return {"FINISHED"}
|
||||
bone.hide = 1
|
||||
return {"FINISHED"}
|
||||
|
||||
prop_hinge = int(b.hinge_fing_ind_L)
|
||||
prop = int(b.ik_fing_ind_L)
|
||||
fingers_hide('fing_ind_ik_L')
|
||||
prop = int(b.ik_fing_ind_L)
|
||||
fingers_hide('fing_ind_ik_L')
|
||||
prop_hinge = int(b.hinge_fing_mid_L)
|
||||
prop = int(b.ik_fing_mid_L)
|
||||
fingers_hide('fing_mid_ik_L')
|
||||
prop = int(b.ik_fing_mid_L)
|
||||
fingers_hide('fing_mid_ik_L')
|
||||
prop_hinge = int(b.hinge_fing_ring_L)
|
||||
prop = int(b.ik_fing_ring_L)
|
||||
fingers_hide('fing_ring_ik_L')
|
||||
prop = int(b.ik_fing_ring_L)
|
||||
fingers_hide('fing_ring_ik_L')
|
||||
prop_hinge = int(b.hinge_fing_lit_L)
|
||||
prop = int(b.ik_fing_lit_L)
|
||||
fingers_hide('fing_lit_ik_L')
|
||||
prop = int(b.ik_fing_lit_L)
|
||||
fingers_hide('fing_lit_ik_L')
|
||||
prop_hinge = int(b.hinge_fing_thumb_L)
|
||||
prop = int(b.ik_fing_thumb_L)
|
||||
fingers_hide('fing_thumb_ik_L')
|
||||
|
||||
if ('leg' in b.name):
|
||||
# Leg_L FK/IK
|
||||
prop = int(b.ik_fing_thumb_L)
|
||||
fingers_hide('fing_thumb_ik_L')
|
||||
|
||||
if ('leg' in b.name):
|
||||
# Leg_L FK/IK
|
||||
prop = int(b.ik_leg_L)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_L']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_L']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_L']):
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_L']):
|
||||
if prop == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
|
||||
# Toes_L FK/IK
|
||||
bone.hide = 1
|
||||
|
||||
# Toes_L FK/IK
|
||||
prop = int(b.ik_toes_all_L)
|
||||
prop_hinge = int(b.hinge_toes_all_L)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_foot_L']):
|
||||
prop_hinge = int(b.hinge_toes_all_L)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_foot_L']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_foot_L']):
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_foot_L']):
|
||||
if prop == 0 or prop_hinge == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
|
||||
#Right Properties
|
||||
if ('_R' in b.name):
|
||||
#Right Properties
|
||||
if ('_R' in b.name):
|
||||
if ('arm' in b.name):
|
||||
|
||||
# Arm_R FK/IK
|
||||
|
||||
# Arm_R FK/IK
|
||||
prop = int(b.ik_arm_R)
|
||||
prop_hinge = int(b.hinge_hand_R)
|
||||
for bone in arm.bones:
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_R']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_R']):
|
||||
if prop == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
bone.hide = 1
|
||||
|
||||
# HAND_R
|
||||
if arm['rig_type'] == "Biped":
|
||||
if (bone.name in b['bones_ik_hand_R']):
|
||||
if arm['rig_type'] == "Biped":
|
||||
if (bone.name in b['bones_ik_hand_R']):
|
||||
if prop == 1 and prop_hinge == 0:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_hand_R']):
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_hand_R']):
|
||||
if prop_hinge == 1:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_ik_palm_R']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_ik_palm_R']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 1
|
||||
else:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_palm_R']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
if (bone.name in b['bones_fk_palm_R']):
|
||||
if prop == 1 or prop_hinge == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
|
||||
# Fingers_R
|
||||
prop_ik_all = int(b.ik_fing_all_R)
|
||||
prop_hinge_all = int(b.hinge_fing_all_R)
|
||||
|
||||
def fingers_hide(b_name):
|
||||
bone.hide = 1
|
||||
|
||||
# Fingers_R
|
||||
prop_ik_all = int(b.ik_fing_all_R)
|
||||
prop_hinge_all = int(b.hinge_fing_all_R)
|
||||
|
||||
def fingers_hide(b_name):
|
||||
for bone in arm.bones:
|
||||
ik_bones = [b_name]
|
||||
ik_bones = [b_name]
|
||||
if (bone.name == b_name):
|
||||
if prop == 1 or prop_hinge == 1 or prop_ik_all == 1 or prop_hinge_all == 1:
|
||||
bone.hide = 0
|
||||
if prop == 0 and prop_hinge == 0 and prop_ik_all == 0 and prop_hinge_all == 0:
|
||||
bone.hide = 1
|
||||
return {"FINISHED"}
|
||||
bone.hide = 1
|
||||
return {"FINISHED"}
|
||||
|
||||
prop_hinge = int(b.hinge_fing_ind_R)
|
||||
prop = int(b.ik_fing_ind_R)
|
||||
fingers_hide('fing_ind_ik_R')
|
||||
prop = int(b.ik_fing_ind_R)
|
||||
fingers_hide('fing_ind_ik_R')
|
||||
prop_hinge = int(b.hinge_fing_mid_R)
|
||||
prop = int(b.ik_fing_mid_R)
|
||||
fingers_hide('fing_mid_ik_R')
|
||||
prop = int(b.ik_fing_mid_R)
|
||||
fingers_hide('fing_mid_ik_R')
|
||||
prop_hinge = int(b.hinge_fing_ring_R)
|
||||
prop = int(b.ik_fing_ring_R)
|
||||
fingers_hide('fing_ring_ik_R')
|
||||
prop = int(b.ik_fing_ring_R)
|
||||
fingers_hide('fing_ring_ik_R')
|
||||
prop_hinge = int(b.hinge_fing_lit_R)
|
||||
prop = int(b.ik_fing_lit_R)
|
||||
fingers_hide('fing_lit_ik_R')
|
||||
prop = int(b.ik_fing_lit_R)
|
||||
fingers_hide('fing_lit_ik_R')
|
||||
prop_hinge = int(b.hinge_fing_thumb_R)
|
||||
prop = int(b.ik_fing_thumb_R)
|
||||
fingers_hide('fing_thumb_ik_R')
|
||||
|
||||
if ('leg' in b.name):
|
||||
# Leg_R FK/IK
|
||||
prop = int(b.ik_fing_thumb_R)
|
||||
fingers_hide('fing_thumb_ik_R')
|
||||
|
||||
if ('leg' in b.name):
|
||||
# Leg_R FK/IK
|
||||
prop = int(b.ik_leg_R)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_R']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_R']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_R']):
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_R']):
|
||||
if prop == 0:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
|
||||
# Toes_R FK/IK
|
||||
bone.hide = 1
|
||||
|
||||
# Toes_R FK/IK
|
||||
prop = int(b.ik_toes_all_R)
|
||||
prop_hinge = int(b.hinge_toes_all_R)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_foot_R']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fk_foot_R']):
|
||||
if prop == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_foot_R']):
|
||||
bone.hide = 1
|
||||
if (bone.name in b['bones_ik_foot_R']):
|
||||
if prop == 0 or prop_hinge == 1:
|
||||
bone.hide = 0
|
||||
else:
|
||||
bone.hide = 1
|
||||
|
||||
bone.hide = 1
|
||||
|
||||
####### Reproportion Toggle #######
|
||||
|
||||
def reproportion_toggle(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
prop = bool(bpy.context.active_object.data.reproportion)
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
prop = bool(bpy.context.active_object.data.reproportion)
|
||||
p_bones = bpy.context.active_object.pose.bones
|
||||
if prop == True:
|
||||
bpy.context.active_object.data.layers[31] = True
|
||||
for b in p_bones:
|
||||
bpy.context.active_object.data.layers[31] = True
|
||||
for b in p_bones:
|
||||
for C in b.constraints:
|
||||
if ('REPROP' in C.name):
|
||||
C.mute = False
|
||||
C.mute = False
|
||||
if ('NOREP' in C.name):
|
||||
C.mute = True
|
||||
|
||||
C.mute = True
|
||||
|
||||
else:
|
||||
bpy.context.active_object.data.layers[0] = True
|
||||
bpy.context.active_object.data.layers[31] = False
|
||||
for b in p_bones:
|
||||
bpy.context.active_object.data.layers[31] = False
|
||||
for b in p_bones:
|
||||
for C in b.constraints:
|
||||
if ('REPROP' in C.name):
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
if ('NOREP' in C.name):
|
||||
C.mute = False
|
||||
rig_toggles(context)
|
||||
|
||||
C.mute = False
|
||||
rig_toggles(context)
|
||||
|
||||
####### Rig Toggles #######
|
||||
|
||||
def rig_toggles(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
if (bpy.context.active_object.type in ["ARMATURE"]) and (bpy.context.active_object.mode == 'POSE'):
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
p_bones = bpy.context.active_object.pose.bones
|
||||
arm = bpy.context.active_object.data
|
||||
arm = bpy.context.active_object.data
|
||||
|
||||
for b in p_bones:
|
||||
if ('properties' in b.name):
|
||||
# Left Properties
|
||||
#Fingers_L
|
||||
#Fingers_L
|
||||
if ('L' in b.name):
|
||||
if ('arm'in b.name):
|
||||
prop_fing = int(b.toggle_fingers_L)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fingers_def_1_L']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fingers_def_1_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[27] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_fingers_def_2_L']):
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_fingers_def_2_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[27] = 1
|
||||
bone.layers[31] = 1
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_fingers_str_L']):
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_fingers_str_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[31] = 0
|
||||
bone.layers[31] = 0
|
||||
for b_prop in bpy.context.active_object.data.items():
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_fingers_ctrl_1_L']):
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_fingers_ctrl_1_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[0] = 1
|
||||
else:
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_L']):
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[2] = 1
|
||||
bone.layers[2] = 1
|
||||
else:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_L']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_L']):
|
||||
if prop_fing == 1:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_fingers_ctrl_2_L']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = False
|
||||
C.mute = False
|
||||
else:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_fingers_ctrl_2_L']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
#Toes_L
|
||||
if ('L' in b.name):
|
||||
if ('leg'in b.name):
|
||||
prop_toes = int(b.toggle_toes_L)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_toes_def_1_L']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_toes_def_1_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_toes_def_2_L']):
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_toes_def_2_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 1
|
||||
bone.layers[31] = 1
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_no_toes_def_L']):
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_no_toes_def_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 0
|
||||
else:
|
||||
bone.layers[27] = 1
|
||||
if (bone.name in b['bones_toes_str_L']):
|
||||
bone.layers[27] = 1
|
||||
if (bone.name in b['bones_toes_str_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[31] = 0
|
||||
bone.layers[31] = 0
|
||||
for b_prop in bpy.context.active_object.data.items():
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_toes_ctrl_1_L']):
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_toes_ctrl_1_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[0] = 1
|
||||
else:
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_no_toes_ctrl_L']):
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_no_toes_ctrl_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[0] = 0
|
||||
else:
|
||||
bone.layers[0] = 1
|
||||
if (bone.name in b['bones_toes_ctrl_2_L']):
|
||||
bone.layers[0] = 1
|
||||
if (bone.name in b['bones_toes_ctrl_2_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[2] = 1
|
||||
bone.layers[2] = 1
|
||||
else:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_toes_ctrl_2_L']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_toes_ctrl_2_L']):
|
||||
if prop_toes == 1:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_toes_ctrl_2_L']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = False
|
||||
C.mute = False
|
||||
else:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_toes_ctrl_2_L']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
|
||||
# Right Properties
|
||||
#Fingers_R
|
||||
#Fingers_R
|
||||
if ('R' in b.name):
|
||||
if ('arm'in b.name):
|
||||
prop_fing = int(b.toggle_fingers_R)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fingers_def_1_R']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_fingers_def_1_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[27] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_fingers_def_2_R']):
|
||||
if (bone.name in b['bones_fingers_def_2_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[27] = 1
|
||||
bone.layers[31] = 1
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_fingers_str_R']):
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_fingers_str_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[31] = 0
|
||||
bone.layers[31] = 0
|
||||
for b_prop in bpy.context.active_object.data.items():
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_fingers_ctrl_1_R']):
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_fingers_ctrl_1_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[0] = 1
|
||||
else:
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_R']):
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[2] = 1
|
||||
bone.layers[2] = 1
|
||||
else:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_R']):
|
||||
if prop_fing == 1:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_fingers_ctrl_2_R']):
|
||||
if prop_fing == 1:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_fingers_ctrl_2_R']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = False
|
||||
C.mute = False
|
||||
else:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_fingers_ctrl_2_R']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
#Toes_R
|
||||
if ('R' in b.name):
|
||||
if ('leg'in b.name):
|
||||
prop_toes = int(b.toggle_toes_R)
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_toes_def_1_R']):
|
||||
for bone in arm.bones:
|
||||
if (bone.name in b['bones_toes_def_1_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
if (bone.name in b['bones_toes_def_2_R']):
|
||||
if (bone.name in b['bones_toes_def_2_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 1
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[27] = 0
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_no_toes_def_R']):
|
||||
bone.layers[31] = 0
|
||||
if (bone.name in b['bones_no_toes_def_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[27] = 0
|
||||
else:
|
||||
bone.layers[27] = 1
|
||||
if (bone.name in b['bones_toes_str_R']):
|
||||
bone.layers[27] = 1
|
||||
if (bone.name in b['bones_toes_str_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[31] = 1
|
||||
else:
|
||||
bone.layers[31] = 0
|
||||
bone.layers[31] = 0
|
||||
for b_prop in bpy.context.active_object.data.items():
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_toes_ctrl_1_R']):
|
||||
if b_prop[0] == 'custom_layers' and b_prop[1] == 0:
|
||||
if (bone.name in b['bones_toes_ctrl_1_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[0] = 1
|
||||
else:
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_no_toes_ctrl_R']):
|
||||
bone.layers[0] = 0
|
||||
if (bone.name in b['bones_no_toes_ctrl_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[0] = 0
|
||||
else:
|
||||
bone.layers[0] = 1
|
||||
if (bone.name in b['bones_toes_ctrl_2_R']):
|
||||
bone.layers[0] = 1
|
||||
if (bone.name in b['bones_toes_ctrl_2_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[2] = 1
|
||||
else:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_toes_ctrl_2_R']):
|
||||
if prop_toes == 1:
|
||||
bone.layers[2] = 0
|
||||
if (bone.name in b['bones_toes_ctrl_2_R']):
|
||||
if prop_toes == 1:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_toes_ctrl_2_R']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = False
|
||||
C.mute = False
|
||||
else:
|
||||
for pbone in p_bones:
|
||||
if (pbone.name in b['bones_toes_ctrl_2_R']):
|
||||
for C in pbone.constraints:
|
||||
if C.type == 'IK':
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
|
||||
####### Rig Optimizations #######
|
||||
|
||||
@@ -552,22 +552,22 @@ def rig_toggles(context):
|
||||
|
||||
def toggle_face_drivers(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if not context.armature:
|
||||
return False
|
||||
return False
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
prop = bool(bpy.context.active_object.data.toggle_face_drivers)
|
||||
armobj = bpy.context.active_object
|
||||
drivers = armobj.animation_data.drivers
|
||||
data_path_list = ['pose.bones["mouth_corner_R"]["BACK_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["DOWN_LIMIT_R"]',
|
||||
data_path_list = ['pose.bones["mouth_corner_R"]["BACK_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["DOWN_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["FORW_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["IN_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["IN_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["OUT_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_R"]["UP_LIMIT_R"]',
|
||||
'pose.bones["mouth_corner_L"]["UP_LIMIT_L"]',
|
||||
@@ -654,31 +654,31 @@ def toggle_face_drivers(context):
|
||||
'pose.bones["cheek_ctrl_R"]["ACTION_CHEEK_TOGGLE_R"]',
|
||||
'pose.bones["cheek_ctrl_L"]["ACTION_CHEEK_TOGGLE_L"]',
|
||||
'pose.bones["mouth_corner_L"]["AUTO_BACK_L"]',
|
||||
'pose.bones["mouth_corner_R"]["AUTO_BACK_R"]']
|
||||
'pose.bones["mouth_corner_R"]["AUTO_BACK_R"]']
|
||||
|
||||
for C in drivers:
|
||||
for vars in C.driver.variables:
|
||||
for T in vars.targets:
|
||||
for T in vars.targets:
|
||||
for D in data_path_list:
|
||||
if D in T.data_path:
|
||||
if prop == 1:
|
||||
C.mute = False
|
||||
else:
|
||||
C.mute = True
|
||||
|
||||
C.mute = True
|
||||
|
||||
####### Toggle Flex Drivers #######
|
||||
|
||||
def toggle_flex_drivers(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if not context.armature:
|
||||
return False
|
||||
return False
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
prop = bool(bpy.context.active_object.data.toggle_flex_drivers)
|
||||
armobj = bpy.context.active_object
|
||||
drivers = armobj.animation_data.drivers
|
||||
@@ -716,31 +716,31 @@ def toggle_flex_drivers(context):
|
||||
'pose.bones["properties_leg_L"]["flex_shin_length_L"]',
|
||||
'pose.bones["properties_leg_L"]["flex_shin_width_L"]',
|
||||
'pose.bones["properties_leg_L"]["flex_foot_scale_L"]',
|
||||
'pose.bones["properties_leg_L"]["flex_foot_loc_L"]']
|
||||
'pose.bones["properties_leg_L"]["flex_foot_loc_L"]']
|
||||
|
||||
for C in drivers:
|
||||
for vars in C.driver.variables:
|
||||
for T in vars.targets:
|
||||
for T in vars.targets:
|
||||
for D in data_path_list:
|
||||
if D in T.data_path:
|
||||
if prop == 1:
|
||||
C.mute = False
|
||||
else:
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
|
||||
####### Toggle Body Drivers #######
|
||||
|
||||
def toggle_body_drivers(context):
|
||||
if not bpy.context.screen:
|
||||
return False
|
||||
return False
|
||||
if bpy.context.screen.is_animation_playing == True:
|
||||
return False
|
||||
return False
|
||||
if not bpy.context.active_object:
|
||||
return False
|
||||
if not context.armature:
|
||||
return False
|
||||
return False
|
||||
for prop in bpy.context.active_object.data.items():
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
if prop[0] == 'rig_name' and prop[1] == 'BlenRig_5':
|
||||
prop = bool(bpy.context.active_object.data.toggle_body_drivers)
|
||||
armobj = bpy.context.active_object
|
||||
drivers = armobj.animation_data.drivers
|
||||
@@ -774,14 +774,14 @@ def toggle_body_drivers(context):
|
||||
'pose.bones["spine_3_fk"]["fk_follow_main"]',
|
||||
'pose.bones["spine_2_inv"]["fk_follow_main"]',
|
||||
'pose.bones["spine_1_inv"]["fk_follow_main"]',
|
||||
'pose.bones["pelvis_inv"]["fk_follow_main"]']
|
||||
'pose.bones["pelvis_inv"]["fk_follow_main"]']
|
||||
|
||||
for C in drivers:
|
||||
for vars in C.driver.variables:
|
||||
for T in vars.targets:
|
||||
for T in vars.targets:
|
||||
for D in data_path_list:
|
||||
if D in T.data_path:
|
||||
if prop == 1:
|
||||
C.mute = False
|
||||
else:
|
||||
C.mute = True
|
||||
C.mute = True
|
||||
4248
ui_panel_controls.py
4248
ui_panel_controls.py
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user