Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_rigidbody.py
| Show All 13 Lines | |||||
| class PHYSICS_PT_rigidbody_panel: | class PHYSICS_PT_rigidbody_panel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "physics" | bl_context = "physics" | ||||
| class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Rigid Body" | bl_label = "Rigid Body" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 18 Lines | def draw(self, context): | ||||
| if parent is None or parent.rigid_body is None: | if parent is None or parent.rigid_body is None: | ||||
| layout.prop(rbo, "type", text="Type") | layout.prop(rbo, "type", text="Type") | ||||
| class PHYSICS_PT_rigid_body_settings(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_settings(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Settings" | bl_label = "Settings" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body' | bl_parent_id = 'PHYSICS_PT_rigid_body' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if obj.parent is not None and obj.parent.rigid_body is not None: | if obj.parent is not None and obj.parent.rigid_body is not None: | ||||
| return False | return False | ||||
| return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 15 Lines | def draw(self, context): | ||||
| col.prop(rbo, "enabled", text="Dynamic") | col.prop(rbo, "enabled", text="Dynamic") | ||||
| col.prop(rbo, "kinematic", text="Animated") | col.prop(rbo, "kinematic", text="Animated") | ||||
| class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Collisions" | bl_label = "Collisions" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body' | bl_parent_id = 'PHYSICS_PT_rigid_body' | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if ( | if ( | ||||
| (obj.parent is not None) and | (obj.parent is not None) and | ||||
| (obj.parent.rigid_body is not None) and | (obj.parent.rigid_body is not None) and | ||||
| (not obj.parent.rigid_body.collision_shape == 'COMPOUND') | (not obj.parent.rigid_body.collision_shape == 'COMPOUND') | ||||
| Show All 33 Lines | def draw(self, context): | ||||
| if rbo.collision_shape == 'MESH' and rbo.mesh_source == 'DEFORM': | if rbo.collision_shape == 'MESH' and rbo.mesh_source == 'DEFORM': | ||||
| layout.prop(rbo, "use_deform", text="Deforming") | layout.prop(rbo, "use_deform", text="Deforming") | ||||
| class PHYSICS_PT_rigid_body_collisions_surface(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_collisions_surface(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Surface Response" | bl_label = "Surface Response" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if obj.parent is not None and obj.parent.rigid_body is not None: | if obj.parent is not None and obj.parent.rigid_body is not None: | ||||
| return False | return False | ||||
| return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 11 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(rbo, "restitution", text="Bounciness") | col.prop(rbo, "restitution", text="Bounciness") | ||||
| class PHYSICS_PT_rigid_body_collisions_sensitivity(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_collisions_sensitivity(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Sensitivity" | bl_label = "Sensitivity" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if ( | if ( | ||||
| (obj.parent is not None) and | (obj.parent is not None) and | ||||
| (obj.parent.rigid_body is not None) and | (obj.parent.rigid_body is not None) and | ||||
| (not obj.parent.rigid_body.collision_shape == 'COMPOUND') | (not obj.parent.rigid_body.collision_shape == 'COMPOUND') | ||||
| Show All 20 Lines | def draw(self, context): | ||||
| col.active = rbo.use_margin | col.active = rbo.use_margin | ||||
| col.prop(rbo, "collision_margin", text="Margin") | col.prop(rbo, "collision_margin", text="Margin") | ||||
| class PHYSICS_PT_rigid_body_collisions_collections(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_collisions_collections(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Collections" | bl_label = "Collections" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | bl_parent_id = 'PHYSICS_PT_rigid_body_collisions' | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if obj.parent is not None and obj.parent.rigid_body is not None: | if obj.parent is not None and obj.parent.rigid_body is not None: | ||||
| return False | return False | ||||
| return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | return (obj and obj.rigid_body and (context.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| rbo = ob.rigid_body | rbo = ob.rigid_body | ||||
| layout.prop(rbo, "collision_collections", text="") | layout.prop(rbo, "collision_collections", text="") | ||||
| class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Dynamics" | bl_label = "Dynamics" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body' | bl_parent_id = 'PHYSICS_PT_rigid_body' | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| if obj.parent is not None and obj.parent.rigid_body is not None: | if obj.parent is not None and obj.parent.rigid_body is not None: | ||||
| return False | return False | ||||
| return (obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE' | return (obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE' | ||||
| and (context.engine in cls.COMPAT_ENGINES)) | and (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 16 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(rbo, "angular_damping", text="Rotation") | col.prop(rbo, "angular_damping", text="Rotation") | ||||
| class PHYSICS_PT_rigid_body_dynamics_deactivation(PHYSICS_PT_rigidbody_panel, Panel): | class PHYSICS_PT_rigid_body_dynamics_deactivation(PHYSICS_PT_rigidbody_panel, Panel): | ||||
| bl_label = "Deactivation" | bl_label = "Deactivation" | ||||
| bl_parent_id = 'PHYSICS_PT_rigid_body_dynamics' | bl_parent_id = 'PHYSICS_PT_rigid_body_dynamics' | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body | return (obj and obj.rigid_body | ||||
| and obj.rigid_body.type == 'ACTIVE' | and obj.rigid_body.type == 'ACTIVE' | ||||
| and (context.engine in cls.COMPAT_ENGINES)) | and (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 40 Lines | |||||