Rename user_preferences -> preferences
This commit is contained in:
parent
04f6388dee
commit
0457976a87
Notes:
blender-bot
2023-02-14 19:22:09 +01:00
Referenced by issue #60259, Preferences Add-ons error
|
@ -562,18 +562,18 @@ class Struts(Operator):
|
|||
return obj is not None and obj.type == "MESH"
|
||||
|
||||
def execute(self, context):
|
||||
store_undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
store_undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
keywords = self.as_keywords()
|
||||
|
||||
try:
|
||||
create_struts(self, context, **keywords)
|
||||
bpy.context.user_preferences.edit.use_global_undo = store_undo
|
||||
bpy.context.preferences.edit.use_global_undo = store_undo
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
except Exception as e:
|
||||
bpy.context.user_preferences.edit.use_global_undo = store_undo
|
||||
bpy.context.preferences.edit.use_global_undo = store_undo
|
||||
self.report({"WARNING"},
|
||||
"Make Struts could not be performed. Operation Cancelled")
|
||||
print("\n[mesh.generate_struts]\n{}".format(e))
|
||||
|
|
|
@ -77,7 +77,7 @@ def _get_pref_class(mod):
|
|||
|
||||
def get_addon_preferences(name=''):
|
||||
"""Acquisition and registration"""
|
||||
addons = bpy.context.user_preferences.addons
|
||||
addons = bpy.context.preferences.addons
|
||||
if __name__ not in addons: # wm.read_factory_settings()
|
||||
return None
|
||||
addon_prefs = addons[__name__].preferences
|
||||
|
|
|
@ -720,7 +720,7 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5,
|
|||
def align_matrix(context):
|
||||
|
||||
loc = Matrix.Translation(context.scene.cursor_location)
|
||||
obj_align = context.user_preferences.edit.object_align
|
||||
obj_align = context.preferences.edit.object_align
|
||||
|
||||
if (context.space_data.type == 'VIEW_3D' and
|
||||
obj_align == 'VIEW'):
|
||||
|
@ -1429,8 +1429,8 @@ class Curveaceous_galore(Operator):
|
|||
|
||||
def execute(self, context):
|
||||
# turn off undo
|
||||
undo = context.user_preferences.edit.use_global_undo
|
||||
context.user_preferences.edit.use_global_undo = False
|
||||
undo = context.preferences.edit.use_global_undo
|
||||
context.preferences.edit.use_global_undo = False
|
||||
|
||||
# deal with 2D - 3D curve differences
|
||||
if self.ProfileType in ['Helix', 'Cycloid', 'Noise']:
|
||||
|
@ -1455,7 +1455,7 @@ class Curveaceous_galore(Operator):
|
|||
main(context, self, self.align_matrix or Matrix())
|
||||
|
||||
# restore pre operator undo state
|
||||
context.user_preferences.edit.use_global_undo = undo
|
||||
context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
|
|
@ -382,7 +382,7 @@ def SimpleTrapezoid(a=2.0, b=1.0, h=1.0, center=True):
|
|||
|
||||
def align_matrix(context, location):
|
||||
loc = Matrix.Translation(location)
|
||||
obj_align = context.user_preferences.edit.object_align
|
||||
obj_align = context.preferences.edit.object_align
|
||||
if (context.space_data.type == 'VIEW_3D' and
|
||||
obj_align == 'VIEW'):
|
||||
rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
|
||||
|
|
|
@ -323,8 +323,8 @@ class SpiroFitSpline(Operator):
|
|||
"Active Object is not a Mesh. Operation Cancelled")
|
||||
return {'CANCELLED'}
|
||||
|
||||
#undo = context.user_preferences.edit.use_global_undo
|
||||
#context.user_preferences.edit.use_global_undo = False
|
||||
#undo = context.preferences.edit.use_global_undo
|
||||
#context.preferences.edit.use_global_undo = False
|
||||
|
||||
#bpy.ops.object.select_all(action='DESELECT')
|
||||
|
||||
|
@ -364,7 +364,7 @@ class SpiroFitSpline(Operator):
|
|||
if self.auto_refresh is False:
|
||||
self.refresh = False
|
||||
|
||||
#context.user_preferences.edit.use_global_undo = undo
|
||||
#context.preferences.edit.use_global_undo = undo
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
|
@ -598,8 +598,8 @@ class BounceSpline(Operator):
|
|||
if obj.type != 'MESH':
|
||||
return {'CANCELLED'}
|
||||
|
||||
#undo = context.user_preferences.edit.use_global_undo
|
||||
#context.user_preferences.edit.use_global_undo = False
|
||||
#undo = context.preferences.edit.use_global_undo
|
||||
#context.preferences.edit.use_global_undo = False
|
||||
|
||||
#bpy.ops.object.select_all(action='DESELECT')
|
||||
|
||||
|
@ -636,7 +636,7 @@ class BounceSpline(Operator):
|
|||
if self.auto_refresh is False:
|
||||
self.refresh = False
|
||||
|
||||
#context.user_preferences.edit.use_global_undo = undo
|
||||
#context.preferences.edit.use_global_undo = undo
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
|
@ -841,8 +841,8 @@ class CatenaryCurve(Operator):
|
|||
|
||||
#bpy.ops.object.select_all(action='DESELECT')
|
||||
|
||||
#undo = context.user_preferences.edit.use_global_undo
|
||||
#context.user_preferences.edit.use_global_undo = False
|
||||
#undo = context.preferences.edit.use_global_undo
|
||||
#context.preferences.edit.use_global_undo = False
|
||||
|
||||
r.seed(self.random_seed)
|
||||
|
||||
|
@ -876,7 +876,7 @@ class CatenaryCurve(Operator):
|
|||
if self.auto_refresh is False:
|
||||
self.refresh = False
|
||||
|
||||
#context.user_preferences.edit.use_global_undo = undo
|
||||
#context.preferences.edit.use_global_undo = undo
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ def align_matrix(self, context):
|
|||
userLoc = Matrix.Translation(self.location)
|
||||
userRot = self.rotation.to_matrix().to_4x4()
|
||||
|
||||
obj_align = context.user_preferences.edit.object_align
|
||||
obj_align = context.preferences.edit.object_align
|
||||
if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'):
|
||||
rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
|
||||
else:
|
||||
|
@ -712,14 +712,14 @@ class torus_knot_plus(Operator, AddObjectHelper):
|
|||
self.align_matrix = align_matrix(self, context)
|
||||
|
||||
# turn off undo
|
||||
#undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
#bpy.context.user_preferences.edit.use_global_undo = False
|
||||
#undo = bpy.context.preferences.edit.use_global_undo
|
||||
#bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
# create the curve
|
||||
create_torus_knot(self, context)
|
||||
|
||||
# restore pre operator undo state
|
||||
#bpy.context.user_preferences.edit.use_global_undo = undo
|
||||
#bpy.context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ class Solids(bpy.types.Operator):
|
|||
def execute(self, context):
|
||||
# turn off undo for better performance (3-5x faster), also makes sure
|
||||
# that mesh ops are undoable and entire script acts as one operator
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
# piece of code to make presets remain until parameters are changed
|
||||
if self.preset != "0":
|
||||
|
@ -513,6 +513,6 @@ class Solids(bpy.types.Operator):
|
|||
# object generation done
|
||||
|
||||
# turn undo back on
|
||||
bpy.context.user_preferences.edit.use_global_undo = True
|
||||
bpy.context.preferences.edit.use_global_undo = True
|
||||
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -505,7 +505,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -612,8 +612,8 @@ class AntAddLandscape(bpy.types.Operator):
|
|||
return {'PASS_THROUGH'}
|
||||
|
||||
# turn off undo
|
||||
undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
# deselect all objects when in object mode
|
||||
if bpy.ops.object.select_all.poll():
|
||||
|
@ -796,6 +796,6 @@ class AntAddLandscape(bpy.types.Operator):
|
|||
self.refresh = False
|
||||
|
||||
# restore pre operator undo state
|
||||
context.user_preferences.edit.use_global_undo = undo
|
||||
context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -142,8 +142,8 @@ class AntLandscapeRefresh(bpy.types.Operator):
|
|||
|
||||
def execute(self, context):
|
||||
# turn off undo
|
||||
undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
# ant object items
|
||||
obj = bpy.context.active_object
|
||||
|
@ -178,7 +178,7 @@ class AntLandscapeRefresh(bpy.types.Operator):
|
|||
pass
|
||||
|
||||
# restore pre operator undo state
|
||||
context.user_preferences.edit.use_global_undo = undo
|
||||
context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@ -202,8 +202,8 @@ class AntLandscapeRegenerate(bpy.types.Operator):
|
|||
def execute(self, context):
|
||||
|
||||
# turn off undo
|
||||
undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
scene = bpy.context.scene
|
||||
# ant object items
|
||||
|
@ -329,7 +329,7 @@ class AntLandscapeRegenerate(bpy.types.Operator):
|
|||
scene.objects.active = new_ob
|
||||
|
||||
# restore pre operator undo state
|
||||
context.user_preferences.edit.use_global_undo = undo
|
||||
context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
|
|
@ -616,8 +616,8 @@ class AntMeshDisplace(bpy.types.Operator):
|
|||
return {'PASS_THROUGH'}
|
||||
|
||||
# turn off undo
|
||||
undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
ob = context.object
|
||||
|
||||
|
@ -745,6 +745,6 @@ class AntMeshDisplace(bpy.types.Operator):
|
|||
self.refresh = False
|
||||
|
||||
# restore pre operator undo state
|
||||
context.user_preferences.edit.use_global_undo = undo
|
||||
context.preferences.edit.use_global_undo = undo
|
||||
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -157,7 +157,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -458,7 +458,7 @@ def menu_func(self, context):
|
|||
icons = icons_collection["main"]
|
||||
|
||||
# either draw sub menu or right at end of this one
|
||||
if context.user_preferences.addons[__name__].preferences.create_submenu:
|
||||
if context.preferences.addons[__name__].preferences.create_submenu:
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
layout.menu("ARCHIPACK_MT_create", icon_value=icons["archipack"].icon_id)
|
||||
else:
|
||||
|
|
|
@ -66,7 +66,7 @@ def get_prefs(context):
|
|||
global __name__
|
||||
try:
|
||||
addon_name = __name__.split('.')[0]
|
||||
prefs = context.user_preferences.addons[addon_name].preferences
|
||||
prefs = context.preferences.addons[addon_name].preferences
|
||||
except:
|
||||
prefs = DefaultColorScheme
|
||||
pass
|
||||
|
@ -325,7 +325,7 @@ class GlText(Gl):
|
|||
"""
|
||||
overall on-screen size in pixels
|
||||
"""
|
||||
dpi, font_id = context.user_preferences.system.dpi, 0
|
||||
dpi, font_id = context.preferences.system.dpi, 0
|
||||
if self.angle != 0:
|
||||
blf.enable(font_id, blf.ROTATION)
|
||||
blf.rotation(font_id, self.angle)
|
||||
|
@ -437,7 +437,7 @@ class GlText(Gl):
|
|||
p = self.position_2d_from_coord(context, self.pts[0], render)
|
||||
|
||||
# dirty fast assignment
|
||||
dpi, font_id = context.user_preferences.system.dpi, 0
|
||||
dpi, font_id = context.preferences.system.dpi, 0
|
||||
|
||||
# self.cbuff[0:4] = self.colour
|
||||
|
||||
|
@ -1151,7 +1151,7 @@ class Screen():
|
|||
|
||||
def size(self, context):
|
||||
|
||||
system = context.user_preferences.system
|
||||
system = context.preferences.system
|
||||
w = context.region.width
|
||||
h = context.region.height
|
||||
y_min = self.margin
|
||||
|
|
|
@ -1956,7 +1956,7 @@ class archipack_manipulator(PropertyGroup):
|
|||
try:
|
||||
# retrieve addon name from imports
|
||||
addon_name = __name__.split('.')[0]
|
||||
prefs = context.user_preferences.addons[addon_name].preferences
|
||||
prefs = context.preferences.addons[addon_name].preferences
|
||||
arrow_size = prefs.arrow_size
|
||||
handle_size = prefs.handle_size
|
||||
except:
|
||||
|
|
|
@ -132,7 +132,7 @@ class MatlibsManager():
|
|||
prefs = None
|
||||
# retrieve addon name from imports
|
||||
addon_name = __name__.split('.')[0]
|
||||
prefs = context.user_preferences.addons[addon_name].preferences
|
||||
prefs = context.preferences.addons[addon_name].preferences
|
||||
return prefs
|
||||
|
||||
@property
|
||||
|
|
|
@ -539,7 +539,7 @@ class ArchipackPreset(AddPresetBase):
|
|||
def background_render(self, context, cls, preset):
|
||||
generator = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + "archipack_thumbs.py"
|
||||
addon_name = __name__.split('.')[0]
|
||||
matlib_path = context.user_preferences.addons[addon_name].preferences.matlib_path
|
||||
matlib_path = context.preferences.addons[addon_name].preferences.matlib_path
|
||||
# Run external instance of blender like the original thumbnail generator.
|
||||
cmd = [
|
||||
bpy.app.binary_path,
|
||||
|
|
|
@ -56,7 +56,7 @@ class ARCHIPACK_OT_render_thumbs(Operator):
|
|||
def background_render(self, context, cls, preset):
|
||||
generator = path.dirname(path.realpath(__file__)) + path.sep + "archipack_thumbs.py"
|
||||
addon_name = __name__.split('.')[0]
|
||||
matlib_path = context.user_preferences.addons[addon_name].preferences.matlib_path
|
||||
matlib_path = context.preferences.addons[addon_name].preferences.matlib_path
|
||||
# Run external instance of blender like the original thumbnail generator.
|
||||
cmd = [
|
||||
bpy.app.binary_path,
|
||||
|
@ -174,7 +174,7 @@ class ARCHIPACK_OT_render_thumbs(Operator):
|
|||
|
||||
def invoke(self, context, event):
|
||||
addon_name = __name__.split('.')[0]
|
||||
matlib_path = context.user_preferences.addons[addon_name].preferences.matlib_path
|
||||
matlib_path = context.preferences.addons[addon_name].preferences.matlib_path
|
||||
|
||||
if matlib_path == '':
|
||||
self.report({'WARNING'}, "You should setup a default material library path in addon preferences")
|
||||
|
|
|
@ -223,7 +223,7 @@ if __name__ == "__main__":
|
|||
# log("### ENABLE %s ADDON ############################" % module)
|
||||
bpy.ops.wm.addon_enable(module=module)
|
||||
# log("### MATLIB PATH ############################")
|
||||
bpy.context.user_preferences.addons[module].preferences.matlib_path = matlib
|
||||
bpy.context.preferences.addons[module].preferences.matlib_path = matlib
|
||||
except:
|
||||
raise RuntimeError("module name not found")
|
||||
# log("### GENERATE ############################")
|
||||
|
|
|
@ -2263,7 +2263,7 @@ class ARCHIPACK_OT_wall2_draw(ArchipackDrawTool, Operator):
|
|||
def invoke(self, context, event):
|
||||
|
||||
if context.mode == "OBJECT":
|
||||
prefs = context.user_preferences.addons[__name__.split('.')[0]].preferences
|
||||
prefs = context.preferences.addons[__name__.split('.')[0]].preferences
|
||||
self.max_style_draw_tool = prefs.max_style_draw_tool
|
||||
self.keymap = Keymaps(context)
|
||||
self.wall_part1 = GlPolygon((0.5, 0, 0, 0.2))
|
||||
|
|
|
@ -263,7 +263,7 @@ class BlenderIdPreferences(AddonPreferences):
|
|||
class BlenderIdMixin:
|
||||
@staticmethod
|
||||
def addon_prefs(context):
|
||||
preferences = context.user_preferences.addons[__name__].preferences
|
||||
preferences = context.preferences.addons[__name__].preferences
|
||||
preferences.reset_messages()
|
||||
return preferences
|
||||
|
||||
|
@ -352,7 +352,7 @@ def register():
|
|||
bpy.utils.register_class(BlenderIdPreferences)
|
||||
bpy.utils.register_class(BlenderIdValidate)
|
||||
|
||||
preferences = bpy.context.user_preferences.addons[__name__].preferences
|
||||
preferences = bpy.context.preferences.addons[__name__].preferences
|
||||
preferences.reset_messages()
|
||||
|
||||
|
||||
|
|
|
@ -579,7 +579,7 @@ class addTracerObjectPanel(Panel):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
Btrace = context.window_manager.curve_tracer
|
||||
addon_prefs = context.user_preferences.addons["btrace"].preferences
|
||||
addon_prefs = context.preferences.addons["btrace"].preferences
|
||||
switch_expand = addon_prefs.expand_enum
|
||||
obj = context.object
|
||||
|
||||
|
|
|
@ -91,9 +91,9 @@ class RunAction(Operator):
|
|||
myempty.select = True
|
||||
context.scene.objects.active = myempty
|
||||
# save current configuration
|
||||
savedinterpolation = context.user_preferences.edit.keyframe_new_interpolation_type
|
||||
savedinterpolation = context.preferences.edit.keyframe_new_interpolation_type
|
||||
# change interpolation mode
|
||||
context.user_preferences.edit.keyframe_new_interpolation_type = 'LINEAR'
|
||||
context.preferences.edit.keyframe_new_interpolation_type = 'LINEAR'
|
||||
# create first frame
|
||||
myempty.rotation_euler = (0, 0, 0)
|
||||
myempty.empty_display_size = 0.1
|
||||
|
@ -165,7 +165,7 @@ class RunAction(Operator):
|
|||
bpy.context.object.constraints[-1].target = bpy.data.objects[myempty.name]
|
||||
|
||||
# back previous configuration
|
||||
context.user_preferences.edit.keyframe_new_interpolation_type = savedinterpolation
|
||||
context.preferences.edit.keyframe_new_interpolation_type = savedinterpolation
|
||||
bpy.context.scene.cursor_location = savedcursor
|
||||
|
||||
# -------------------------
|
||||
|
|
|
@ -574,8 +574,8 @@ class CURVE_OT_simplify(Operator):
|
|||
self.keepShort # 7
|
||||
]
|
||||
try:
|
||||
global_undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
context.user_preferences.edit.use_global_undo = False
|
||||
global_undo = bpy.context.preferences.edit.use_global_undo
|
||||
context.preferences.edit.use_global_undo = False
|
||||
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
obj = context.active_object
|
||||
|
@ -583,11 +583,11 @@ class CURVE_OT_simplify(Operator):
|
|||
|
||||
main(context, obj, options, curve_dimension)
|
||||
|
||||
context.user_preferences.edit.use_global_undo = global_undo
|
||||
context.preferences.edit.use_global_undo = global_undo
|
||||
except Exception as e:
|
||||
error_handlers(self, "curve.simplify", e, "Simplify Curves")
|
||||
|
||||
context.user_preferences.edit.use_global_undo = global_undo
|
||||
context.preferences.edit.use_global_undo = global_undo
|
||||
return {'CANCELLED'}
|
||||
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -48,12 +48,12 @@ HISTORY = []
|
|||
|
||||
|
||||
def ui_scale():
|
||||
prefs = bpy.context.user_preferences.system
|
||||
prefs = bpy.context.preferences.system
|
||||
return prefs.dpi * prefs.pixel_size / DPI
|
||||
|
||||
|
||||
def prefs():
|
||||
return bpy.context.user_preferences.addons[__name__].preferences
|
||||
return bpy.context.preferences.addons[__name__].preferences
|
||||
|
||||
|
||||
class Icons:
|
||||
|
|
|
@ -2830,7 +2830,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -869,14 +869,14 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper):
|
|||
self.relative = False
|
||||
|
||||
# this won't work in edit mode
|
||||
editmode = context.user_preferences.edit.use_enter_edit_mode
|
||||
context.user_preferences.edit.use_enter_edit_mode = False
|
||||
editmode = context.preferences.edit.use_enter_edit_mode
|
||||
context.preferences.edit.use_enter_edit_mode = False
|
||||
if context.active_object and context.active_object.mode == 'EDIT':
|
||||
bpy.ops.object.mode_set(mode='OBJECT')
|
||||
|
||||
self.import_images(context)
|
||||
|
||||
context.user_preferences.edit.use_enter_edit_mode = editmode
|
||||
context.preferences.edit.use_enter_edit_mode = editmode
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -165,7 +165,7 @@ class Ms3dExporter():
|
|||
= blender_context.selected_objects[0]
|
||||
|
||||
# restore pre operator undo state
|
||||
blender_context.user_preferences.edit.use_global_undo = self.undo
|
||||
blender_context.preferences.edit.use_global_undo = self.undo
|
||||
|
||||
is_valid, statistics = ms3d_model.is_valid()
|
||||
if self.options_verbose in Ms3dUi.VERBOSE_NORMAL:
|
||||
|
|
|
@ -99,8 +99,8 @@ def select_all(select):
|
|||
def pre_setup_environment(porter, blender_context):
|
||||
# inject undo to porter
|
||||
# and turn off undo
|
||||
porter.undo = blender_context.user_preferences.edit.use_global_undo
|
||||
blender_context.user_preferences.edit.use_global_undo = False
|
||||
porter.undo = blender_context.preferences.edit.use_global_undo
|
||||
blender_context.preferences.edit.use_global_undo = False
|
||||
|
||||
# inject active_object to self
|
||||
porter.active_object = blender_context.scene.objects.active
|
||||
|
@ -126,7 +126,7 @@ def post_setup_environment(porter, blender_context):
|
|||
= blender_context.selected_objects[0]
|
||||
|
||||
# restore pre operator undo state
|
||||
blender_context.user_preferences.edit.use_global_undo = porter.undo
|
||||
blender_context.preferences.edit.use_global_undo = porter.undo
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
|
|
@ -138,7 +138,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
|
|||
).to_4x4()
|
||||
keywords["global_matrix"] = global_matrix
|
||||
|
||||
if bpy.data.is_saved and context.user_preferences.filepaths.use_relative_paths:
|
||||
if bpy.data.is_saved and context.preferences.filepaths.use_relative_paths:
|
||||
import os
|
||||
keywords["relpath"] = os.path.dirname(bpy.data.filepath)
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -72,7 +72,7 @@ def check_world_name(name_id="Dynamic"):
|
|||
|
||||
|
||||
def check_cycles():
|
||||
return ('cycles' in bpy.context.user_preferences.addons.keys())
|
||||
return ('cycles' in bpy.context.preferences.addons.keys())
|
||||
|
||||
|
||||
class dsky(Operator):
|
||||
|
|
|
@ -264,7 +264,7 @@ class Library():
|
|||
def get_libraries():
|
||||
libs = [Library(matlib_path, f) for f in os.listdir(matlib_path) if f[-5::] == "blend"]
|
||||
try:
|
||||
user_path = bpy.context.user_preferences.addons[__name__].preferences.matlib_path
|
||||
user_path = bpy.context.preferences.addons[__name__].preferences.matlib_path
|
||||
if user_path:
|
||||
if os.path.exists(user_path):
|
||||
libs.extend([Library(user_path, f) for f in os.listdir(user_path) if f[-5::] == "blend"])
|
||||
|
@ -1093,7 +1093,7 @@ def clean_materials():
|
|||
|
||||
bin = bpy.app.binary_path
|
||||
mats = list_materials()
|
||||
bpy.context.user_preferences.filepaths.save_version = 0
|
||||
bpy.context.preferences.filepaths.save_version = 0
|
||||
for mat in mats:
|
||||
clean_materials()
|
||||
matpath = os.path.join("{1}", mat + ".blend")
|
||||
|
|
|
@ -2594,7 +2594,7 @@ def use_separator(operator, context):
|
|||
# preferences utilities
|
||||
|
||||
def return_preferences():
|
||||
return bpy.context.user_preferences.addons[__name__].preferences
|
||||
return bpy.context.preferences.addons[__name__].preferences
|
||||
|
||||
|
||||
def use_remove_mat_all():
|
||||
|
|
|
@ -25,7 +25,7 @@ def warning_messages(operator=None, warn='DEFAULT', object_name="", is_mat=None,
|
|||
# override - important messages that should be enabled, no matter the setting
|
||||
|
||||
# pass the show_warnings bool to enable/disable them
|
||||
addon = bpy.context.user_preferences.addons[MAT_SPEC_NAME]
|
||||
addon = bpy.context.preferences.addons[MAT_SPEC_NAME]
|
||||
get_warn = addon.preferences.show_warnings if addon else False
|
||||
show_warn = get_warn if override is False else override
|
||||
|
||||
|
@ -160,7 +160,7 @@ def collect_report(collection="", is_start=False, is_final=False):
|
|||
|
||||
def c_is_cycles_addon_enabled():
|
||||
# checks if Cycles is enabled thanks to ideasman42
|
||||
return ('cycles' in bpy.context.user_preferences.addons.keys())
|
||||
return ('cycles' in bpy.context.preferences.addons.keys())
|
||||
|
||||
|
||||
def c_data_has_materials():
|
||||
|
|
|
@ -89,7 +89,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -806,7 +806,7 @@ def draw_text(myobj, pos2d, display_text, rgba, fsize, align='L', text_rot=0.0):
|
|||
if pos2d is None:
|
||||
return
|
||||
|
||||
# dpi = bpy.context.user_preferences.system.dpi
|
||||
# dpi = bpy.context.preferences.system.dpi
|
||||
gap = 12
|
||||
x_pos, y_pos = pos2d
|
||||
font_id = 0
|
||||
|
|
|
@ -3037,7 +3037,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
|
||||
def execute(self, context):
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
if not self.is_fill_faces:
|
||||
bpy.ops.wm.context_set_value(data_path='tool_settings.mesh_select_mode',
|
||||
|
@ -3108,17 +3108,17 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
|
||||
bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
bpy.context.preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
|
||||
return{'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
self.initial_global_undo_state = bpy.context.user_preferences.edit.use_global_undo
|
||||
self.initial_global_undo_state = bpy.context.preferences.edit.use_global_undo
|
||||
|
||||
self.main_object = bpy.context.scene.objects.active
|
||||
self.main_object_selected_verts_count = int(self.main_object.data.total_vert_sel)
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
bpy.ops.wm.context_set_value(data_path='tool_settings.mesh_select_mode',
|
||||
value='True, False, False')
|
||||
|
||||
|
@ -3333,7 +3333,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
|
||||
self.execute(context)
|
||||
# Set again since "execute()" will turn it again to its initial value
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
|
||||
# If "Keep strokes" option is not active, delete original strokes curve object
|
||||
if (not self.stopping_errors and not self.keep_strokes) or self.is_crosshatch:
|
||||
|
@ -3354,7 +3354,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
if self.strokes_type == "GP_STROKES" and not self.stopping_errors:
|
||||
bpy.ops.gpencil.active_frame_delete('INVOKE_REGION_WIN')
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
bpy.context.preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
|
||||
if not self.stopping_errors:
|
||||
return {"FINISHED"}
|
||||
|
@ -3366,7 +3366,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
created_faces_count = self.fill_with_faces(self.main_object)
|
||||
|
||||
bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
|
||||
bpy.context.user_preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
bpy.context.preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
|
||||
if created_faces_count == 0:
|
||||
self.report({'WARNING'}, "There aren't any strokes attached to the object")
|
||||
|
@ -3374,7 +3374,7 @@ class GPENCIL_OT_SURFSK_add_surface(Operator):
|
|||
else:
|
||||
return {"FINISHED"}
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
bpy.context.preferences.edit.use_global_undo = self.initial_global_undo_state
|
||||
|
||||
if self.strokes_type == "EXTERNAL_NO_CURVE":
|
||||
self.report({'WARNING'}, "The secondary object is not a Curve.")
|
||||
|
@ -3858,7 +3858,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -714,7 +714,7 @@ def draw_callback_px(self, context):
|
|||
region = context.region
|
||||
|
||||
# Width screen
|
||||
overlap = context.user_preferences.system.use_region_overlap
|
||||
overlap = context.preferences.system.use_region_overlap
|
||||
t_panel_width = 0
|
||||
if overlap:
|
||||
for region in context.area.regions:
|
||||
|
@ -3115,7 +3115,7 @@ class Carver(bpy.types.Operator):
|
|||
|
||||
# Undo Variables
|
||||
self.undo_index = 0
|
||||
self.undo_limit = context.user_preferences.edit.undo_steps
|
||||
self.undo_limit = context.preferences.edit.undo_steps
|
||||
self.undo_list = []
|
||||
|
||||
# Boolean operations type
|
||||
|
|
|
@ -127,7 +127,7 @@ def draw_callback_px(self, context):
|
|||
pt_buf.depth_location
|
||||
)
|
||||
blf.position(font_id, pt_buf.x + 15, pt_buf.y - 15, 0)
|
||||
blf.size(font_id, font_size, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, font_size, context.preferences.system.dpi)
|
||||
blf.draw(font_id,
|
||||
'(' + str(round(mloc3d[0], 4)) + ', ' + str(round(mloc3d[1], 4)) +
|
||||
', ' + str(round(mloc3d[2], 4)) + ')')
|
||||
|
@ -155,7 +155,7 @@ def draw_callback_px(self, context):
|
|||
)
|
||||
vec0 = pt_buf.list_m_loc_3d[-1] - m_loc_3d
|
||||
blf.position(font_id, pt_buf.x + 15, pt_buf.y + 15, 0)
|
||||
blf.size(font_id, font_size, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, font_size, context.preferences.system.dpi)
|
||||
blf.draw(font_id, str(round(vec0.length, 4)))
|
||||
|
||||
# angle first after mouse
|
||||
|
@ -180,7 +180,7 @@ def draw_callback_px(self, context):
|
|||
)
|
||||
bgl.glColor4f(0.0, 1.0, 0.525, alpha)
|
||||
blf.position(font_id, loc_4[0] + 10, loc_4[1] + 10, 0)
|
||||
blf.size(font_id, font_size, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, font_size, context.preferences.system.dpi)
|
||||
blf.draw(font_id, text_0 + '')
|
||||
|
||||
bgl.glLineStipple(4, 0x5555)
|
||||
|
@ -219,7 +219,7 @@ def draw_callback_px(self, context):
|
|||
(pt_buf.list_m_loc_3d[k] + pt_buf.list_m_loc_3d[(k + 1) % n]) * 0.5
|
||||
)
|
||||
blf.position(font_id, loc_3[0] + 10, loc_3[1] + 10, 0)
|
||||
blf.size(font_id, font_size, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, font_size, context.preferences.system.dpi)
|
||||
blf.draw(font_id,
|
||||
str(round((pt_buf.list_m_loc_3d[k] - pt_buf.list_m_loc_3d[(k + 1) % n]).length, 4)))
|
||||
|
||||
|
@ -246,12 +246,12 @@ def draw_callback_px(self, context):
|
|||
)
|
||||
bgl.glColor4f(0.0, 1.0, 0.525, alpha)
|
||||
blf.position(font_id, loc_4[0] + 10, loc_4[1] + 10, 0)
|
||||
blf.size(font_id, font_size, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, font_size, context.preferences.system.dpi)
|
||||
blf.draw(font_id, str(round(degrees(ang), 2)) + '')
|
||||
# tools on / off
|
||||
bgl.glColor4f(1.0, 1.0, 1.0, 1.0)
|
||||
blf.position(font_id, self.text_location, 20, 0)
|
||||
blf.size(font_id, 15, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, 15, context.preferences.system.dpi)
|
||||
blf.draw(font_id, "Draw On")
|
||||
blf.position(font_id, self.text_location, 40, 0)
|
||||
blf.draw(font_id, "Extrude On" if pt_buf.ctrl else "Extrude Off")
|
||||
|
@ -501,7 +501,7 @@ class pen_tool_operator(Operator):
|
|||
if context.area.type == 'VIEW_3D':
|
||||
# pre-compute the text location (thanks to the Carver add-on)
|
||||
self.text_location = 100
|
||||
overlap = context.user_preferences.system.use_region_overlap
|
||||
overlap = context.preferences.system.use_region_overlap
|
||||
for region in context.area.regions:
|
||||
if region.type == "WINDOW":
|
||||
self.text_location = region.width - 100
|
||||
|
|
|
@ -150,7 +150,7 @@ def quad_from_edge(bm, edge_sel, context, event):
|
|||
|
||||
# adjust uv-map
|
||||
if __name__ != '__main__':
|
||||
addon_prefs = context.user_preferences.addons[__name__].preferences
|
||||
addon_prefs = context.preferences.addons[__name__].preferences
|
||||
if addon_prefs.adjustuv:
|
||||
for (key, uv_layer) in bm.loops.layers.uv.items():
|
||||
uv_ori = {}
|
||||
|
@ -249,7 +249,7 @@ def quad_from_vertex(bm, vert_sel, context, event):
|
|||
|
||||
# adjust uv-map
|
||||
if __name__ != '__main__':
|
||||
addon_prefs = context.user_preferences.addons[__name__].preferences
|
||||
addon_prefs = context.preferences.addons[__name__].preferences
|
||||
if addon_prefs.adjustuv:
|
||||
for (key, uv_layer) in bm.loops.layers.uv.items():
|
||||
uv_others = {}
|
||||
|
@ -331,7 +331,7 @@ class MeshF2(bpy.types.Operator):
|
|||
# single vertex selected -> mirror vertex and create new face
|
||||
quad_from_vertex(bm, sel[0], context, event)
|
||||
if __name__ != '__main__':
|
||||
addon_prefs = context.user_preferences.addons[__name__].\
|
||||
addon_prefs = context.preferences.addons[__name__].\
|
||||
preferences
|
||||
if addon_prefs.autograb:
|
||||
bpy.ops.transform.translate('INVOKE_DEFAULT')
|
||||
|
|
|
@ -110,13 +110,13 @@ class Inset(bpy.types.Operator):
|
|||
return {'FINISHED'}
|
||||
|
||||
def action(self, context):
|
||||
save_global_undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
save_global_undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
obj = bpy.context.active_object
|
||||
mesh = obj.data
|
||||
do_inset(mesh, self.inset_amount, self.inset_height, self.region,
|
||||
self.scale == 'PERCENT')
|
||||
bpy.context.user_preferences.edit.use_global_undo = save_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = save_global_undo
|
||||
bpy.ops.object.editmode_toggle()
|
||||
bpy.ops.object.editmode_toggle()
|
||||
|
||||
|
|
|
@ -745,8 +745,8 @@ def get_parallel_loops(bm_mod, loops):
|
|||
|
||||
# gather initial data
|
||||
def initialise():
|
||||
global_undo = bpy.context.user_preferences.edit.use_global_undo
|
||||
bpy.context.user_preferences.edit.use_global_undo = False
|
||||
global_undo = bpy.context.preferences.edit.use_global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = False
|
||||
object = bpy.context.active_object
|
||||
if 'MIRROR' in [mod.type for mod in object.modifiers if mod.show_viewport]:
|
||||
# ensure that selection is synced for the derived mesh
|
||||
|
@ -834,7 +834,7 @@ def terminate(global_undo):
|
|||
if obj.mode == 'EDIT':
|
||||
bmesh.update_edit_mesh(obj.data, loop_triangles=True, destructive=True)
|
||||
|
||||
bpy.context.user_preferences.edit.use_global_undo = global_undo
|
||||
bpy.context.preferences.edit.use_global_undo = global_undo
|
||||
|
||||
|
||||
# ########################################
|
||||
|
@ -5067,7 +5067,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -45,7 +45,7 @@ from bpy.utils.toolsystem import ToolDef
|
|||
def tool_make_line():
|
||||
import os
|
||||
def draw_settings(context, layout, tool):
|
||||
addon_prefs = context.user_preferences.addons["mesh_snap_utilities_line"].preferences
|
||||
addon_prefs = context.preferences.addons["mesh_snap_utilities_line"].preferences
|
||||
|
||||
layout.prop(addon_prefs, "incremental")
|
||||
layout.prop(addon_prefs, "increments_grid")
|
||||
|
|
|
@ -216,7 +216,7 @@ class SnapNavigation():
|
|||
def __init__(self, context, use_ndof):
|
||||
# TO DO:
|
||||
# 'View Orbit', 'View Pan', 'NDOF Orbit View', 'NDOF Pan View'
|
||||
self.use_ndof = use_ndof and context.user_preferences.inputs.use_ndof
|
||||
self.use_ndof = use_ndof and context.preferences.inputs.use_ndof
|
||||
|
||||
self._rotate = set()
|
||||
self._move = set()
|
||||
|
@ -371,7 +371,7 @@ class MousePointWidget(bpy.types.Gizmo):
|
|||
|
||||
context = bpy.context
|
||||
|
||||
self.preferences = preferences = context.user_preferences.addons[__package__].preferences
|
||||
self.preferences = preferences = context.preferences.addons[__package__].preferences
|
||||
|
||||
#Configure the unit of measure
|
||||
self.snap_to_grid = preferences.increments_grid
|
||||
|
@ -386,9 +386,9 @@ class MousePointWidget(bpy.types.Gizmo):
|
|||
preferences.center_color,
|
||||
preferences.perpendicular_color,
|
||||
preferences.constrain_shift_color,
|
||||
(*context.user_preferences.themes[0].user_interface.axis_x, 1.0),
|
||||
(*context.user_preferences.themes[0].user_interface.axis_y, 1.0),
|
||||
(*context.user_preferences.themes[0].user_interface.axis_z, 1.0)
|
||||
(*context.preferences.themes[0].user_interface.axis_x, 1.0),
|
||||
(*context.preferences.themes[0].user_interface.axis_y, 1.0),
|
||||
(*context.preferences.themes[0].user_interface.axis_z, 1.0)
|
||||
)
|
||||
|
||||
#Init Snap Context
|
||||
|
|
|
@ -493,7 +493,7 @@ class SnapUtilitiesLine(bpy.types.Operator):
|
|||
|
||||
preferences = self.snap_widget.preferences
|
||||
else:
|
||||
preferences = context.user_preferences.addons[__package__].preferences
|
||||
preferences = context.preferences.addons[__package__].preferences
|
||||
|
||||
#Init DrawCache
|
||||
self.draw_cache = SnapDrawn(
|
||||
|
@ -504,9 +504,9 @@ class SnapUtilitiesLine(bpy.types.Operator):
|
|||
preferences.center_color,
|
||||
preferences.perpendicular_color,
|
||||
preferences.constrain_shift_color,
|
||||
tuple(context.user_preferences.themes[0].user_interface.axis_x) + (1.0,),
|
||||
tuple(context.user_preferences.themes[0].user_interface.axis_y) + (1.0,),
|
||||
tuple(context.user_preferences.themes[0].user_interface.axis_z) + (1.0,)
|
||||
tuple(context.preferences.themes[0].user_interface.axis_x) + (1.0,),
|
||||
tuple(context.preferences.themes[0].user_interface.axis_y) + (1.0,),
|
||||
tuple(context.preferences.themes[0].user_interface.axis_z) + (1.0,)
|
||||
)
|
||||
|
||||
self.sctx = None
|
||||
|
|
|
@ -5,8 +5,8 @@ import bpy
|
|||
url_manual_prefix = "https://docs.blender.org/manual/en/dev/"
|
||||
|
||||
language = ""
|
||||
if bpy.context.user_preferences.system.use_international_fonts:
|
||||
language = bpy.context.user_preferences.system.language
|
||||
if bpy.context.preferences.system.use_international_fonts:
|
||||
language = bpy.context.preferences.system.language
|
||||
if language == 'DEFAULT':
|
||||
import os
|
||||
language = os.getenv('LANG', '').split('.')[0]
|
||||
|
|
|
@ -614,7 +614,7 @@ def force_update(context):
|
|||
|
||||
|
||||
def dpifac():
|
||||
prefs = bpy.context.user_preferences.system
|
||||
prefs = bpy.context.preferences.system
|
||||
return prefs.dpi * prefs.pixel_size / 72
|
||||
|
||||
|
||||
|
@ -2042,7 +2042,7 @@ class NWMergeNodes(Operator, NWBase):
|
|||
)
|
||||
|
||||
def execute(self, context):
|
||||
settings = context.user_preferences.addons[__name__].preferences
|
||||
settings = context.preferences.addons[__name__].preferences
|
||||
merge_hide = settings.merge_hide
|
||||
merge_position = settings.merge_position # 'center' or 'bottom'
|
||||
|
||||
|
@ -2717,7 +2717,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper):
|
|||
|
||||
# Filter textures names for texturetypes in filenames
|
||||
# [Socket Name, [abbreviations and keyword list], Filename placeholder]
|
||||
tags = context.user_preferences.addons[__name__].preferences.principled_tags
|
||||
tags = context.preferences.addons[__name__].preferences.principled_tags
|
||||
normal_abbr = tags.normal.split(' ')
|
||||
bump_abbr = tags.bump.split(' ')
|
||||
gloss_abbr = tags.gloss.split(' ')
|
||||
|
|
|
@ -102,8 +102,8 @@ def FindCanvas(obj):
|
|||
|
||||
|
||||
def isFTransf():
|
||||
user_preferences = bpy.context.user_preferences
|
||||
addons = user_preferences.addons
|
||||
preferences = bpy.context.preferences
|
||||
addons = preferences.addons
|
||||
addon_prefs = addons[__name__].preferences
|
||||
if addon_prefs.fast_transform:
|
||||
return True
|
||||
|
@ -114,16 +114,16 @@ def isFTransf():
|
|||
"""
|
||||
# EXPERIMENTAL FEATURES
|
||||
def isMakeVertexGroup():
|
||||
user_preferences = bpy.context.user_preferences
|
||||
addon_prefs = user_preferences.addons[__name__].preferences
|
||||
preferences = bpy.context.preferences
|
||||
addon_prefs = preferences.addons[__name__].preferences
|
||||
if addon_prefs.make_vertex_groups:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def isMakeBoundary():
|
||||
user_preferences = bpy.context.user_preferences
|
||||
addon_prefs = user_preferences.addons[__name__].preferences
|
||||
preferences = bpy.context.preferences
|
||||
addon_prefs = preferences.addons[__name__].preferences
|
||||
if addon_prefs.make_boundary:
|
||||
return True
|
||||
else:
|
||||
|
@ -141,7 +141,7 @@ def ConvertToMesh(obj):
|
|||
# Do the Union, Difference and Intersection Operations with a Brush
|
||||
def Operation(context, _operation):
|
||||
|
||||
prefs = bpy.context.user_preferences.addons[__name__].preferences
|
||||
prefs = bpy.context.preferences.addons[__name__].preferences
|
||||
useWire = prefs.use_wire
|
||||
|
||||
for selObj in bpy.context.selected_objects:
|
||||
|
@ -503,7 +503,7 @@ class BTool_FastTransform(Operator):
|
|||
def modal(self, context, event):
|
||||
self.count += 1
|
||||
actObj = bpy.context.active_object
|
||||
useWire = bpy.context.user_preferences.addons[__name__].preferences.use_wire
|
||||
useWire = bpy.context.preferences.addons[__name__].preferences.use_wire
|
||||
if self.count == 1:
|
||||
|
||||
if isBrush(actObj) and actObj["BoolTool_FTransform"] == "True":
|
||||
|
@ -1231,7 +1231,7 @@ def update_panels(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -9,7 +9,7 @@ from . import crack_it
|
|||
|
||||
|
||||
def check_object_cell_fracture():
|
||||
if "object_fracture_cell" in bpy.context.user_preferences.addons.keys():
|
||||
if "object_fracture_cell" in bpy.context.preferences.addons.keys():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -414,7 +414,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -67,7 +67,7 @@ def _get_pref_class(mod):
|
|||
|
||||
def get_addon_preferences(name=''):
|
||||
"""Acquisition and registration"""
|
||||
addons = bpy.context.user_preferences.addons
|
||||
addons = bpy.context.preferences.addons
|
||||
if __name__ not in addons: # wm.read_factory_settings()
|
||||
return None
|
||||
addon_prefs = addons[__name__].preferences
|
||||
|
|
|
@ -227,7 +227,7 @@ def on_scene_update(scene):
|
|||
if not ats_poll(context):
|
||||
return
|
||||
|
||||
userpref = context.user_preferences
|
||||
userpref = context.preferences
|
||||
|
||||
settings = scene.ats_settings
|
||||
render = scene.render
|
||||
|
@ -266,7 +266,7 @@ def get_actual_res(render):
|
|||
def get_threads(context, device):
|
||||
render = context.scene.render
|
||||
engine = render.engine
|
||||
userpref = context.user_preferences
|
||||
userpref = context.preferences
|
||||
|
||||
if engine_is_gpu(engine, device, userpref):
|
||||
threads = userpref.addons['cycles'].preferences.get_num_gpu_devices()
|
||||
|
@ -324,7 +324,7 @@ def do_set_tile_size(context):
|
|||
return False
|
||||
|
||||
scene = context.scene
|
||||
userpref = context.user_preferences
|
||||
userpref = context.preferences
|
||||
|
||||
settings = scene.ats_settings
|
||||
render = scene.render
|
||||
|
@ -406,7 +406,7 @@ class SetTileSize(Operator):
|
|||
|
||||
def ui_layout(engine, layout, context):
|
||||
scene = context.scene
|
||||
userpref = context.user_preferences
|
||||
userpref = context.preferences
|
||||
|
||||
settings = scene.ats_settings
|
||||
render = scene.render
|
||||
|
|
|
@ -364,7 +364,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
|||
global_matrix = mathutils.Matrix.Rotation(-pi / 2.0, 4, 'X')
|
||||
comments = scene.pov.comments_enable and not scene.pov.tempfiles_enable
|
||||
linebreaksinlists = scene.pov.list_lf_enable and not scene.pov.tempfiles_enable
|
||||
feature_set = bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray
|
||||
feature_set = bpy.context.preferences.addons[__package__].preferences.branch_feature_set_povray
|
||||
using_uberpov = (feature_set=='uberpov')
|
||||
pov_binary = PovrayRender._locate_binary()
|
||||
|
||||
|
@ -3666,7 +3666,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
|||
|
||||
|
||||
def write_pov_ini(scene, filename_ini, filename_log, filename_pov, filename_image):
|
||||
feature_set = bpy.context.user_preferences.addons[__package__].preferences.branch_feature_set_povray
|
||||
feature_set = bpy.context.preferences.addons[__package__].preferences.branch_feature_set_povray
|
||||
using_uberpov = (feature_set=='uberpov')
|
||||
#scene = bpy.data.scenes[0]
|
||||
render = scene.render
|
||||
|
@ -3745,7 +3745,7 @@ class PovrayRender(bpy.types.RenderEngine):
|
|||
|
||||
@staticmethod
|
||||
def _locate_binary():
|
||||
addon_prefs = bpy.context.user_preferences.addons[__package__].preferences
|
||||
addon_prefs = bpy.context.preferences.addons[__package__].preferences
|
||||
|
||||
# Use the system preference if its set.
|
||||
pov_binary = addon_prefs.filepath_povray
|
||||
|
|
|
@ -245,12 +245,12 @@ for member in dir(properties_particle): # add all "particle" panels from blende
|
|||
del properties_particle
|
||||
|
||||
def check_add_mesh_extra_objects():
|
||||
if "add_mesh_extra_objects" in bpy.context.user_preferences.addons.keys():
|
||||
if "add_mesh_extra_objects" in bpy.context.preferences.addons.keys():
|
||||
return True
|
||||
return False
|
||||
|
||||
def locate_docpath():
|
||||
addon_prefs = bpy.context.user_preferences.addons[__package__].preferences
|
||||
addon_prefs = bpy.context.preferences.addons[__package__].preferences
|
||||
# Use the system preference if its set.
|
||||
pov_documents = addon_prefs.docpath_povray
|
||||
if pov_documents:
|
||||
|
@ -784,7 +784,7 @@ class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel):
|
|||
|
||||
|
||||
def draw_header(self, context):
|
||||
prefs = bpy.context.user_preferences.addons[__package__].preferences
|
||||
prefs = bpy.context.preferences.addons[__package__].preferences
|
||||
scene = context.scene
|
||||
if prefs.branch_feature_set_povray != 'uberpov' and scene.pov.antialias_method == '2':
|
||||
self.layout.prop(scene.pov, "antialias_enable", text="", icon='ERROR')
|
||||
|
@ -794,7 +794,7 @@ class RENDER_PT_povray_antialias(RenderButtonsPanel, bpy.types.Panel):
|
|||
self.layout.prop(scene.pov, "antialias_enable", text="", icon='ALIASED')
|
||||
|
||||
def draw(self, context):
|
||||
prefs = bpy.context.user_preferences.addons[__package__].preferences
|
||||
prefs = bpy.context.preferences.addons[__package__].preferences
|
||||
layout = self.layout
|
||||
scene = context.scene
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'}
|
||||
|
||||
|
||||
|
|
|
@ -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'}
|
||||
|
||||
|
||||
|
|
|
@ -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'}
|
||||
|
|
|
@ -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'}
|
||||
|
||||
###########################
|
||||
|
|
34
rigify/ui.py
34
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'}
|
||||
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class ExtractWavOperator(Operator):
|
|||
|
||||
def execute(self, context):
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
audio_dir = preferences.addons[__package__].preferences.audio_dir
|
||||
|
||||
functions.create_folder(bpy.path.abspath(audio_dir))
|
||||
|
@ -164,7 +164,7 @@ class ExternalAudioSetSyncOperator(Operator):
|
|||
|
||||
def execute(self, context):
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
filename = preferences.addons[__package__].preferences.audio_external_filename
|
||||
|
||||
for strip in context.selected_editable_sequences:
|
||||
|
@ -219,7 +219,7 @@ class ExternalAudioReloadOperator(Operator):
|
|||
return False
|
||||
|
||||
def execute(self, context):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
filename = preferences.addons[__package__].preferences.audio_external_filename
|
||||
|
||||
data = readsyncfile(filename)
|
||||
|
@ -282,7 +282,7 @@ class AudioToolPanel(Panel):
|
|||
def poll(self, context):
|
||||
if context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
if prefs.use_audio_tools:
|
||||
|
@ -295,7 +295,7 @@ class AudioToolPanel(Panel):
|
|||
layout.label(text="", icon="PLAY_AUDIO")
|
||||
|
||||
def draw(self, context):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
strip = functions.act_strip(context)
|
||||
|
@ -348,7 +348,7 @@ class OpenMeterbridgeOperator(Operator):
|
|||
return True
|
||||
|
||||
def execute(self, context):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
command = "meterbridge -t {} 'PulseAudio JACK Sink:front-left' " \
|
||||
|
|
|
@ -19,7 +19,7 @@ proxy_qualities = [
|
|||
|
||||
# functions
|
||||
def createdatamosh(context, strip):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
fileinput = bpy.path.abspath(strip.filepath)
|
||||
|
@ -122,7 +122,7 @@ class CreateDatamosh(Operator):
|
|||
return False
|
||||
|
||||
def execute(self, context):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
strips = functions.get_selected_strips(context)
|
||||
|
||||
|
@ -161,7 +161,7 @@ class CreateGlitchToolPanel(Panel):
|
|||
'SEQUENCER_PREVIEW'}:
|
||||
strip = functions.act_strip(context)
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
if prefs.use_glitch_panel:
|
||||
|
@ -175,7 +175,7 @@ class CreateGlitchToolPanel(Panel):
|
|||
|
||||
def draw(self, context):
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
layout = self.layout
|
||||
|
|
|
@ -43,7 +43,7 @@ class EcoPanel(Panel):
|
|||
if context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
strip = functions.act_strip(context)
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
if prefs.use_eco_tools:
|
||||
|
@ -59,7 +59,7 @@ class EcoPanel(Panel):
|
|||
strip = functions.act_strip(context)
|
||||
seq_type = strip.type
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
if seq_type in ('MOVIE', 'IMAGE', 'META', 'MOVIECLIP', 'SCENE'):
|
||||
|
@ -95,7 +95,7 @@ class OBJECT_OT_EcoOperator(Operator):
|
|||
def execute(self, context):
|
||||
active_strip = functions.act_strip(context)
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
eco = prefs.eco_value
|
||||
|
|
|
@ -20,7 +20,7 @@ proxy_qualities = [
|
|||
|
||||
# Functions
|
||||
def setup_proxy(context, strip, size):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
# set up proxy settings
|
||||
|
@ -66,7 +66,7 @@ def create_proxy(context, strip, size, res):
|
|||
div = 4 / size
|
||||
newres = (int(int(res[0]) / div), int(int(res[1]) / div))
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
proxy_dir = preferences.addons[__package__].preferences.proxy_dir
|
||||
scripts = preferences.addons[__package__].preferences.proxy_scripts
|
||||
ffmpeg_command = preferences.addons[__package__].preferences.ffmpeg_command
|
||||
|
@ -156,7 +156,7 @@ class CreateProxyOperator(Operator):
|
|||
return False
|
||||
|
||||
def execute(self, context):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
proxy_scripts_path = preferences.addons[__package__].preferences.proxy_scripts_path
|
||||
|
||||
for strip in context.selected_editable_sequences:
|
||||
|
@ -255,7 +255,7 @@ class CreateProxyToolPanel(Panel):
|
|||
'SEQUENCER_PREVIEW'}:
|
||||
strip = functions.act_strip(context)
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
if prefs.use_proxy_tools:
|
||||
|
@ -269,7 +269,7 @@ class CreateProxyToolPanel(Panel):
|
|||
|
||||
def draw(self, context):
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
layout = self.layout
|
||||
|
|
|
@ -43,7 +43,7 @@ class RandomScratchOperator(Operator):
|
|||
return False
|
||||
|
||||
def invoke(self, context, event):
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
random_frames = preferences.addons[__package__].preferences.random_frames
|
||||
|
||||
sce = context.scene
|
||||
|
@ -114,7 +114,7 @@ class RandomEditorPanel(Panel):
|
|||
'SEQUENCER_PREVIEW'}:
|
||||
strip = functions.act_strip(context)
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
if prefs.use_random_editor:
|
||||
|
@ -128,7 +128,7 @@ class RandomEditorPanel(Panel):
|
|||
|
||||
def draw(self, context):
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
layout = self.layout
|
||||
|
|
|
@ -215,7 +215,7 @@ class ExifInfoPanel(Panel):
|
|||
if context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
strip = functions.act_strip(context)
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
if scn and scn.sequence_editor and scn.sequence_editor.active_strip:
|
||||
|
|
|
@ -203,7 +203,7 @@ class JumptoCut(Panel):
|
|||
def poll(self, context):
|
||||
if context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
scn = context.scene
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
if scn and scn.sequence_editor:
|
||||
if prefs.use_jumptocut:
|
||||
|
@ -219,7 +219,7 @@ class JumptoCut(Panel):
|
|||
scn = context.scene
|
||||
strip = functions.act_strip(context)
|
||||
|
||||
preferences = context.user_preferences
|
||||
preferences = context.preferences
|
||||
prefs = preferences.addons[__package__].preferences
|
||||
|
||||
layout = self.layout
|
||||
|
@ -265,7 +265,7 @@ class JumptoCut(Panel):
|
|||
# hide the play-reversed button
|
||||
# since JACK transport doesn't support reversed playback
|
||||
if scn.sync_mode == 'AUDIO_SYNC' and \
|
||||
context.user_preferences.system.audio_device == 'JACK':
|
||||
context.preferences.system.audio_device == 'JACK':
|
||||
sub = sub_row.row(align=True)
|
||||
sub.scale_x = 2.0
|
||||
sub.operator("screen.animation_play", text="", icon='PLAY')
|
||||
|
|
|
@ -326,7 +326,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -36,7 +36,7 @@ def get_brush_link(context, types="brush"):
|
|||
# Addon settings
|
||||
def addon_settings(lists=True):
|
||||
# separate function just for more convenience
|
||||
addon = bpy.context.user_preferences.addons[get_addon_name]
|
||||
addon = bpy.context.preferences.addons[get_addon_name]
|
||||
colum_n = addon.preferences.column_set if addon else 1
|
||||
use_list = addon.preferences.use_brushes_menu_type
|
||||
|
||||
|
|
|
@ -595,7 +595,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -81,7 +81,7 @@ def _get_pref_class(mod):
|
|||
|
||||
def get_addon_preferences(name=''):
|
||||
"""Acquisition and registration"""
|
||||
addons = bpy.context.user_preferences.addons
|
||||
addons = bpy.context.preferences.addons
|
||||
if __name__ not in addons: # wm.read_factory_settings()
|
||||
return None
|
||||
addon_prefs = addons[__name__].preferences
|
||||
|
|
|
@ -2945,7 +2945,7 @@ class SnapCursSelToCenter(Operator):
|
|||
|
||||
# Draw Separator #
|
||||
def UseSeparator(operator, context):
|
||||
useSep = bpy.context.user_preferences.addons[__name__].preferences.use_separators
|
||||
useSep = bpy.context.preferences.addons[__name__].preferences.use_separators
|
||||
if useSep:
|
||||
operator.layout.separator()
|
||||
|
||||
|
@ -2953,7 +2953,7 @@ def UseSeparator(operator, context):
|
|||
# Use compact brushes menus #
|
||||
def UseBrushesLists():
|
||||
# separate function just for more convenience
|
||||
useLists = bpy.context.user_preferences.addons[__name__].preferences.use_brushes_lists
|
||||
useLists = bpy.context.preferences.addons[__name__].preferences.use_brushes_lists
|
||||
|
||||
return bool(useLists)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import bpy
|
|||
# Utility function get preferences setting for exporters
|
||||
def get_preferences():
|
||||
# replace the key if the add-on name changes
|
||||
addon = bpy.context.user_preferences.addons[__package__]
|
||||
addon = bpy.context.preferences.addons[__package__]
|
||||
show_warn = (addon.preferences.show_exporters if addon else False)
|
||||
|
||||
return show_warn
|
||||
|
|
|
@ -25,7 +25,7 @@ from bpy.types import (
|
|||
def get_preferences_timer():
|
||||
# replace the key if the add-on name changes
|
||||
# TODO: expose refresh rate to ui???
|
||||
addon = bpy.context.user_preferences.addons[__package__]
|
||||
addon = bpy.context.preferences.addons[__package__]
|
||||
timer_update = (addon.preferences.view_3d_update_rate if addon else False)
|
||||
|
||||
return timer_update
|
||||
|
@ -49,12 +49,12 @@ def _draw_callback_px(self, context):
|
|||
r_height = context.region.height
|
||||
font_id = 0 # TODO: need to find out how best to get font_id
|
||||
|
||||
blf.size(font_id, 11, context.user_preferences.system.dpi)
|
||||
blf.size(font_id, 11, context.preferences.system.dpi)
|
||||
text_size = blf.dimensions(0, self.view_name)
|
||||
|
||||
# compute the text location
|
||||
text_location = 0
|
||||
overlap = context.user_preferences.system.use_region_overlap
|
||||
overlap = context.preferences.system.use_region_overlap
|
||||
if overlap:
|
||||
for region in context.area.regions:
|
||||
if region.type == "UI":
|
||||
|
|
|
@ -605,7 +605,7 @@ def update_panel(self, context):
|
|||
bpy.utils.unregister_class(panel)
|
||||
|
||||
for panel in panels:
|
||||
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
|
||||
panel.bl_category = context.preferences.addons[__name__].preferences.category
|
||||
bpy.utils.register_class(panel)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -62,8 +62,8 @@ def register():
|
|||
|
||||
# Init addon's preferences (unfortunately, as we are using an external storage for the properties,
|
||||
# the load/save user preferences process has no effect on them :( ).
|
||||
if __name__ in bpy.context.user_preferences.addons:
|
||||
pref = bpy.context.user_preferences.addons[__name__].preferences
|
||||
if __name__ in bpy.context.preferences.addons:
|
||||
pref = bpy.context.preferences.addons[__name__].preferences
|
||||
import os
|
||||
if os.path.isfile(pref.persistent_data_path):
|
||||
pref._settings.load(pref.persistent_data_path, reset=True)
|
||||
|
|
|
@ -181,7 +181,7 @@ class addon_updater_check_now(bpy.types.Operator):
|
|||
return {'CANCELLED'}
|
||||
|
||||
# apply the UI settings
|
||||
settings = context.user_preferences.addons[__package__].preferences
|
||||
settings = context.preferences.addons[__package__].preferences
|
||||
updater.set_check_interval(enable=settings.auto_check_update,
|
||||
months=settings.updater_intrval_months,
|
||||
days=settings.updater_intrval_days,
|
||||
|
@ -670,7 +670,7 @@ def check_for_update_background():
|
|||
return
|
||||
|
||||
# apply the UI settings
|
||||
addon_prefs = bpy.context.user_preferences.addons.get(__package__, None)
|
||||
addon_prefs = bpy.context.preferences.addons.get(__package__, None)
|
||||
if not addon_prefs:
|
||||
return
|
||||
settings = addon_prefs.preferences
|
||||
|
@ -701,7 +701,7 @@ def check_for_update_nonthreaded(self, context):
|
|||
# only check if it's ready, ie after the time interval specified
|
||||
# should be the async wrapper call here
|
||||
|
||||
settings = context.user_preferences.addons[__package__].preferences
|
||||
settings = context.preferences.addons[__package__].preferences
|
||||
updater.set_check_interval(enable=settings.auto_check_update,
|
||||
months=settings.updater_intrval_months,
|
||||
days=settings.updater_intrval_days,
|
||||
|
@ -778,7 +778,7 @@ def update_notice_box_ui(self, context):
|
|||
|
||||
if updater.update_ready != True: return
|
||||
|
||||
settings = context.user_preferences.addons[__package__].preferences
|
||||
settings = context.preferences.addons[__package__].preferences
|
||||
layout = self.layout
|
||||
box = layout.box()
|
||||
col = box.column(align=True)
|
||||
|
@ -818,7 +818,7 @@ def update_settings_ui(self, context, element=None):
|
|||
box.label(updater.error_msg)
|
||||
return
|
||||
|
||||
settings = context.user_preferences.addons[__package__].preferences
|
||||
settings = context.preferences.addons[__package__].preferences
|
||||
|
||||
# auto-update settings
|
||||
box.label("Updater Settings")
|
||||
|
@ -975,7 +975,7 @@ def update_settings_ui_condensed(self, context, element=None):
|
|||
row.label(updater.error_msg)
|
||||
return
|
||||
|
||||
settings = context.user_preferences.addons[__package__].preferences
|
||||
settings = context.preferences.addons[__package__].preferences
|
||||
|
||||
# special case to tell user to restart blender, if set that way
|
||||
if updater.auto_reload_post_update == False:
|
||||
|
|
|
@ -132,7 +132,7 @@ class MoveUVImpl():
|
|||
bmesh.update_edit_mesh(obj.data)
|
||||
|
||||
# check mouse preference
|
||||
if context.user_preferences.inputs.select_mouse == 'RIGHT':
|
||||
if context.preferences.inputs.select_mouse == 'RIGHT':
|
||||
confirm_btn = 'LEFTMOUSE'
|
||||
cancel_btn = 'RIGHTMOUSE'
|
||||
else:
|
||||
|
|
|
@ -63,7 +63,7 @@ def get_canvas(context, magnitude):
|
|||
Get canvas to be renderred texture
|
||||
"""
|
||||
sc = context.scene
|
||||
prefs = context.user_preferences.addons["uv_magic_uv"].preferences
|
||||
prefs = context.preferences.addons["uv_magic_uv"].preferences
|
||||
|
||||
region_w = context.region.width
|
||||
region_h = context.region.height
|
||||
|
|
|
@ -428,7 +428,7 @@ class StateNone(StateBase):
|
|||
"""
|
||||
Update state
|
||||
"""
|
||||
prefs = context.user_preferences.addons["uv_magic_uv"].preferences
|
||||
prefs = context.preferences.addons["uv_magic_uv"].preferences
|
||||
cp_react_size = prefs.uv_bounding_box_cp_react_size
|
||||
is_uscaling = context.scene.muv_uv_bounding_box_uniform_scaling
|
||||
if (event.type == 'LEFTMOUSE') and (event.value == 'PRESS'):
|
||||
|
@ -660,7 +660,7 @@ class MUV_OT_UVBoundingBox(bpy.types.Operator):
|
|||
"""
|
||||
Draw control point
|
||||
"""
|
||||
prefs = context.user_preferences.addons["uv_magic_uv"].preferences
|
||||
prefs = context.preferences.addons["uv_magic_uv"].preferences
|
||||
cp_size = prefs.uv_bounding_box_cp_size
|
||||
offset = cp_size / 2
|
||||
verts = [
|
||||
|
|
|
@ -169,7 +169,7 @@ class MUV_OT_UVInspection_Render(bpy.types.Operator):
|
|||
def draw(_, context):
|
||||
sc = context.scene
|
||||
props = sc.muv_props.uv_inspection
|
||||
prefs = context.user_preferences.addons["uv_magic_uv"].preferences
|
||||
prefs = context.preferences.addons["uv_magic_uv"].preferences
|
||||
|
||||
if not MUV_OT_UVInspection_Render.is_running(context):
|
||||
return
|
||||
|
|
|
@ -205,7 +205,7 @@ class MUV_OT_UVSculpt(bpy.types.Operator):
|
|||
@classmethod
|
||||
def draw_brush(cls, obj, context):
|
||||
sc = context.scene
|
||||
prefs = context.user_preferences.addons["uv_magic_uv"].preferences
|
||||
prefs = context.preferences.addons["uv_magic_uv"].preferences
|
||||
|
||||
num_segment = 180
|
||||
theta = 2 * pi / num_segment
|
||||
|
|
Loading…
Reference in New Issue