Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_scene.py
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): | ||||
| layout.label(text="", icon_value=icon) | layout.label(text="", icon_value=icon) | ||||
| class SceneButtonsPanel: | class SceneButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "scene" | bl_context = "scene" | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return (context.engine in cls.COMPAT_ENGINES) | |||||
| class SCENE_PT_scene(SceneButtonsPanel, Panel): | class SCENE_PT_scene(SceneButtonsPanel, Panel): | ||||
| bl_label = "Scene" | bl_label = "Scene" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| scene = context.scene | scene = context.scene | ||||
| layout.prop(scene, "camera") | layout.prop(scene, "camera") | ||||
| layout.prop(scene, "background_set") | layout.prop(scene, "background_set") | ||||
| layout.prop(scene, "active_clip") | layout.prop(scene, "active_clip") | ||||
| class SCENE_PT_unit(SceneButtonsPanel, Panel): | class SCENE_PT_unit(SceneButtonsPanel, Panel): | ||||
| bl_label = "Units" | bl_label = "Units" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| unit = context.scene.unit_settings | unit = context.scene.unit_settings | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | def _draw_keyframing_setting(context, layout, ks, ksp, label, toggle_prop, prop, userpref_fallback=None): | ||||
| subrow.prop(owner, propname, text=label) | subrow.prop(owner, propname, text=label) | ||||
| row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon | row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon | ||||
| class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | ||||
| bl_label = "Keying Sets" | bl_label = "Keying Sets" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| scene = context.scene | scene = context.scene | ||||
| row = layout.row() | row = layout.row() | ||||
| Show All 17 Lines | def draw(self, context): | ||||
| subcol = flow.column() | subcol = flow.column() | ||||
| subcol.operator_context = 'INVOKE_DEFAULT' | subcol.operator_context = 'INVOKE_DEFAULT' | ||||
| subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py" | subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py" | ||||
| class SCENE_PT_keyframing_settings(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | class SCENE_PT_keyframing_settings(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | ||||
| bl_label = "Keyframing Settings" | bl_label = "Keyframing Settings" | ||||
| bl_parent_id = "SCENE_PT_keying_sets" | bl_parent_id = "SCENE_PT_keying_sets" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ks = context.scene.keying_sets.active | ks = context.scene.keying_sets.active | ||||
| return (ks and ks.is_path_absolute) | return (ks and ks.is_path_absolute) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 20 Lines | def draw(self, context): | ||||
| col.label(text="Active Set Override") | col.label(text="Active Set Override") | ||||
| self.draw_keyframing_settings(context, col, ks, ksp) | self.draw_keyframing_settings(context, col, ks, ksp) | ||||
| class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): | ||||
| bl_label = "Active Keying Set" | bl_label = "Active Keying Set" | ||||
| bl_parent_id = "SCENE_PT_keying_sets" | bl_parent_id = "SCENE_PT_keying_sets" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ks = context.scene.keying_sets.active | ks = context.scene.keying_sets.active | ||||
| return (ks and ks.is_path_absolute) | return (ks and ks.is_path_absolute) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(ksp, "group_method", text="F-Curve Grouping") | col.prop(ksp, "group_method", text="F-Curve Grouping") | ||||
| if ksp.group_method == 'NAMED': | if ksp.group_method == 'NAMED': | ||||
| col.prop(ksp, "group") | col.prop(ksp, "group") | ||||
| class SCENE_PT_audio(SceneButtonsPanel, Panel): | class SCENE_PT_audio(SceneButtonsPanel, Panel): | ||||
| bl_label = "Audio" | bl_label = "Audio" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| scene = context.scene | scene = context.scene | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| ffmpeg = rd.ffmpeg | ffmpeg = rd.ffmpeg | ||||
| Show All 22 Lines | def draw(self, context): | ||||
| col.separator() | col.separator() | ||||
| layout.operator("sound.bake_animation") | layout.operator("sound.bake_animation") | ||||
| class SCENE_PT_physics(SceneButtonsPanel, Panel): | class SCENE_PT_physics(SceneButtonsPanel, Panel): | ||||
| bl_label = "Gravity" | bl_label = "Gravity" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| self.layout.prop(context.scene, "use_gravity", text="") | self.layout.prop(context.scene, "use_gravity", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| scene = context.scene | scene = context.scene | ||||
| layout.active = scene.use_gravity | layout.active = scene.use_gravity | ||||
| layout.prop(scene, "gravity") | layout.prop(scene, "gravity") | ||||
| class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): | class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel): | ||||
| bl_label = "Rigid Body World" | bl_label = "Rigid Body World" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return (context.engine in cls.COMPAT_ENGINES) | |||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| scene = context.scene | scene = context.scene | ||||
| rbw = scene.rigidbody_world | rbw = scene.rigidbody_world | ||||
| if rbw is not None: | if rbw is not None: | ||||
| self.layout.prop(rbw, "enabled", text="") | self.layout.prop(rbw, "enabled", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| scene = context.scene | scene = context.scene | ||||
| rbw = scene.rigidbody_world | rbw = scene.rigidbody_world | ||||
| if rbw is None: | if rbw is None: | ||||
| layout.operator("rigidbody.world_add") | layout.operator("rigidbody.world_add") | ||||
| else: | else: | ||||
| layout.operator("rigidbody.world_remove") | layout.operator("rigidbody.world_remove") | ||||
| class SCENE_PT_rigid_body_world_settings(SceneButtonsPanel, Panel): | class RigidBodySubPanel(SceneButtonsPanel): | ||||
| bl_label = "Settings" | |||||
| bl_parent_id = "SCENE_PT_rigid_body_world" | bl_parent_id = "SCENE_PT_rigid_body_world" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| scene = context.scene | scene = context.scene | ||||
| return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES) | return scene and scene.rigidbody_world | ||||
| class SCENE_PT_rigid_body_world_settings(RigidBodySubPanel, Panel): | |||||
| bl_label = "Settings" | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| scene = context.scene | scene = context.scene | ||||
| rbw = scene.rigidbody_world | rbw = scene.rigidbody_world | ||||
| Show All 14 Lines | def draw(self, context): | ||||
| col.active = rbw.enabled | col.active = rbw.enabled | ||||
| col.prop(rbw, "use_split_impulse") | col.prop(rbw, "use_split_impulse") | ||||
| col = col.column() | col = col.column() | ||||
| col.prop(rbw, "steps_per_second", text="Steps Per Second") | col.prop(rbw, "steps_per_second", text="Steps Per Second") | ||||
| col.prop(rbw, "solver_iterations", text="Solver Iterations") | col.prop(rbw, "solver_iterations", text="Solver Iterations") | ||||
| class SCENE_PT_rigid_body_cache(SceneButtonsPanel, Panel): | class SCENE_PT_rigid_body_cache(RigidBodySubPanel, Panel): | ||||
| bl_label = "Cache" | bl_label = "Cache" | ||||
| bl_parent_id = "SCENE_PT_rigid_body_world" | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| scene = context.scene | scene = context.scene | ||||
| rbw = scene.rigidbody_world | rbw = scene.rigidbody_world | ||||
| point_cache_ui(self, context, rbw.point_cache, rbw.point_cache.is_baked is False and rbw.enabled, 'RIGID_BODY') | point_cache_ui(self, context, rbw.point_cache, rbw.point_cache.is_baked is False and rbw.enabled, 'RIGID_BODY') | ||||
| class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel): | class SCENE_PT_rigid_body_field_weights(RigidBodySubPanel, Panel): | ||||
| bl_label = "Field Weights" | bl_label = "Field Weights" | ||||
| bl_parent_id = "SCENE_PT_rigid_body_world" | bl_parent_id = "SCENE_PT_rigid_body_world" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| scene = context.scene | scene = context.scene | ||||
| rbw = scene.rigidbody_world | rbw = scene.rigidbody_world | ||||
| effector_weights_ui(self, context, rbw.effector_weights, 'RIGID_BODY') | effector_weights_ui(self, context, rbw.effector_weights, 'RIGID_BODY') | ||||
| class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): | |||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| _context_path = "scene" | |||||
| _property_type = bpy.types.Scene | |||||
| classes = ( | classes = ( | ||||
| SCENE_UL_keying_set_paths, | SCENE_UL_keying_set_paths, | ||||
| SCENE_PT_scene, | SCENE_PT_scene, | ||||
| SCENE_PT_unit, | SCENE_PT_unit, | ||||
| SCENE_PT_physics, | SCENE_PT_physics, | ||||
| SCENE_PT_keying_sets, | SCENE_PT_keying_sets, | ||||
| SCENE_PT_keying_set_paths, | SCENE_PT_keying_set_paths, | ||||
| SCENE_PT_keyframing_settings, | SCENE_PT_keyframing_settings, | ||||
| SCENE_PT_audio, | SCENE_PT_audio, | ||||
| SCENE_PT_rigid_body_world, | SCENE_PT_rigid_body_world, | ||||
| SCENE_PT_rigid_body_world_settings, | SCENE_PT_rigid_body_world_settings, | ||||
| SCENE_PT_rigid_body_cache, | SCENE_PT_rigid_body_cache, | ||||
| SCENE_PT_rigid_body_field_weights, | SCENE_PT_rigid_body_field_weights, | ||||
| SCENE_PT_custom_props, | |||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||