Cleanup: style

This commit is contained in:
Campbell Barton
2019-04-09 23:16:11 +10:00
parent 32f3d47990
commit e49da07184
10 changed files with 23 additions and 17 deletions

View File

@@ -35,8 +35,10 @@ def load_handler(dummy):
bpy.ops.mesh.subdivide(number_cuts=6, smoothness=1.0)
bpy.ops.object.mode_set(mode='SCULPT')
def register():
bpy.app.handlers.load_factory_startup_post.append(load_handler)
def unregister():
bpy.app.handlers.load_factory_startup_post.remove(load_handler)

View File

@@ -31,8 +31,10 @@ def load_handler(dummy):
params = space.params
params.use_filter_folder = True
def register():
bpy.app.handlers.load_factory_startup_post.append(load_handler)
def unregister():
bpy.app.handlers.load_factory_startup_post.remove(load_handler)

View File

@@ -324,15 +324,15 @@ class ShapeTransfer(Operator):
('OFFSET',
"Offset",
"Apply the relative positional offset",
),
),
('RELATIVE_FACE',
"Relative Face",
"Calculate relative position (using faces)",
),
),
('RELATIVE_EDGE',
"Relative Edge",
"Calculate relative position (using edges)",
),
),
),
name="Transformation Mode",
description="Relative shape positions to the new shape method",

View File

@@ -46,11 +46,13 @@ def object_ensure_material(obj, mat_name):
obj.data.materials.append(mat)
return mat
class ObjectModeOperator:
@classmethod
def poll(cls, context):
return context.mode == 'OBJECT'
class QuickFur(ObjectModeOperator, Operator):
bl_idname = "object.quick_fur"
bl_label = "Quick Fur"
@@ -507,10 +509,11 @@ class QuickFluid(ObjectModeOperator, Operator):
# and scale with initial velocity
v = 0.5 * self.initial_velocity
obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, -1.0)) + v
obj.scale = (0.5 * (max_co - min_co) +
Vector((1.0, 1.0, 2.0)) +
Vector((abs(v[0]), abs(v[1]), abs(v[2])))
)
obj.scale = (
0.5 * (max_co - min_co) +
Vector((1.0, 1.0, 2.0)) +
Vector((abs(v[0]), abs(v[1]), abs(v[2])))
)
# setup smoke domain
bpy.ops.object.modifier_add(type='FLUID_SIMULATION')

View File

@@ -583,10 +583,10 @@ def packIslands(islandList):
w, h = maxx - minx, maxy - miny
if USER_ISLAND_MARGIN:
minx -= USER_ISLAND_MARGIN * w/2
miny -= USER_ISLAND_MARGIN * h/2
maxx += USER_ISLAND_MARGIN * w/2
maxy += USER_ISLAND_MARGIN * h/2
minx -= USER_ISLAND_MARGIN * w / 2
miny -= USER_ISLAND_MARGIN * h / 2
maxx += USER_ISLAND_MARGIN * w / 2
maxy += USER_ISLAND_MARGIN * h / 2
# recalc width and height
w, h = maxx - minx, maxy - miny

View File

@@ -1423,7 +1423,6 @@ class WM_OT_sysinfo(Operator):
return {'RUNNING_MODAL'}
class WM_OT_operator_cheat_sheet(Operator):
"""List all the Operators in a text-block, useful for scripting"""
bl_idname = "wm.operator_cheat_sheet"
@@ -1484,7 +1483,6 @@ class WM_OT_owner_disable(Operator):
return {'FINISHED'}
class WM_OT_tool_set_by_id(Operator):
"""Set the tool by name (for keymaps)"""
bl_idname = "wm.tool_set_by_id"
@@ -1666,7 +1664,7 @@ class WM_MT_splash(Menu):
# Draw setup screen if no preferences have been saved yet.
import os
userconfig_path = bpy.utils.user_resource('CONFIG');
userconfig_path = bpy.utils.user_resource('CONFIG')
userdef_path = os.path.join(userconfig_path, "userpref.blend")
if not os.path.isfile(userdef_path):

View File

@@ -26,6 +26,7 @@ from .properties_animviz import (
MotionPathButtonsPanel_display,
)
class ArmatureButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

View File

@@ -386,6 +386,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
col = flow.column()
col.prop(cam, "show_name", text="Name")
class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
bl_label = "Composition Guides"
bl_parent_id = "DATA_PT_camera_display"

View File

@@ -121,15 +121,13 @@ class _defs_view3d_generic:
else:
kmi_add = None
kmi_remove = None
return (
tip_(
return tip_(
"Measure distance and angles.\n"
"\u2022 {} anywhere for new measurement.\n"
"\u2022 Drag ruler segment to measure an angle.\n"
"\u2022 {} to remove the active ruler.\n"
"\u2022 Ctrl while dragging to snap.\n"
"\u2022 Shift while dragging to measure surface thickness."
)
).format(
kmi_to_string_or_none(kmi_add),
kmi_to_string_or_none(kmi_remove),

View File

@@ -5862,6 +5862,7 @@ class VIEW3D_PT_sculpt_context_menu(Panel):
if capabilities.has_height:
layout.prop(brush, "height", slider=True, text="Height")
class TOPBAR_PT_gpencil_materials(GreasePencilMaterialsPanel, Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'