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
path: root/rigify
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-12-21 04:56:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-21 04:56:42 +0300
commit0457976a872000993202763abe7503c76b461122 (patch)
treea4998fbbb768c43eb00b55ba311d497fd74eadcd /rigify
parent04f6388deeddb32d53c9b6ab961ef36e45d48486 (diff)
Rename user_preferences -> preferences
Diffstat (limited to 'rigify')
-rw-r--r--rigify/__init__.py4
-rw-r--r--rigify/generate.py6
-rw-r--r--rigify/legacy/rig_ui_pitchipoy_template.py24
-rw-r--r--rigify/legacy/rig_ui_template.py24
-rw-r--r--rigify/legacy/ui.py12
-rw-r--r--rigify/rig_ui_template.py24
-rw-r--r--rigify/ui.py34
7 files changed, 64 insertions, 64 deletions
diff --git a/rigify/__init__.py b/rigify/__init__.py
index 302fc453..9fded5ef 100644
--- a/rigify/__init__.py
+++ b/rigify/__init__.py
@@ -357,8 +357,8 @@ def register():
description="Last Frame to Transfer", default=0, min= 0)
# Update legacy on restart or reload.
- if (ui and 'legacy' in str(ui)) or bpy.context.user_preferences.addons['rigify'].preferences.legacy_mode:
- bpy.context.user_preferences.addons['rigify'].preferences.legacy_mode = True
+ if (ui and 'legacy' in str(ui)) or bpy.context.preferences.addons['rigify'].preferences.legacy_mode:
+ bpy.context.preferences.addons['rigify'].preferences.legacy_mode = True
# Add rig parameters
for rig in rig_lists.rig_list:
diff --git a/rigify/generate.py b/rigify/generate.py
index c804cb69..d726f14a 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -527,8 +527,8 @@ def generate_rig(context, metarig):
def create_selection_sets(obj, metarig):
# Check if selection sets addon is installed
- if 'bone_selection_groups' not in bpy.context.user_preferences.addons \
- and 'bone_selection_sets' not in bpy.context.user_preferences.addons:
+ if 'bone_selection_groups' not in bpy.context.preferences.addons \
+ and 'bone_selection_sets' not in bpy.context.preferences.addons:
return
bpy.ops.object.mode_set(mode='POSE')
@@ -550,7 +550,7 @@ def create_selection_sets(obj, metarig):
#bpy.ops.pose.selection_set_add()
obj.selection_sets.add()
obj.selection_sets[-1].name = name
- if 'bone_selection_sets' in bpy.context.user_preferences.addons:
+ if 'bone_selection_sets' in bpy.context.preferences.addons:
act_sel_set = obj.selection_sets[-1]
# iterate only the selected bones in current pose that are not hidden
diff --git a/rigify/legacy/rig_ui_pitchipoy_template.py b/rigify/legacy/rig_ui_pitchipoy_template.py
index 45e4f83a..4f71de06 100644
--- a/rigify/legacy/rig_ui_pitchipoy_template.py
+++ b/rigify/legacy/rig_ui_pitchipoy_template.py
@@ -541,12 +541,12 @@ class Rigify_Arm_FK2IK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -571,12 +571,12 @@ class Rigify_Arm_IK2FK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik, self.pole])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -602,12 +602,12 @@ class Rigify_Leg_FK2IK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.foot_fk, self.mfoot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.mfoot_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -635,12 +635,12 @@ class Rigify_Leg_IK2FK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.mfoot_fk, self.foot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.footroll, self.pole, self.mfoot_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
diff --git a/rigify/legacy/rig_ui_template.py b/rigify/legacy/rig_ui_template.py
index cab5674f..5f384006 100644
--- a/rigify/legacy/rig_ui_template.py
+++ b/rigify/legacy/rig_ui_template.py
@@ -389,12 +389,12 @@ class Rigify_Arm_FK2IK(bpy.types.Operator):
return (context.active_object is not None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -419,12 +419,12 @@ class Rigify_Arm_IK2FK(bpy.types.Operator):
return (context.active_object is not None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik, self.pole])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -450,12 +450,12 @@ class Rigify_Leg_FK2IK(bpy.types.Operator):
return (context.active_object is not None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.foot_fk, self.mfoot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.mfoot_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -482,12 +482,12 @@ class Rigify_Leg_IK2FK(bpy.types.Operator):
return (context.active_object is not None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.mfoot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.footroll, self.pole, self.mfoot_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
diff --git a/rigify/legacy/ui.py b/rigify/legacy/ui.py
index f04ec335..157b451c 100644
--- a/rigify/legacy/ui.py
+++ b/rigify/legacy/ui.py
@@ -284,14 +284,14 @@ class Generate(bpy.types.Operator):
import importlib
importlib.reload(generate)
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
generate.generate_rig(context, context.object)
except MetarigError as rig_exception:
rigify_report_exception(self, rig_exception)
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -312,8 +312,8 @@ class Sample(bpy.types.Operator):
def execute(self, context):
if context.mode == 'EDIT_ARMATURE' and self.metarig_type != "":
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
rig = get_rig_type(self.metarig_type)
create_sample = rig.create_sample
@@ -322,7 +322,7 @@ class Sample(bpy.types.Operator):
else:
create_sample(context.active_object)
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
bpy.ops.object.mode_set(mode='EDIT')
return {'FINISHED'}
diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py
index aec675e3..0a2234e1 100644
--- a/rigify/rig_ui_template.py
+++ b/rigify/rig_ui_template.py
@@ -614,12 +614,12 @@ class Rigify_Arm_FK2IK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -646,12 +646,12 @@ class Rigify_Arm_IK2FK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_arm(context.active_object, fk=[self.uarm_fk, self.farm_fk, self.hand_fk], ik=[self.uarm_ik, self.farm_ik, self.hand_ik, self.pole, self.main_parent])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -677,12 +677,12 @@ class Rigify_Leg_FK2IK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
fk2ik_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.foot_fk, self.mfoot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.mfoot_ik])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -711,12 +711,12 @@ class Rigify_Leg_IK2FK(bpy.types.Operator):
return (context.active_object != None and context.mode == 'POSE')
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
ik2fk_leg(context.active_object, fk=[self.thigh_fk, self.shin_fk, self.mfoot_fk, self.foot_fk], ik=[self.thigh_ik, self.shin_ik, self.foot_ik, self.footroll, self.pole, self.mfoot_ik, self.main_parent])
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
###########################
diff --git a/rigify/ui.py b/rigify/ui.py
index 77398ff0..a8a25103 100644
--- a/rigify/ui.py
+++ b/rigify/ui.py
@@ -330,8 +330,8 @@ class DATA_OT_rigify_use_standard_colors(bpy.types.Operator):
if not hasattr(armature, 'rigify_colors'):
return {'FINISHED'}
- current_theme = bpy.context.user_preferences.themes.items()[0][0]
- theme = bpy.context.user_preferences.themes[current_theme]
+ current_theme = bpy.context.preferences.themes.items()[0][0]
+ theme = bpy.context.preferences.themes[current_theme]
armature.rigify_selection_colors.select = theme.view_3d.bone_pose
armature.rigify_selection_colors.active = theme.view_3d.bone_pose_active
@@ -357,8 +357,8 @@ class DATA_OT_rigify_apply_selection_colors(bpy.types.Operator):
if not hasattr(armature, 'rigify_colors'):
return {'FINISHED'}
- #current_theme = bpy.context.user_preferences.themes.items()[0][0]
- #theme = bpy.context.user_preferences.themes[current_theme]
+ #current_theme = bpy.context.preferences.themes.items()[0][0]
+ #theme = bpy.context.preferences.themes[current_theme]
for col in armature.rigify_colors:
col.select = armature.rigify_selection_colors.select
@@ -383,8 +383,8 @@ class DATA_OT_rigify_bone_group_add(bpy.types.Operator):
armature.rigify_colors.add()
armature.rigify_colors[-1].name = unique_name(armature.rigify_colors, 'Group')
- current_theme = bpy.context.user_preferences.themes.items()[0][0]
- theme = bpy.context.user_preferences.themes[current_theme]
+ current_theme = bpy.context.preferences.themes.items()[0][0]
+ theme = bpy.context.preferences.themes[current_theme]
armature.rigify_colors[-1].normal = theme.view_3d.wire
armature.rigify_colors[-1].normal.hsv = theme.view_3d.wire.hsv
@@ -442,7 +442,7 @@ class DATA_OT_rigify_bone_group_add_theme(bpy.types.Operator):
id = int(self.theme[-2:]) - 1
- theme_color_set = bpy.context.user_preferences.themes[0].bone_color_sets[id]
+ theme_color_set = bpy.context.preferences.themes[0].bone_color_sets[id]
armature.rigify_colors[-1].normal = theme_color_set.normal
armature.rigify_colors[-1].select = theme_color_set.select
@@ -757,14 +757,14 @@ class Generate(bpy.types.Operator):
import importlib
importlib.reload(generate)
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
generate.generate_rig(context, context.object)
except MetarigError as rig_exception:
rigify_report_exception(self, rig_exception)
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}
@@ -796,7 +796,7 @@ class SwitchToLegacy(bpy.types.Operator):
return context.window_manager.invoke_confirm(self, event)
def execute(self, context):
- bpy.context.user_preferences.addons['rigify'].preferences.legacy_mode = True
+ bpy.context.preferences.addons['rigify'].preferences.legacy_mode = True
return {'FINISHED'}
@@ -815,8 +815,8 @@ class Sample(bpy.types.Operator):
def execute(self, context):
if context.mode == 'EDIT_ARMATURE' and self.metarig_type != "":
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
rig = get_rig_type(self.metarig_type)
create_sample = rig.create_sample
@@ -825,7 +825,7 @@ class Sample(bpy.types.Operator):
else:
create_sample(context.active_object)
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
bpy.ops.object.mode_set(mode='EDIT')
return {'FINISHED'}
@@ -1282,8 +1282,8 @@ class OBJECT_OT_ClearAnimation(bpy.types.Operator):
def execute(self, context):
- use_global_undo = context.user_preferences.edit.use_global_undo
- context.user_preferences.edit.use_global_undo = False
+ use_global_undo = context.preferences.edit.use_global_undo
+ context.preferences.edit.use_global_undo = False
try:
rig = context.object
scn = context.scene
@@ -1295,7 +1295,7 @@ class OBJECT_OT_ClearAnimation(bpy.types.Operator):
clearAnimation(act, self.anim_type, names=get_limb_generated_names(rig))
finally:
- context.user_preferences.edit.use_global_undo = use_global_undo
+ context.preferences.edit.use_global_undo = use_global_undo
return {'FINISHED'}