Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_rigidbody.py
| Show All 23 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | return (obj and obj.rigid_body and | ||||
| (context.engine in cls.COMPAT_ENGINES)) | (context.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| if rbo.type == 'ACTIVE': | if rbo.type == 'ACTIVE': | ||||
| 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | return (obj and obj.rigid_body and | ||||
| (context.engine in cls.COMPAT_ENGINES)) | (context.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 11 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | return (obj and obj.rigid_body and | ||||
| (context.engine in cls.COMPAT_ENGINES)) | (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.use_property_split = True | layout.use_property_split = True | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(rbo, "friction") | col.prop(rbo, "friction") | ||||
| 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | return (obj and obj.rigid_body and | ||||
| (context.engine in cls.COMPAT_ENGINES)) | (context.engine in cls.COMPAT_ENGINES)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| sub.active = rbo.use_margin | sub.active = rbo.use_margin | ||||
| sub.prop(rbo, "collision_margin", text="Margin") | sub.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 = "Collision Collections" | bl_label = "Collision 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | return (obj and obj.rigid_body and | ||||
| (context.engine in cls.COMPAT_ENGINES)) | (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_groups", text="") | layout.prop(rbo, "collision_groups", 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | 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)) | (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| col.prop(rbo, "linear_damping", text="Translation Damping") | col.prop(rbo, "linear_damping", text="Translation Damping") | ||||
| col.prop(rbo, "angular_damping", text="Rotation Damping") | col.prop(rbo, "angular_damping", text="Rotation Damping") | ||||
| 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_OPENGL'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| obj = context.object | obj = context.object | ||||
| return (obj and obj.rigid_body and | 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)) | (context.engine in cls.COMPAT_ENGINES)) | ||||
| Show All 35 Lines | |||||