diff options
Diffstat (limited to 'release/scripts/startup/bl_ui')
54 files changed, 1403 insertions, 185 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 2389be6787d..5b609605cee 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -23,8 +23,7 @@ # support reloading sub-modules if "bpy" in locals(): from importlib import reload - for val in _modules_loaded: - reload(val) + _modules_loaded[:] = [reload(val) for val in _modules_loaded] del reload _modules = [ @@ -94,7 +93,10 @@ del _namespace def register(): - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for mod in _modules_loaded: + for cls in mod.classes: + register_class(cls) # space_userprefs.py from bpy.props import StringProperty, EnumProperty @@ -143,8 +145,11 @@ def register(): def unregister(): - bpy.utils.unregister_module(__name__) - + from bpy.utils import unregister_class + for mod in reversed(_modules_loaded): + for cls in reversed(mod.classes): + if cls.is_registered: + unregister_class(cls) # Define a default UIList, when a list does not need any custom drawing... # Keep in sync with its #defined name in UI_interface.h diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py index 046b5eb2aa5..84bae18dd6f 100644 --- a/release/scripts/startup/bl_ui/properties_animviz.py +++ b/release/scripts/startup/bl_ui/properties_animviz.py @@ -139,6 +139,11 @@ class OnionSkinButtonsPanel: col.label(text="Display:") col.prop(arm, "show_only_ghost_selected", text="Selected Only") + +classes = ( +) + if __name__ == "__main__": # only for live edit. - import bpy - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index cb5f1595ff3..00892d5f85b 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -941,5 +941,12 @@ class BONE_PT_constraints(ConstraintButtonsPanel, Panel): for con in context.pose_bone.constraints: self.draw_constraint(context, con) +classes = ( + OBJECT_PT_constraints, + BONE_PT_constraints, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 8261f0c7770..a2ecf984eb5 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -328,5 +328,21 @@ class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.Armature + +classes = ( + DATA_PT_context_arm, + DATA_PT_skeleton, + DATA_PT_display, + DATA_PT_bone_group_specials, + DATA_PT_bone_groups, + DATA_PT_pose_library, + DATA_PT_ghost, + DATA_PT_iksolver_itasc, + DATA_PT_motion_paths, + DATA_PT_custom_props_arm, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index 3a5475514c9..132c355ed99 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -449,5 +449,20 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel): else: return "active_bone" + +classes = ( + BONE_PT_context_bone, + BONE_PT_transform, + BONE_PT_transform_locks, + BONE_PT_curved, + BONE_PT_relations, + BONE_PT_display, + BONE_PT_inverse_kinematics, + BONE_PT_deform, + BONE_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index c6fa77aec00..101062095c4 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -325,5 +325,20 @@ def draw_display_safe_settings(layout, safe_data, settings): col.prop(safe_data, "action_center", slider=True) +classes = ( + CAMERA_MT_presets, + SAFE_AREAS_MT_presets, + DATA_PT_context_camera, + DATA_PT_lens, + DATA_PT_camera, + DATA_PT_camera_stereoscopy, + DATA_PT_camera_dof, + DATA_PT_camera_display, + DATA_PT_camera_safe_areas, + DATA_PT_custom_props_camera, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 33af812b6c4..ac1eb9505a6 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -431,5 +431,21 @@ class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.Curve + +classes = ( + DATA_PT_context_curve, + DATA_PT_shape_curve, + DATA_PT_curve_texture_space, + DATA_PT_geometry_curve, + DATA_PT_pathanim, + DATA_PT_active_spline, + DATA_PT_font, + DATA_PT_paragraph, + DATA_PT_text_boxes, + DATA_PT_custom_props_curve, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py index a752d3517de..c66ff87ecbd 100644 --- a/release/scripts/startup/bl_ui/properties_data_empty.py +++ b/release/scripts/startup/bl_ui/properties_data_empty.py @@ -55,5 +55,12 @@ class DATA_PT_empty(DataButtonsPanel, Panel): layout.prop(ob, "empty_draw_size", text="Size") + +classes = ( + DATA_PT_empty, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 30cd39d2e2f..f913ef51381 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -394,5 +394,21 @@ class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.Lamp + +classes = ( + LAMP_MT_sunsky_presets, + DATA_PT_context_lamp, + DATA_PT_preview, + DATA_PT_lamp, + DATA_PT_sunsky, + DATA_PT_shadow, + DATA_PT_area, + DATA_PT_spot, + DATA_PT_falloff_curve, + DATA_PT_custom_props_lamp, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_lattice.py b/release/scripts/startup/bl_ui/properties_data_lattice.py index cbfa6961e8c..4b3fd48c195 100644 --- a/release/scripts/startup/bl_ui/properties_data_lattice.py +++ b/release/scripts/startup/bl_ui/properties_data_lattice.py @@ -82,5 +82,14 @@ class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.Lattice + +classes = ( + DATA_PT_context_lattice, + DATA_PT_lattice, + DATA_PT_custom_props_lattice, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 59907692fe0..de55b4152ba 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -392,5 +392,24 @@ class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel): _property_type = bpy.types.Mesh +classes = ( + MESH_MT_vertex_group_specials, + MESH_MT_shape_key_specials, + MESH_UL_vgroups, + MESH_UL_shape_keys, + MESH_UL_uvmaps_vcols, + DATA_PT_context_mesh, + DATA_PT_normals, + DATA_PT_texture_space, + DATA_PT_vertex_groups, + DATA_PT_shape_keys, + DATA_PT_uv_texture, + DATA_PT_vertex_colors, + DATA_PT_customdata, + DATA_PT_custom_props_mesh, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_metaball.py b/release/scripts/startup/bl_ui/properties_data_metaball.py index b42258c386a..a621dc7210f 100644 --- a/release/scripts/startup/bl_ui/properties_data_metaball.py +++ b/release/scripts/startup/bl_ui/properties_data_metaball.py @@ -135,5 +135,16 @@ class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.MetaBall + +classes = ( + DATA_PT_context_metaball, + DATA_PT_metaball, + DATA_PT_mball_texture_space, + DATA_PT_metaball_element, + DATA_PT_custom_props_metaball, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index d66fb08bcd6..a37d61dd0af 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -569,6 +569,14 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "use_mirror_u", text="U") col.prop(md, "use_mirror_v", text="V") + col = layout.column(align=True) + + if md.use_mirror_u: + col.prop(md, "mirror_offset_u") + + if md.use_mirror_v: + col.prop(md, "mirror_offset_v") + col = layout.column() if md.use_mirror_merge is True: @@ -951,6 +959,23 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def SURFACE(self, layout, ob, md): layout.label(text="Settings are inside the Physics tab") + def SURFACE_DEFORM(self, layout, ob, md): + col = layout.column() + col.active = not md.is_bound + + col.prop(md, "target") + col.prop(md, "falloff") + + layout.separator() + + col = layout.column() + col.active = md.target is not None + + if md.is_bound: + col.operator("object.surfacedeform_bind", text="Unbind") + else: + col.operator("object.surfacedeform_bind", text="Bind") + def UV_PROJECT(self, layout, ob, md): split = layout.split() @@ -1320,7 +1345,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): row.prop(md, "thickness_vertex_group", text="Factor") col.prop(md, "use_crease", text="Crease Edges") - col.prop(md, "crease_weight", text="Crease Weight") + row = col.row() + row.active = md.use_crease + row.prop(md, "crease_weight", text="Crease Weight") col = split.column() @@ -1503,5 +1530,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind") +classes = ( + DATA_PT_modifiers, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 5ed0f8c3265..eecb2690302 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -121,5 +121,16 @@ class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel): _context_path = "object.data" _property_type = bpy.types.Speaker + +classes = ( + DATA_PT_context_speaker, + DATA_PT_speaker, + DATA_PT_distance, + DATA_PT_cone, + DATA_PT_custom_props_speaker, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index e0620447185..9c5be7624e0 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -828,5 +828,17 @@ class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel): row.prop(mat, "line_priority", text="Priority") +classes = ( + RENDER_PT_freestyle, + RENDERLAYER_UL_linesets, + RENDER_MT_lineset_specials, + RENDERLAYER_PT_freestyle, + RENDERLAYER_PT_freestyle_lineset, + RENDERLAYER_PT_freestyle_linestyle, + MATERIAL_PT_freestyle_line, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index ec061370fe5..46b34373aa5 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -852,5 +852,30 @@ class OBJECT_PT_levels_of_detail(ObjectButtonsPanel, Panel): row.menu("OBJECT_MT_lod_tools", text="", icon='TRIA_DOWN') +classes = ( + PHYSICS_PT_game_physics, + PHYSICS_PT_game_collision_bounds, + PHYSICS_PT_game_obstacles, + RENDER_PT_embedded, + RENDER_PT_game_player, + RENDER_PT_game_stereo, + RENDER_PT_game_shading, + RENDER_PT_game_system, + RENDER_PT_game_display, + SCENE_PT_game_physics, + SCENE_PT_game_physics_obstacles, + SCENE_PT_game_navmesh, + SCENE_PT_game_hysteresis, + WORLD_PT_game_context_world, + WORLD_PT_game_world, + WORLD_PT_game_environment_lighting, + WORLD_PT_game_mist, + DATA_PT_shadow_game, + OBJECT_MT_lod_tools, + OBJECT_PT_levels_of_detail, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 4529c127839..42e8d5272b3 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -1155,3 +1155,24 @@ class GreasePencilToolsPanel: layout.separator() gpencil_stroke_placement_settings(context, layout) + + +classes = ( + GPENCIL_PIE_tool_palette, + GPENCIL_PIE_settings_palette, + GPENCIL_PIE_tools_more, + GPENCIL_PIE_sculpt, + GPENCIL_MT_snap, + GPENCIL_MT_gpencil_edit_specials, + GPENCIL_UL_brush, + GPENCIL_UL_palettecolor, + GPENCIL_UL_layer, + GPENCIL_MT_layer_specials, + GPENCIL_MT_brush_specials, + GPENCIL_MT_palettecolor_specials, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index f4836da50bc..a7a67130f2f 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -392,5 +392,17 @@ class MASK_MT_select(Menu): layout.operator("mask.select_all", text="Inverse").action = 'INVERT' layout.operator("mask.select_linked", text="Select Linked") + +classes = ( + MASK_UL_layers, + MASK_MT_mask, + MASK_MT_visibility, + MASK_MT_transform, + MASK_MT_animation, + MASK_MT_select, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index d916007ea41..06ae1847d06 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -71,6 +71,7 @@ class MATERIAL_MT_specials(Menu): class MATERIAL_UL_matslots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # assert(isinstance(item, bpy.types.MaterialSlot) # ob = data @@ -1052,5 +1053,38 @@ class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel): _context_path = "material" _property_type = bpy.types.Material + +classes = ( + MATERIAL_MT_sss_presets, + MATERIAL_MT_specials, + MATERIAL_UL_matslots, + MATERIAL_PT_context_material, + MATERIAL_PT_preview, + MATERIAL_PT_pipeline, + MATERIAL_PT_diffuse, + MATERIAL_PT_specular, + MATERIAL_PT_shading, + MATERIAL_PT_transp, + MATERIAL_PT_mirror, + MATERIAL_PT_sss, + MATERIAL_PT_halo, + MATERIAL_PT_flare, + MATERIAL_PT_game_settings, + MATERIAL_PT_physics, + MATERIAL_PT_strand, + MATERIAL_PT_options, + MATERIAL_PT_shadow, + MATERIAL_PT_transp_game, + MATERIAL_PT_volume_density, + MATERIAL_PT_volume_shading, + MATERIAL_PT_volume_lighting, + MATERIAL_PT_volume_transp, + MATERIAL_PT_volume_integration, + MATERIAL_PT_volume_options, + MATERIAL_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 3ff7a248c60..d7e18f81232 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -152,6 +152,33 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel): sub.active = (parent is not None) +class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): + bl_label = "Relations Extras" + bl_options = {'DEFAULT_CLOSED'} + + def draw(self, context): + layout = self.layout + + ob = context.object + + split = layout.split() + + if context.scene.render.engine != 'BLENDER_GAME': + col = split.column() + col.label(text="Tracking Axes:") + col.prop(ob, "track_axis", text="Axis") + col.prop(ob, "up_axis", text="Up Axis") + + col = split.column() + col.prop(ob, "use_slow_parent") + row = col.row() + row.active = ((ob.parent is not None) and (ob.use_slow_parent)) + row.prop(ob, "slow_parent_offset", text="Offset") + + layout.prop(ob, "use_extra_recalc_object") + layout.prop(ob, "use_extra_recalc_data") + + class GROUP_MT_specials(Menu): bl_label = "Group Specials" @@ -296,33 +323,6 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): layout.prop(ob, "dupli_group", text="Group") -class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): - bl_label = "Relations Extras" - bl_options = {'DEFAULT_CLOSED'} - - def draw(self, context): - layout = self.layout - - ob = context.object - - split = layout.split() - - if context.scene.render.engine != 'BLENDER_GAME': - col = split.column() - col.label(text="Tracking Axes:") - col.prop(ob, "track_axis", text="Axis") - col.prop(ob, "up_axis", text="Up Axis") - - col = split.column() - col.prop(ob, "use_slow_parent") - row = col.row() - row.active = ((ob.parent is not None) and (ob.use_slow_parent)) - row.prop(ob, "slow_parent_offset", text="Offset") - - layout.prop(ob, "use_extra_recalc_object") - layout.prop(ob, "use_extra_recalc_data") - - from bl_ui.properties_animviz import ( MotionPathButtonsPanel, OnionSkinButtonsPanel, @@ -366,5 +366,23 @@ class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel): _context_path = "object" _property_type = bpy.types.Object + +classes = ( + OBJECT_PT_context_object, + OBJECT_PT_transform, + OBJECT_PT_delta_transform, + OBJECT_PT_transform_locks, + OBJECT_PT_relations, + OBJECT_PT_relations_extras, + GROUP_MT_specials, + OBJECT_PT_groups, + OBJECT_PT_display, + OBJECT_PT_duplication, + OBJECT_PT_motion_paths, + OBJECT_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 09a3a19cbce..dfd20d90ec4 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -309,3 +309,13 @@ def brush_mask_texture_settings(layout, brush): split = layout.split() split.prop(mask_tex_slot, "offset") split.prop(mask_tex_slot, "scale") + + +classes = ( + VIEW3D_MT_tools_projectpaint_clone, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 29fc56c3fad..2c27c68ed9d 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -23,11 +23,11 @@ from rna_prop_ui import PropertyPanel from bpy.app.translations import pgettext_iface as iface_ from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - basic_force_field_settings_ui, - basic_force_field_falloff_ui, - ) + point_cache_ui, + effector_weights_ui, + basic_force_field_settings_ui, + basic_force_field_falloff_ui, +) def particle_panel_enabled(context, psys): @@ -108,6 +108,7 @@ def find_modifier(ob, psys): class PARTICLE_UL_particle_systems(bpy.types.UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag): ob = data psys = item @@ -117,8 +118,10 @@ class PARTICLE_UL_particle_systems(bpy.types.UIList): layout.prop(psys, "name", text="", emboss=False, icon_value=icon) if md: - layout.prop(md, "show_render", emboss=False, icon_only=True, icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON') - layout.prop(md, "show_viewport", emboss=False, icon_only=True, icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON') + layout.prop(md, "show_render", emboss=False, icon_only=True, + icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON') + layout.prop(md, "show_viewport", emboss=False, icon_only=True, + icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON') elif self.layout_type == 'GRID': layout.alignment = 'CENTER' @@ -401,7 +404,8 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): label = "ERROR" icon = 'ERROR' box.label(label, icon=icon) - box.label("Iterations: %d .. %d (avg. %d)" % (result.min_iterations, result.max_iterations, result.avg_iterations)) + box.label("Iterations: %d .. %d (avg. %d)" % + (result.min_iterations, result.max_iterations, result.avg_iterations)) box.label("Error: %.5f .. %.5f (avg. %.5f)" % (result.min_error, result.max_error, result.avg_error)) @@ -423,7 +427,12 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): phystype = psys.settings.physics_type if phystype == 'NO' or phystype == 'KEYED': return False - return (psys.settings.type in {'EMITTER', 'REACTOR'} or (psys.settings.type == 'HAIR' and (psys.use_hair_dynamics or psys.point_cache.is_baked))) and engine in cls.COMPAT_ENGINES + return ( + (psys.settings.type in {'EMITTER', 'REACTOR'} or + (psys.settings.type == 'HAIR' and + (psys.use_hair_dynamics or psys.point_cache.is_baked))) and + engine in cls.COMPAT_ENGINES + ) def draw(self, context): psys = context.particle_system @@ -743,7 +752,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): layout.label(text="Fluid interaction:") row = layout.row() - row.template_list("UI_UL_list", "particle_targets", psys, "targets", psys, "active_particle_target_index", rows=4) + row.template_list("UI_UL_list", "particle_targets", psys, "targets", + psys, "active_particle_target_index", rows=4) col = row.column() sub = col.row() @@ -760,7 +770,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): row = layout.row() if part.physics_type == 'KEYED': col = row.column() - #doesn't work yet + # doesn't work yet #col.alert = key.valid col.prop(key, "object", text="") col.prop(key, "system", text="System") @@ -770,7 +780,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): col.prop(key, "duration") elif part.physics_type == 'BOIDS': sub = row.row() - #doesn't work yet + # doesn't work yet #sub.alert = key.valid sub.prop(key, "object", text="") sub.prop(key, "system", text="System") @@ -778,7 +788,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): layout.prop(key, "alliance", expand=True) elif part.physics_type == 'FLUID': sub = row.row() - #doesn't work yet + # doesn't work yet #sub.alert = key.valid sub.prop(key, "object", text="") sub.prop(key, "system", text="System") @@ -831,7 +841,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): row.label(text="") row = layout.row() - row.template_list("UI_UL_list", "particle_boids_rules", state, "rules", state, "active_boid_rule_index", rows=4) + row.template_list("UI_UL_list", "particle_boids_rules", state, + "rules", state, "active_boid_rule_index", rows=4) col = row.column() sub = col.row() @@ -848,7 +859,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): if rule: row = layout.row() row.prop(rule, "name", text="") - #somebody make nice icons for boids here please! -jahka + # somebody make nice icons for boids here please! -jahka row.prop(rule, "use_in_air", icon='TRIA_UP', text="") row.prop(rule, "use_on_land", icon='TRIA_DOWN', text="") @@ -1404,5 +1415,29 @@ class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel): _context_path = "particle_system.settings" _property_type = bpy.types.ParticleSettings + +classes = ( + PARTICLE_MT_specials, + PARTICLE_MT_hair_dynamics_presets, + PARTICLE_UL_particle_systems, + PARTICLE_PT_context_particles, + PARTICLE_PT_emission, + PARTICLE_PT_hair_dynamics, + PARTICLE_PT_cache, + PARTICLE_PT_velocity, + PARTICLE_PT_rotation, + PARTICLE_PT_physics, + PARTICLE_PT_boidbrain, + PARTICLE_PT_render, + PARTICLE_PT_draw, + PARTICLE_PT_children, + PARTICLE_PT_field_weights, + PARTICLE_PT_force_fields, + PARTICLE_PT_vertexgroups, + PARTICLE_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 3ebf2691b4c..0a7890670b2 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -256,5 +256,17 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): cloth = context.cloth.settings effector_weights_ui(self, context, cloth.effector_weights, 'CLOTH') +classes = ( + CLOTH_MT_presets, + PHYSICS_PT_cloth, + PHYSICS_PT_cloth_cache, + PHYSICS_PT_cloth_collision, + PHYSICS_PT_cloth_stiffness, + PHYSICS_PT_cloth_sewing, + PHYSICS_PT_cloth_field_weights, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 277b59d187d..0b98d8738dc 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -274,6 +274,8 @@ def basic_force_field_settings_ui(self, context, field): col.prop(field, "use_global_coords", text="Global") elif field.type == 'HARMONIC': col.prop(field, "use_multiple_springs") + if field.type == 'FORCE': + col.prop(field, "use_gravity_falloff", text="Gravitation") split = layout.split() @@ -316,5 +318,12 @@ def basic_force_field_falloff_ui(self, context, field): sub.active = field.use_max_distance sub.prop(field, "distance_max", text="Maximum") + +classes = ( + PHYSICS_PT_add, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 6c3a3246cf6..c813350be08 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -529,12 +529,20 @@ class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): row.prop(brush, "wave_clamp") -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.register_module(__name__) - -if __name__ == "__main__": - register() +classes = ( + PHYSICS_UL_dynapaint_surfaces, + PHYSICS_PT_dynamic_paint, + PHYSICS_PT_dp_advanced_canvas, + PHYSICS_PT_dp_canvas_output, + PHYSICS_PT_dp_canvas_initial_color, + PHYSICS_PT_dp_effects, + PHYSICS_PT_dp_cache, + PHYSICS_PT_dp_brush_source, + PHYSICS_PT_dp_brush_velocity, + PHYSICS_PT_dp_brush_wave, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index 1cebc0496b0..2b12fcf982d 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -228,5 +228,13 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): col.label(text="Force Fields:") col.prop(settings, "absorption", text="Absorption") + +classes = ( + PHYSICS_PT_field, + PHYSICS_PT_collision, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 5d7034c2e68..ab92370f9ae 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -308,5 +308,16 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): row.prop(fluid, "tracer_particles", text="Tracer") row.prop(fluid, "generate_particles", text="Generate") + +classes = ( + FLUID_MT_presets, + PHYSICS_PT_fluid, + PHYSICS_PT_domain_gravity, + PHYSICS_PT_domain_boundary, + PHYSICS_PT_domain_particles, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py index eeb21c046bf..6afdd800b88 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py @@ -137,5 +137,14 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): col.prop(rbo, "linear_damping", text="Translation") col.prop(rbo, "angular_damping", text="Rotation") + +classes = ( + PHYSICS_PT_rigid_body, + PHYSICS_PT_rigid_body_collisions, + PHYSICS_PT_rigid_body_dynamics, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py index 9d4f51b256b..84a4cbb4b68 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py @@ -260,5 +260,11 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa sub.prop(rbc, "spring_damping_ang_z", text="Damping") +classes = ( + PHYSICS_PT_rigid_body_constraint, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index ee9135b9dbf..f2e6c1e22e3 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -21,9 +21,9 @@ import bpy from bpy.types import Panel from bl_ui.properties_physics_common import ( - point_cache_ui, - effector_weights_ui, - ) + point_cache_ui, + effector_weights_ui, +) class PhysicButtonsPanel: @@ -380,23 +380,23 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel): do_axis_slicing = (slice_method == 'AXIS_ALIGNED') do_full_slicing = (axis_slice_method == 'FULL') - row = layout.row(); + row = layout.row() row.enabled = do_axis_slicing row.prop(domain, "axis_slice_method") - col = layout.column(); + col = layout.column() col.enabled = not do_full_slicing and do_axis_slicing col.prop(domain, "slice_axis") col.prop(domain, "slice_depth") - row = layout.row(); + row = layout.row() row.enabled = do_full_slicing or not do_axis_slicing row.prop(domain, "slice_per_voxel") layout.separator() layout.label(text="Debug:") layout.prop(domain, "draw_velocity") - col = layout.column(); + col = layout.column() col.enabled = domain.draw_velocity col.prop(domain, "vector_draw_type") col.prop(domain, "vector_scale") @@ -404,11 +404,25 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel): layout.separator() layout.label(text="Color Mapping:") layout.prop(domain, "use_color_ramp") - col = layout.column(); + col = layout.column() col.enabled = domain.use_color_ramp col.prop(domain, "coba_field") col.template_color_ramp(domain, "color_ramp", expand=True) +classes = ( + PHYSICS_PT_smoke, + PHYSICS_PT_smoke_flow_advanced, + PHYSICS_PT_smoke_fire, + PHYSICS_PT_smoke_adaptive_domain, + PHYSICS_PT_smoke_highres, + PHYSICS_PT_smoke_groups, + PHYSICS_PT_smoke_cache, + PHYSICS_PT_smoke_field_weights, + PHYSICS_PT_smoke_display_settings, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index a458af739f2..5960428e4ae 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -244,5 +244,18 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel): effector_weights_ui(self, context, softbody.effector_weights, 'SOFTBODY') + +classes = ( + PHYSICS_PT_softbody, + PHYSICS_PT_softbody_cache, + PHYSICS_PT_softbody_goal, + PHYSICS_PT_softbody_edge, + PHYSICS_PT_softbody_collision, + PHYSICS_PT_softbody_solver, + PHYSICS_PT_softbody_field_weights, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 6d23c07152e..a7e8d9273ad 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -584,5 +584,24 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel): sub.prop(rd, "bake_user_scale", text="User Scale") +classes = ( + RENDER_MT_presets, + RENDER_MT_ffmpeg_presets, + RENDER_MT_framerate_presets, + RENDER_PT_render, + RENDER_PT_dimensions, + RENDER_PT_antialiasing, + RENDER_PT_motion_blur, + RENDER_PT_shading, + RENDER_PT_performance, + RENDER_PT_post_processing, + RENDER_PT_stamp, + RENDER_PT_output, + RENDER_PT_encoding, + RENDER_PT_bake, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_render_layer.py b/release/scripts/startup/bl_ui/properties_render_layer.py index 9b8bc237db9..084bc387822 100644 --- a/release/scripts/startup/bl_ui/properties_render_layer.py +++ b/release/scripts/startup/bl_ui/properties_render_layer.py @@ -227,5 +227,16 @@ class RENDERLAYER_PT_views(RenderLayerButtonsPanel, Panel): row.prop(rv, "camera_suffix", text="") +classes = ( + RENDERLAYER_UL_renderlayers, + RENDERLAYER_PT_layers, + RENDERLAYER_PT_layer_options, + RENDERLAYER_PT_layer_passes, + RENDERLAYER_UL_renderviews, + RENDERLAYER_PT_views, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index d6253ec7fbc..fb93c0b56f2 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -443,5 +443,25 @@ class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): _context_path = "scene" _property_type = bpy.types.Scene + +classes = ( + SCENE_MT_units_length_presets, + SCENE_UL_keying_set_paths, + SCENE_PT_scene, + SCENE_PT_unit, + SCENE_PT_keying_sets, + SCENE_PT_keying_set_paths, + SCENE_PT_color_management, + SCENE_PT_audio, + SCENE_PT_physics, + SCENE_PT_rigid_body_world, + SCENE_PT_rigid_body_cache, + SCENE_PT_rigid_body_field_weights, + SCENE_PT_simplify, + SCENE_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index caf19a9e469..d05527b7ef6 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -21,15 +21,15 @@ import bpy from bpy.types import Menu, Panel, UIList from bpy.types import ( - Brush, - FreestyleLineStyle, - Lamp, - Material, - Object, - ParticleSettings, - Texture, - World, - ) + Brush, + FreestyleLineStyle, + Lamp, + Material, + Object, + ParticleSettings, + Texture, + World, +) from rna_prop_ui import PropertyPanel @@ -60,6 +60,7 @@ class TEXTURE_MT_envmap_specials(Menu): class TEXTURE_UL_texslots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # assert(isinstance(item, bpy.types.MaterialTextureSlot) ma = data @@ -198,7 +199,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): if tex_collection: row = layout.row() - row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2) + row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", + idblock, "active_texture_index", rows=2) col = row.column(align=True) col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP' @@ -1210,12 +1212,22 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): row = layout.row() sub = row.row() - sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map)) + sub.active = ( + (tex.use_map_normal or tex.use_map_warp) and + not (tex.texture.type == 'IMAGE' and + (tex.texture.use_normal_map or tex.texture.use_derivative_map)) + ) sub.prop(tex, "bump_method", text="Method") - # the space setting is supported for: derivative-maps + bump-maps (DEFAULT,BEST_QUALITY), not for normal-maps + # the space setting is supported for: derivative-maps + bump-maps + # (DEFAULT,BEST_QUALITY), not for normal-maps sub = row.row() - sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_LOW_QUALITY', 'BUMP_MEDIUM_QUALITY', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) + sub.active = ( + (tex.use_map_normal or tex.use_map_warp) and + not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and + ((tex.bump_method in {'BUMP_LOW_QUALITY', 'BUMP_MEDIUM_QUALITY', 'BUMP_BEST_QUALITY'}) or + (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) + ) sub.prop(tex, "bump_objectspace", text="Space") @@ -1224,5 +1236,38 @@ class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel): _context_path = "texture" _property_type = Texture + +classes = ( + TEXTURE_MT_specials, + TEXTURE_MT_envmap_specials, + TEXTURE_UL_texslots, + TEXTURE_PT_context_texture, + TEXTURE_PT_preview, + TEXTURE_PT_colors, + TEXTURE_PT_clouds, + TEXTURE_PT_wood, + TEXTURE_PT_marble, + TEXTURE_PT_magic, + TEXTURE_PT_blend, + TEXTURE_PT_stucci, + TEXTURE_PT_image, + TEXTURE_PT_image_sampling, + TEXTURE_PT_image_mapping, + TEXTURE_PT_envmap, + TEXTURE_PT_envmap_sampling, + TEXTURE_PT_musgrave, + TEXTURE_PT_voronoi, + TEXTURE_PT_distortednoise, + TEXTURE_PT_voxeldata, + TEXTURE_PT_pointdensity, + TEXTURE_PT_pointdensity_turbulence, + TEXTURE_PT_ocean, + TEXTURE_PT_mapping, + TEXTURE_PT_influence, + TEXTURE_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index e07349a99ee..6aa39580d34 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -248,5 +248,20 @@ class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel): _context_path = "world" _property_type = bpy.types.World + +classes = ( + WORLD_PT_context_world, + WORLD_PT_preview, + WORLD_PT_world, + WORLD_PT_ambient_occlusion, + WORLD_PT_environment_lighting, + WORLD_PT_indirect_lighting, + WORLD_PT_gather, + WORLD_PT_mist, + WORLD_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 5cc135392c1..3f05620fcf6 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -1486,5 +1486,69 @@ class CLIP_MT_stabilize_2d_rotation_specials(Menu): layout.operator("clip.stabilize_2d_rotation_select") +classes = ( + CLIP_UL_tracking_objects, + CLIP_HT_header, + CLIP_MT_track, + CLIP_MT_tracking_editor_menus, + CLIP_MT_masking_editor_menus, + CLIP_PT_track, + CLIP_PT_tools_clip, + CLIP_PT_tools_marker, + CLIP_PT_tracking_settings, + CLIP_PT_tools_tracking, + CLIP_PT_tools_plane_tracking, + CLIP_PT_tools_solve, + CLIP_PT_tools_cleanup, + CLIP_PT_tools_geometry, + CLIP_PT_tools_orientation, + CLIP_PT_tools_object, + CLIP_PT_objects, + CLIP_PT_plane_track, + CLIP_PT_track_settings, + CLIP_PT_tracking_camera, + CLIP_PT_tracking_lens, + CLIP_PT_display, + CLIP_PT_marker, + CLIP_PT_marker_display, + CLIP_PT_stabilization, + CLIP_PT_proxy, + CLIP_PT_mask, + CLIP_PT_mask_layers, + CLIP_PT_mask_display, + CLIP_PT_active_mask_spline, + CLIP_PT_active_mask_point, + CLIP_PT_tools_mask, + CLIP_PT_tools_mask_add, + CLIP_PT_tools_mask_transforms, + CLIP_PT_footage, + CLIP_PT_footage_info, + CLIP_PT_tools_scenesetup, + CLIP_PT_grease_pencil, + CLIP_PT_grease_pencil_palettecolor, + CLIP_PT_tools_grease_pencil_draw, + CLIP_PT_tools_grease_pencil_edit, + CLIP_PT_tools_grease_pencil_sculpt, + CLIP_PT_tools_grease_pencil_brush, + CLIP_PT_tools_grease_pencil_brushcurves, + CLIP_MT_view, + CLIP_MT_clip, + CLIP_MT_proxy, + CLIP_MT_reconstruction, + CLIP_MT_track_visibility, + CLIP_MT_track_transform, + CLIP_MT_select, + CLIP_MT_select_grouped, + CLIP_MT_tracking_specials, + CLIP_MT_camera_presets, + CLIP_MT_track_color_presets, + CLIP_MT_tracking_settings_presets, + CLIP_MT_track_color_specials, + CLIP_MT_stabilize_2d_specials, + CLIP_MT_stabilize_2d_rotation_specials, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py index 4266abc5ad7..e6f96d989c7 100644 --- a/release/scripts/startup/bl_ui/space_console.py +++ b/release/scripts/startup/bl_ui/space_console.py @@ -102,5 +102,15 @@ def add_scrollback(text, text_type): bpy.ops.console.scrollback_append(text=l.expandtabs(4), type=text_type) + +classes = ( + CONSOLE_HT_header, + CONSOLE_MT_editor_menus, + CONSOLE_MT_console, + CONSOLE_MT_language, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 4d365c8dc08..e02649219dd 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -449,5 +449,21 @@ class DOPESHEET_MT_delete(Menu): layout.operator("action.clean", text="Clean Channels").channels = True +classes = ( + DOPESHEET_HT_header, + DOPESHEET_MT_editor_menus, + DOPESHEET_MT_view, + DOPESHEET_MT_select, + DOPESHEET_MT_marker, + DOPESHEET_MT_channel, + DOPESHEET_MT_key, + DOPESHEET_MT_key_transform, + DOPESHEET_MT_gpencil_channel, + DOPESHEET_MT_gpencil_frame, + DOPESHEET_MT_delete, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index d7b93dc36f0..bd72dfa9370 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -247,5 +247,18 @@ class FILEBROWSER_PT_advanced_filter(Panel): col.prop(params, "filter_id") +classes = ( + FILEBROWSER_HT_header, + FILEBROWSER_UL_dir, + FILEBROWSER_PT_system_folders, + FILEBROWSER_PT_system_bookmarks, + FILEBROWSER_MT_bookmarks_specials, + FILEBROWSER_PT_bookmarks, + FILEBROWSER_PT_recent_folders, + FILEBROWSER_PT_advanced_filter, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 446df9e6e79..21b49df61ae 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -42,10 +42,11 @@ class GRAPH_HT_header(Header): dopesheet_filter(layout, context) - layout.prop(st, "use_normalization", text="Normalize") - row = layout.row() - row.active = st.use_normalization - row.prop(st, "use_auto_normalization", text="Auto") + row = layout.row(align=True) + row.prop(st, "use_normalization", icon='NORMALIZE_FCURVES', text="Normalize", toggle=True) + sub = row.row(align=True) + sub.active = st.use_normalization + sub.prop(st, "use_auto_normalization", icon='FILE_REFRESH', text="", toggle=True) row = layout.row(align=True) @@ -298,6 +299,19 @@ class GRAPH_MT_delete(Menu): layout.operator("graph.clean").channels = False layout.operator("graph.clean", text="Clean Channels").channels = True +classes = ( + GRAPH_HT_header, + GRAPH_MT_editor_menus, + GRAPH_MT_view, + GRAPH_MT_select, + GRAPH_MT_marker, + GRAPH_MT_channel, + GRAPH_MT_key, + GRAPH_MT_key_transform, + GRAPH_MT_delete, +) if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 04b4cef9512..b274657b4f4 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -1242,5 +1242,59 @@ class IMAGE_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Pan bl_space_type = 'IMAGE_EDITOR' +classes = ( + IMAGE_MT_view, + IMAGE_MT_select, + IMAGE_MT_brush, + IMAGE_MT_image, + IMAGE_MT_image_invert, + IMAGE_MT_uvs, + IMAGE_MT_uvs_showhide, + IMAGE_MT_uvs_proportional, + IMAGE_MT_uvs_transform, + IMAGE_MT_uvs_snap, + IMAGE_MT_uvs_mirror, + IMAGE_MT_uvs_weldalign, + IMAGE_MT_uvs_select_mode, + IMAGE_HT_header, + MASK_MT_editor_menus, + IMAGE_PT_mask, + IMAGE_PT_mask_layers, + IMAGE_PT_mask_display, + IMAGE_PT_active_mask_spline, + IMAGE_PT_active_mask_point, + IMAGE_PT_image_properties, + IMAGE_PT_game_properties, + IMAGE_PT_view_properties, + IMAGE_PT_tools_transform_uvs, + IMAGE_PT_paint, + IMAGE_PT_tools_brush_overlay, + IMAGE_PT_tools_brush_texture, + IMAGE_PT_tools_mask, + IMAGE_PT_tools_mask_texture, + IMAGE_PT_tools_brush_tool, + IMAGE_PT_paint_stroke, + IMAGE_PT_paint_curve, + IMAGE_PT_tools_imagepaint_symmetry, + IMAGE_PT_tools_brush_appearance, + IMAGE_PT_tools_paint_options, + IMAGE_UV_sculpt, + IMAGE_UV_sculpt_curve, + IMAGE_PT_view_histogram, + IMAGE_PT_view_waveform, + IMAGE_PT_view_vectorscope, + IMAGE_PT_sample_line, + IMAGE_PT_scope_sample, + IMAGE_PT_grease_pencil, + IMAGE_PT_grease_pencil_palettecolor, + IMAGE_PT_tools_grease_pencil_draw, + IMAGE_PT_tools_grease_pencil_edit, + IMAGE_PT_tools_grease_pencil_sculpt, + IMAGE_PT_tools_grease_pencil_brush, + IMAGE_PT_tools_grease_pencil_brushcurves, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 2a085b8aada..a7b518dfd2e 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -127,6 +127,18 @@ class INFO_MT_file(Menu): layout.operator("wm.save_homefile", icon='SAVE_PREFS') layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY') + if any(bpy.utils.app_template_paths()): + app_template = context.user_preferences.app_template + if app_template: + layout.operator( + "wm.read_factory_settings", + text="Load Factory Template Settings", + icon='LOAD_FACTORY', + ).app_template = app_template + del app_template + + layout.menu("USERPREF_MT_app_templates", icon='FILE_BLEND') + layout.separator() layout.operator_context = 'INVOKE_AREA' @@ -340,5 +352,23 @@ class INFO_MT_help(Menu): layout.operator("wm.splash", icon='BLENDER') + +classes = ( + INFO_HT_header, + INFO_MT_editor_menus, + INFO_MT_file, + INFO_MT_file_import, + INFO_MT_file_export, + INFO_MT_file_external_data, + INFO_MT_file_previews, + INFO_MT_game, + INFO_MT_render, + INFO_MT_opengl_render, + INFO_MT_window, + INFO_MT_help, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py index 1b316a3eede..b552181f491 100644 --- a/release/scripts/startup/bl_ui/space_logic.py +++ b/release/scripts/startup/bl_ui/space_logic.py @@ -130,5 +130,16 @@ class LOGIC_MT_view(Menu): layout.operator("screen.screen_full_area") layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True + +classes = ( + LOGIC_PT_properties, + LOGIC_MT_logicbricks_add, + LOGIC_HT_header, + LOGIC_MT_editor_menus, + LOGIC_MT_view, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index 8fbf9bfc6ac..65d020477dc 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -209,5 +209,19 @@ class NLA_MT_edit_transform(Menu): layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND' layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' + +classes = ( + NLA_HT_header, + NLA_MT_edit, + NLA_MT_editor_menus, + NLA_MT_view, + NLA_MT_select, + NLA_MT_marker, + NLA_MT_add, + NLA_MT_edit_transform, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 8821fa0ca58..b939d34e154 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -526,6 +526,33 @@ class NODE_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Pane def node_draw_tree_view(layout, context): pass +classes = ( + NODE_HT_header, + NODE_MT_editor_menus, + NODE_MT_add, + NODE_MT_view, + NODE_MT_select, + NODE_MT_node, + NODE_MT_node_color_presets, + NODE_MT_node_color_specials, + NODE_PT_active_node_generic, + NODE_PT_active_node_color, + NODE_PT_active_node_properties, + NODE_PT_backdrop, + NODE_PT_quality, + NODE_UL_interface_sockets, + NODE_PT_grease_pencil, + NODE_PT_grease_pencil_palettecolor, + NODE_PT_grease_pencil_tools, + NODE_PT_tools_grease_pencil_draw, + NODE_PT_tools_grease_pencil_edit, + NODE_PT_tools_grease_pencil_sculpt, + NODE_PT_tools_grease_pencil_brush, + NODE_PT_tools_grease_pencil_brushcurves, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 6f7c535fe21..4eb550bbb35 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -130,5 +130,16 @@ class OUTLINER_MT_edit_datablocks(Menu): layout.operator("outliner.drivers_add_selected") layout.operator("outliner.drivers_delete_selected") + +classes = ( + OUTLINER_HT_header, + OUTLINER_MT_editor_menus, + OUTLINER_MT_view, + OUTLINER_MT_search, + OUTLINER_MT_edit_datablocks, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_properties.py b/release/scripts/startup/bl_ui/space_properties.py index f0ca01ec3ba..20cb5719e20 100644 --- a/release/scripts/startup/bl_ui/space_properties.py +++ b/release/scripts/startup/bl_ui/space_properties.py @@ -34,13 +34,11 @@ class PROPERTIES_HT_header(Header): row.prop(view, "context", expand=True, icon_only=True) -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - - -if __name__ == "__main__": - register() +classes = ( + PROPERTIES_HT_header, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 6bb516cf929..01da3b48f7d 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -652,17 +652,39 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): col.prop(strip, "rotation_start", text="Rotation") elif strip.type == 'MULTICAM': - layout.prop(strip, "multicam_source") - - row = layout.row(align=True) - sub = row.row(align=True) - sub.scale_x = 2.0 - - sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY') + col = layout.column(align=True) + strip_channel = strip.channel + + col.prop(strip, "multicam_source", text="Source Channel") + + # The multicam strip needs at least 2 strips to be useful + if strip_channel > 2: + BT_ROW = 4 + + col.label("Cut To:") + row = col.row() + + for i in range(1, strip_channel): + if (i % BT_ROW) == 1: + row = col.row(align=True) + + # Workaround - .enabled has to have a separate UI block to work + if i == strip.multicam_source: + sub = row.row(align=True) + sub.enabled = False + sub.operator("sequencer.cut_multicam", text="%d" % i).camera = i + else: + sub_1 = row.row(align=True) + sub_1.enabled = True + sub_1.operator("sequencer.cut_multicam", text="%d" % i).camera = i + + if strip.channel > BT_ROW and (strip_channel - 1) % BT_ROW: + for i in range(strip.channel, strip_channel + ((BT_ROW + 1 - strip_channel) % BT_ROW)): + row.label("") + else: + col.separator() + col.label(text="Two or more channels are needed below this strip", icon="INFO") - row.label("Cut To") - for i in range(1, strip.channel): - row.operator("sequencer.cut_multicam", text="%d" % i).camera = i elif strip.type == 'TEXT': col = layout.column() @@ -1217,5 +1239,37 @@ class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel): bl_category = "Strip" +classes = ( + SEQUENCER_HT_header, + SEQUENCER_MT_editor_menus, + SEQUENCER_MT_view, + SEQUENCER_MT_view_toggle, + SEQUENCER_MT_select, + SEQUENCER_MT_marker, + SEQUENCER_MT_change, + SEQUENCER_MT_frame, + SEQUENCER_MT_add, + SEQUENCER_MT_add_effect, + SEQUENCER_MT_strip, + SEQUENCER_PT_edit, + SEQUENCER_PT_effect, + SEQUENCER_PT_input, + SEQUENCER_PT_sound, + SEQUENCER_PT_scene, + SEQUENCER_PT_mask, + SEQUENCER_PT_filter, + SEQUENCER_PT_proxy, + SEQUENCER_PT_preview, + SEQUENCER_PT_view, + SEQUENCER_PT_view_safe_areas, + SEQUENCER_PT_modifiers, + SEQUENCER_PT_grease_pencil, + SEQUENCER_PT_grease_pencil_palettecolor, + SEQUENCER_PT_grease_pencil_tools, + SEQUENCER_PT_custom_props, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 1fd10575e07..98a7da855ca 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -215,20 +215,22 @@ class TEXT_MT_templates_py(Menu): bl_label = "Python" def draw(self, context): - self.path_menu(bpy.utils.script_paths("templates_py"), - "text.open", - {"internal": True}, - ) + self.path_menu( + bpy.utils.script_paths("templates_py"), + "text.open", + props_default={"internal": True}, + ) class TEXT_MT_templates_osl(Menu): bl_label = "Open Shading Language" def draw(self, context): - self.path_menu(bpy.utils.script_paths("templates_osl"), - "text.open", - {"internal": True}, - ) + self.path_menu( + bpy.utils.script_paths("templates_osl"), + "text.open", + props_default={"internal": True}, + ) class TEXT_MT_templates(Menu): @@ -341,5 +343,25 @@ class TEXT_MT_toolbox(Menu): layout.operator("text.run_script") + +classes = ( + TEXT_HT_header, + TEXT_MT_edit, + TEXT_MT_editor_menus, + TEXT_PT_properties, + TEXT_PT_find, + TEXT_MT_view, + TEXT_MT_text, + TEXT_MT_templates, + TEXT_MT_templates_py, + TEXT_MT_templates_osl, + TEXT_MT_edit_select, + TEXT_MT_format, + TEXT_MT_edit_to3d, + TEXT_MT_toolbox, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 508e62e4f56..b9a25cd72a0 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -49,7 +49,10 @@ class TIME_HT_header(Header): row.prop(scene, "frame_preview_start", text="Start") row.prop(scene, "frame_preview_end", text="End") - layout.prop(scene, "frame_current", text="") + if scene.show_subframe: + layout.prop(scene, "frame_float", text="") + else: + layout.prop(scene, "frame_current", text="") layout.separator() @@ -135,6 +138,7 @@ class TIME_MT_view(Menu): layout.prop(st, "show_frame_indicator") layout.prop(scene, "show_keys_from_selected_only") + layout.prop(scene, "show_subframe") layout.separator() @@ -265,5 +269,18 @@ def marker_menu_generic(layout): layout.prop(ts, "lock_markers") +classes = ( + TIME_HT_header, + TIME_MT_editor_menus, + TIME_MT_marker, + TIME_MT_view, + TIME_MT_cache, + TIME_MT_frame, + TIME_MT_playback, + TIME_MT_autokey, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 075a6f870fa..e50beba50d8 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -90,6 +90,63 @@ class USERPREF_MT_interaction_presets(Menu): draw = Menu.draw_preset +class USERPREF_MT_app_templates(Menu): + bl_label = "Application Templates" + preset_subdir = "app_templates" + + def draw_ex(self, context, *, use_splash=False, use_default=False, use_install=False): + import os + + layout = self.layout + + # now draw the presets + layout.operator_context = 'EXEC_DEFAULT' + + if use_default: + props = layout.operator("wm.read_homefile", text="Default") + props.use_splash = True + props.app_template = "" + layout.separator() + + template_paths = bpy.utils.app_template_paths() + + # expand template paths + app_templates = [] + for path in template_paths: + for d in os.listdir(path): + if d.startswith(("__", ".")): + continue + template = os.path.join(path, d) + if os.path.isdir(template): + # template_paths_expand.append(template) + app_templates.append(d) + + for d in sorted(app_templates): + props = layout.operator( + "wm.read_homefile", + text=bpy.path.display_name(d), + ) + props.use_splash = True + props.app_template = d; + + if use_install: + layout.separator() + layout.operator_context = 'INVOKE_DEFAULT' + props = layout.operator("wm.app_template_install") + + + def draw(self, context): + self.draw_ex(context, use_splash=False, use_default=True, use_install=True) + + +class USERPREF_MT_templates_splash(Menu): + bl_label = "Startup Templates" + preset_subdir = "templates" + + def draw(self, context): + USERPREF_MT_app_templates.draw_ex(self, context, use_splash=True, use_default=True) + + class USERPREF_MT_appconfigs(Menu): bl_label = "AppPresets" preset_subdir = "keyconfig" @@ -110,7 +167,17 @@ class USERPREF_MT_splash(Menu): split = layout.split() row = split.row() - row.label("") + + if any(bpy.utils.app_template_paths()): + row.label("Template:") + template = context.user_preferences.app_template + row.menu( + "USERPREF_MT_templates_splash", + text=bpy.path.display_name(template) if template else "Default", + ) + else: + row.label("") + row = split.row() row.label("Interaction:") @@ -150,6 +217,7 @@ class USERPREF_PT_interface(Panel): col = row.column() col.label(text="Display:") + col.prop(view, "ui_scale", text="Scale") col.prop(view, "show_tooltips") col.prop(view, "show_tooltips_python") col.prop(view, "show_object_info", text="Object Info") @@ -400,11 +468,6 @@ class USERPREF_PT_system(Panel): col = colsplit.column() col.label(text="General:") - col.prop(system, "dpi") - col.label("Virtual Pixel Mode:") - col.prop(system, "virtual_pixel_mode", text="") - - col.separator() col.prop(system, "frame_server_port") col.prop(system, "scrollback", text="Console Scrollback") @@ -453,6 +516,7 @@ class USERPREF_PT_system(Panel): col.separator() col.label(text="Selection") col.prop(system, "select_method", text="") + col.prop(system, "use_select_pick_depth") col.separator() @@ -1243,7 +1307,7 @@ class USERPREF_MT_addons_online_resources(Menu): "wm.url_open", text="API Concepts", icon='URL', ).url = bpy.types.WM_OT_doc_view._prefix + "/info_quickstart.html" layout.operator("wm.url_open", text="Add-on Tutorial", icon='URL', - ).url = "http://www.blender.org/api/blender_python_api_current/info_tutorial_addon.html" + ).url = bpy.types.WM_OT_doc_view._prefix + "/info_tutorial_addon.html" class USERPREF_PT_addons(Panel): @@ -1317,11 +1381,18 @@ class USERPREF_PT_addons(Panel): # set in addon_utils.modules_refresh() if addon_utils.error_duplicates: - self.draw_error(col, - "Multiple addons using the same name found!\n" - "likely a problem with the script search path.\n" - "(see console for details)", - ) + box = col.box() + row = box.row() + row.label("Multiple add-ons with the same name found!") + row.label(icon='ERROR') + box.label("Please delete one of each pair:") + for (addon_name, addon_file, addon_path) in addon_utils.error_duplicates: + box.separator() + sub_col = box.column(align=True) + sub_col.label(addon_name + ":") + sub_col.label(" " + addon_file) + sub_col.label(" " + addon_path) + if addon_utils.error_encoding: self.draw_error(col, @@ -1473,5 +1544,29 @@ class USERPREF_PT_addons(Panel): row.label(text=module_name, translate=False) +classes = ( + USERPREF_HT_header, + USERPREF_PT_tabs, + USERPREF_MT_interaction_presets, + USERPREF_MT_templates_splash, + USERPREF_MT_app_templates, + USERPREF_MT_appconfigs, + USERPREF_MT_splash, + USERPREF_MT_splash_footer, + USERPREF_PT_interface, + USERPREF_PT_edit, + USERPREF_PT_system, + USERPREF_MT_interface_theme_presets, + USERPREF_PT_theme, + USERPREF_PT_file, + USERPREF_MT_ndof_settings, + USERPREF_MT_keyconfigs, + USERPREF_PT_input, + USERPREF_MT_addons_online_resources, + USERPREF_PT_addons, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 1183d078a8c..f13c7095f67 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -284,7 +284,8 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): layout.separator() layout.operator_context = 'EXEC_REGION_WIN' - layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working + # XXX see alignmenu() in edit.c of b2.4x to get this working + layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' layout.separator() @@ -1205,6 +1206,16 @@ class INFO_MT_lamp_add(Menu): layout.operator_enum("object.lamp_add", "type") +class INFO_MT_camera_add(Menu): + bl_idname = "INFO_MT_camera_add" + bl_label = "Camera" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'EXEC_REGION_WIN' + layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA') + + class INFO_MT_add(Menu): bl_label = "Add" @@ -1236,7 +1247,11 @@ class INFO_MT_add(Menu): layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER') layout.separator() - layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA') + if INFO_MT_camera_add.is_extended(): + layout.menu("INFO_MT_camera_add", icon='OUTLINER_OB_CAMERA') + else: + INFO_MT_camera_add.draw(self, context) + layout.menu("INFO_MT_lamp_add", icon='OUTLINER_OB_LAMP') layout.separator() @@ -1533,6 +1548,7 @@ class VIEW3D_MT_object_apply(Menu): layout.separator() layout.operator("object.visual_transform_apply", text="Visual Transform", text_ctxt=i18n_contexts.default) + layout.operator("object.convert", text="Visual Geometry to Mesh", text_ctxt=i18n_contexts.default).target = 'MESH' layout.operator("object.duplicates_make_real") @@ -1744,6 +1760,7 @@ class VIEW3D_MT_brush_paint_modes(Menu): layout.prop(brush, "use_paint_weight", text="Weight Paint") layout.prop(brush, "use_paint_image", text="Texture Paint") + # ********** Vertex paint menu ********** @@ -1813,6 +1830,7 @@ class VIEW3D_MT_vertex_group(Menu): layout.operator("object.vertex_group_remove", text="Remove Active Group").all = False layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True + # ********** Weight paint menu ********** @@ -1851,6 +1869,7 @@ class VIEW3D_MT_paint_weight(Menu): layout.operator("paint.weight_set") + # ********** Sculpt menu ********** @@ -2004,6 +2023,7 @@ class VIEW3D_MT_particle_specials(Menu): class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu): _operator_name = "particle" + # ********** Pose Menu ********** @@ -2277,6 +2297,7 @@ class VIEW3D_MT_bone_options_disable(Menu, BoneOptions): bl_label = "Disable Bone Options" type = 'DISABLE' + # ********** Edit Menus, suffix from ob.type ********** @@ -2444,6 +2465,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu): with_bullet = bpy.app.build_options.bullet layout.operator("mesh.merge") + layout.operator("mesh.remove_doubles") layout.operator("mesh.rip_move") layout.operator("mesh.rip_move_fill") layout.operator("mesh.rip_edge_move") @@ -2466,7 +2488,6 @@ class VIEW3D_MT_edit_mesh_vertices(Menu): if with_bullet: layout.operator("mesh.convex_hull") layout.operator("mesh.vertices_smooth") - layout.operator("mesh.remove_doubles") layout.operator("mesh.blend_from_shape") @@ -2623,6 +2644,7 @@ class VIEW3D_MT_edit_mesh_clean(Menu): layout.operator("mesh.face_make_planar") layout.operator("mesh.vert_connect_nonplanar") layout.operator("mesh.vert_connect_concave") + layout.operator("mesh.remove_doubles") layout.operator("mesh.fill_holes") @@ -3780,13 +3802,143 @@ class VIEW3D_PT_context_properties(Panel): # Draw with no edit button rna_prop_ui.draw(self.layout, context, member, object, False) - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() +classes = ( + VIEW3D_HT_header, + VIEW3D_MT_editor_menus, + VIEW3D_MT_transform, + VIEW3D_MT_transform_base, + VIEW3D_MT_transform_object, + VIEW3D_MT_transform_armature, + VIEW3D_MT_mirror, + VIEW3D_MT_snap, + VIEW3D_MT_uv_map, + VIEW3D_MT_edit_proportional, + VIEW3D_MT_view, + VIEW3D_MT_view_navigation, + VIEW3D_MT_view_align, + VIEW3D_MT_view_align_selected, + VIEW3D_MT_view_cameras, + VIEW3D_MT_select_object, + VIEW3D_MT_select_object_more_less, + VIEW3D_MT_select_pose, + VIEW3D_MT_select_pose_more_less, + VIEW3D_MT_select_particle, + VIEW3D_MT_edit_mesh, + VIEW3D_MT_edit_mesh_select_similar, + VIEW3D_MT_edit_mesh_select_by_trait, + VIEW3D_MT_edit_mesh_select_more_less, + VIEW3D_MT_select_edit_mesh, + VIEW3D_MT_select_edit_curve, + VIEW3D_MT_select_edit_surface, + VIEW3D_MT_select_edit_text, + VIEW3D_MT_select_edit_metaball, + VIEW3D_MT_select_edit_lattice, + VIEW3D_MT_select_edit_armature, + VIEW3D_MT_select_gpencil, + VIEW3D_MT_select_paint_mask, + VIEW3D_MT_select_paint_mask_vertex, + VIEW3D_MT_angle_control, + INFO_MT_mesh_add, + INFO_MT_curve_add, + INFO_MT_surface_add, + INFO_MT_metaball_add, + INFO_MT_edit_curve_add, + INFO_MT_edit_armature_add, + INFO_MT_armature_add, + INFO_MT_lamp_add, + INFO_MT_camera_add, + INFO_MT_add, + VIEW3D_MT_object, + VIEW3D_MT_object_animation, + VIEW3D_MT_object_clear, + VIEW3D_MT_object_specials, + VIEW3D_MT_object_apply, + VIEW3D_MT_object_parent, + VIEW3D_MT_object_track, + VIEW3D_MT_object_group, + VIEW3D_MT_object_constraints, + VIEW3D_MT_object_quick_effects, + VIEW3D_MT_object_showhide, + VIEW3D_MT_make_single_user, + VIEW3D_MT_make_links, + VIEW3D_MT_object_game, + VIEW3D_MT_brush, + VIEW3D_MT_brush_paint_modes, + VIEW3D_MT_paint_vertex, + VIEW3D_MT_hook, + VIEW3D_MT_vertex_group, + VIEW3D_MT_paint_weight, + VIEW3D_MT_sculpt, + VIEW3D_MT_hide_mask, + VIEW3D_MT_particle, + VIEW3D_MT_particle_specials, + VIEW3D_MT_particle_showhide, + VIEW3D_MT_pose, + VIEW3D_MT_pose_transform, + VIEW3D_MT_pose_slide, + VIEW3D_MT_pose_propagate, + VIEW3D_MT_pose_library, + VIEW3D_MT_pose_motion, + VIEW3D_MT_pose_group, + VIEW3D_MT_pose_ik, + VIEW3D_MT_pose_constraints, + VIEW3D_MT_pose_showhide, + VIEW3D_MT_pose_apply, + VIEW3D_MT_pose_specials, + VIEW3D_MT_bone_options_toggle, + VIEW3D_MT_bone_options_enable, + VIEW3D_MT_bone_options_disable, + VIEW3D_MT_edit_mesh_specials, + VIEW3D_MT_edit_mesh_select_mode, + VIEW3D_MT_edit_mesh_extrude, + VIEW3D_MT_edit_mesh_vertices, + VIEW3D_MT_edit_mesh_edges, + VIEW3D_MT_edit_mesh_faces, + VIEW3D_MT_edit_mesh_normals, + VIEW3D_MT_edit_mesh_clean, + VIEW3D_MT_edit_mesh_delete, + VIEW3D_MT_edit_mesh_showhide, + VIEW3D_MT_edit_gpencil, + VIEW3D_MT_edit_gpencil_delete, + VIEW3D_MT_edit_curve, + VIEW3D_MT_edit_curve_ctrlpoints, + VIEW3D_MT_edit_curve_segments, + VIEW3D_MT_edit_curve_specials, + VIEW3D_MT_edit_curve_delete, + VIEW3D_MT_edit_curve_showhide, + VIEW3D_MT_edit_surface, + VIEW3D_MT_edit_font, + VIEW3D_MT_edit_text_chars, + VIEW3D_MT_edit_meta, + VIEW3D_MT_edit_meta_showhide, + VIEW3D_MT_edit_lattice, + VIEW3D_MT_edit_armature, + VIEW3D_MT_armature_specials, + VIEW3D_MT_edit_armature_parent, + VIEW3D_MT_edit_armature_roll, + VIEW3D_MT_edit_armature_delete, + VIEW3D_MT_edit_gpencil_transform, + VIEW3D_MT_edit_gpencil_interpolate, + VIEW3D_PT_grease_pencil, + VIEW3D_PT_grease_pencil_palettecolor, + VIEW3D_PT_view3d_properties, + VIEW3D_PT_view3d_cursor, + VIEW3D_PT_view3d_name, + VIEW3D_PT_view3d_display, + VIEW3D_PT_view3d_stereo, + VIEW3D_PT_view3d_shading, + VIEW3D_PT_view3d_motion_tracking, + VIEW3D_PT_view3d_meshdisplay, + VIEW3D_PT_view3d_meshstatvis, + VIEW3D_PT_view3d_curvedisplay, + VIEW3D_PT_background_image, + VIEW3D_PT_transform_orientations, + VIEW3D_PT_etch_a_ton, + VIEW3D_PT_context_properties, +) + + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 60e86d7544d..d58453deaef 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -2008,5 +2008,69 @@ class VIEW3D_PT_tools_history(View3DPanel, Panel): col.operator("screen.repeat_history", text="History...") +classes = ( + VIEW3D_PT_tools_transform, + VIEW3D_PT_tools_object, + VIEW3D_PT_tools_add_object, + VIEW3D_PT_tools_relations, + VIEW3D_PT_tools_animation, + VIEW3D_PT_tools_rigid_body, + VIEW3D_PT_tools_transform_mesh, + VIEW3D_PT_tools_meshedit, + VIEW3D_PT_tools_meshweight, + VIEW3D_PT_tools_add_mesh_edit, + VIEW3D_PT_tools_shading, + VIEW3D_PT_tools_uvs, + VIEW3D_PT_tools_meshedit_options, + VIEW3D_PT_tools_transform_curve, + VIEW3D_PT_tools_curveedit, + VIEW3D_PT_tools_add_curve_edit, + VIEW3D_PT_tools_curveedit_options_stroke, + VIEW3D_PT_tools_transform_surface, + VIEW3D_PT_tools_surfaceedit, + VIEW3D_PT_tools_add_surface_edit, + VIEW3D_PT_tools_textedit, + VIEW3D_PT_tools_armatureedit, + VIEW3D_PT_tools_armatureedit_transform, + VIEW3D_PT_tools_armatureedit_options, + VIEW3D_PT_tools_mballedit, + VIEW3D_PT_tools_add_mball_edit, + VIEW3D_PT_tools_latticeedit, + VIEW3D_PT_tools_posemode, + VIEW3D_PT_tools_posemode_options, + VIEW3D_PT_imapaint_tools_missing, + VIEW3D_PT_tools_brush, + TEXTURE_UL_texpaintslots, + VIEW3D_MT_tools_projectpaint_uvlayer, + VIEW3D_PT_slots_projectpaint, + VIEW3D_PT_stencil_projectpaint, + VIEW3D_PT_tools_brush_overlay, + VIEW3D_PT_tools_brush_texture, + VIEW3D_PT_tools_mask_texture, + VIEW3D_PT_tools_brush_stroke, + VIEW3D_PT_tools_brush_curve, + VIEW3D_PT_sculpt_dyntopo, + VIEW3D_PT_sculpt_options, + VIEW3D_PT_sculpt_symmetry, + VIEW3D_PT_tools_brush_appearance, + VIEW3D_PT_tools_weightpaint, + VIEW3D_PT_tools_weightpaint_options, + VIEW3D_PT_tools_vertexpaint, + VIEW3D_PT_tools_imagepaint_external, + VIEW3D_PT_tools_imagepaint_symmetry, + VIEW3D_PT_tools_projectpaint, + VIEW3D_MT_tools_projectpaint_stencil, + VIEW3D_PT_tools_particlemode, + VIEW3D_PT_tools_grease_pencil_draw, + VIEW3D_PT_tools_grease_pencil_edit, + VIEW3D_PT_tools_grease_pencil_interpolate, + VIEW3D_PT_tools_grease_pencil_sculpt, + VIEW3D_PT_tools_grease_pencil_brush, + VIEW3D_PT_tools_grease_pencil_brushcurves, + VIEW3D_PT_tools_history, +) + if __name__ == "__main__": # only for live edit. - bpy.utils.register_module(__name__) + from bpy.utils import register_class + for cls in classes: + register_class(cls) |