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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/modules/rigify/__init__.py')
-rw-r--r--release/scripts/modules/rigify/__init__.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/release/scripts/modules/rigify/__init__.py b/release/scripts/modules/rigify/__init__.py
index ee6cc934c1b..98d9bb235a2 100644
--- a/release/scripts/modules/rigify/__init__.py
+++ b/release/scripts/modules/rigify/__init__.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
-from Mathutils import Vector
+from mathutils import Vector
# TODO, have these in a more general module
from rna_prop_ui import rna_idprop_ui_prop_get
@@ -159,8 +159,8 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
# Not needed but catches any errors before duplicating
validate_rig(context, obj_orig)
- global_undo = context.user_preferences.edit.global_undo
- context.user_preferences.edit.global_undo = False
+ use_global_undo = context.user_preferences.edit.use_global_undo
+ context.user_preferences.edit.use_global_undo = False
mode_orig = context.mode
rest_backup = obj_orig.data.pose_position
obj_orig.data.pose_position = 'REST'
@@ -191,8 +191,8 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
obj.animation_data_clear()
# Select generated rig object
- obj_orig.selected = False
- obj.selected = True
+ obj_orig.select = False
+ obj.select = True
scene.objects.active = obj
# Remove all bones from the generated rig armature.
@@ -212,9 +212,9 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
# Select the temp rigs for merging
for objt in scene.objects:
- objt.selected = False # deselect all objects
- temp_rig_1.selected = True
- temp_rig_2.selected = True
+ objt.select = False # deselect all objects
+ temp_rig_1.select = True
+ temp_rig_2.select = True
scene.objects.active = temp_rig_2
# Merge the temporary rigs
@@ -225,8 +225,8 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
# Select the generated rig
for objt in scene.objects:
- objt.selected = False # deselect all objects
- obj.selected = True
+ objt.select = False # deselect all objects
+ obj.select = True
scene.objects.active = obj
# Copy over the pose_bone properties
@@ -282,7 +282,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
edit_bone.head = (0.0, 0.0, 0.0)
edit_bone.tail = (0.0, 1.0, 0.0)
edit_bone.roll = 0.0
- edit_bone.layer = ROOT_LAYERS
+ edit_bone.layers = ROOT_LAYERS
bpy.ops.object.mode_set(mode='OBJECT')
# key: bone name
@@ -412,7 +412,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
else:
root_ebone_tmp = root_ebone
- ebone.connected = False
+ ebone.use_connect = False
ebone.parent = root_ebone_tmp
'''
@@ -429,7 +429,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
con.target = obj
con.subtarget = bone_name
- if not pbone.bone.connected:
+ if not pbone.bone.use_connect:
con = pbone.constraints.new('COPY_LOCATION')
con.target = obj
con.subtarget = bone_name
@@ -445,33 +445,33 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
layer_second_last[30] = True
for bone_name, bone in arm.bones.items():
- bone.deform = False # Non DEF bones shouldn't deform
+ bone.use_deform = False # Non DEF bones shouldn't deform
if bone_name.startswith(ORG_PREFIX):
- bone.layer = ORG_LAYERS
+ bone.layers = ORG_LAYERS
elif bone_name.startswith(MCH_PREFIX): # XXX fixme
- bone.layer = MCH_LAYERS
+ bone.layers = MCH_LAYERS
elif bone_name.startswith(DEF_PREFIX): # XXX fixme
- bone.layer = DEF_LAYERS
- bone.deform = True
+ bone.layers = DEF_LAYERS
+ bone.use_deform = True
else:
# Assign bone appearance if there is a widget for it
obj.pose.bones[bone_name].custom_shape = context.scene.objects.get(WGT_PREFIX + bone_name)
- layer_tot[:] = [max(lay) for lay in zip(layer_tot, bone.layer)]
+ layer_tot[:] = [max(lay) for lay in zip(layer_tot, bone.layers)]
# Only for demo'ing
layer_show = [a and not (b or c or d) for a, b, c, d in zip(layer_tot, ORG_LAYERS, MCH_LAYERS, DEF_LAYERS)]
- arm.layer = layer_show
+ arm.layers = layer_show
- # obj.restrict_view = True
- obj.data.draw_axes = False
+ # obj.hide = True
+ obj.data.show_axes = False
bpy.ops.object.mode_set(mode=mode_orig)
obj_orig.data.pose_position = rest_backup
obj.data.pose_position = 'POSE'
obj_orig.data.pose_position = 'POSE'
- context.user_preferences.edit.global_undo = global_undo
+ context.user_preferences.edit.use_global_undo = use_global_undo
print("Done.\n")
@@ -490,8 +490,8 @@ def generate_test(context, metarig_type="", GENERATE_FINAL=True):
scene.objects.link(obj_new)
scene.objects.active = obj_new
for obj in scene.objects:
- obj.selected = False
- obj_new.selected = True
+ obj.select = False
+ obj_new.select = True
for module_name in get_submodule_types():
if (metarig_type and module_name != metarig_type):
@@ -534,10 +534,10 @@ def generate_test_all(context, GRAPH=False):
new_objects = rigify.generate_test(context)
if GRAPH:
- base_name = os.path.splitext(bpy.data.filename)[0]
+ base_name = os.path.splitext(bpy.data.filepath)[0]
for obj, obj_new in new_objects:
for obj in (obj, obj_new):
- fn = base_name + "-" + bpy.utils.clean_name(obj.name)
+ fn = base_name + "-" + bpy.path.clean_name(obj.name)
path_dot = fn + ".dot"
path_png = fn + ".png"
@@ -548,11 +548,11 @@ def generate_test_all(context, GRAPH=False):
i = 0
for obj, obj_new in new_objects:
- obj.data.drawtype = 'STICK'
+ obj.data.draw_type = 'STICK'
obj.location[1] += i
obj_new.location[1] += i
- obj_new.selected = False
- obj.selected = True
+ obj_new.select = False
+ obj.select = True
i += 4