Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_cloth.py
| Show All 29 Lines | class PhysicButtonsPanel: | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ob = context.object | ob = context.object | ||||
| return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.cloth) | return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.cloth) | ||||
| class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Cloth" | bl_label = "Cloth" | ||||
| 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'} | ||||
| def draw_header_preset(self, _context): | def draw_header_preset(self, _context): | ||||
| CLOTH_PT_presets.draw_panel_header(self.layout) | CLOTH_PT_presets.draw_panel_header(self.layout) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| cloth = md.settings | cloth = md.settings | ||||
| layout.active = cloth_panel_enabled(md) | layout.active = cloth_panel_enabled(md) | ||||
| flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "quality", text="Quality Steps") | col.prop(cloth, "quality", text="Quality Steps") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "time_scale", text="Speed Multiplier") | col.prop(cloth, "time_scale", text="Speed Multiplier") | ||||
| class PHYSICS_PT_cloth_physical_properties(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_physical_properties(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Physical Properties" | bl_label = "Physical Properties" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| cloth = md.settings | cloth = md.settings | ||||
| layout.active = cloth_panel_enabled(md) | layout.active = cloth_panel_enabled(md) | ||||
| flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "mass", text="Vertex Mass") | col.prop(cloth, "mass", text="Vertex Mass") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "air_damping", text="Air Viscosity") | col.prop(cloth, "air_damping", text="Air Viscosity") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "bending_model") | col.prop(cloth, "bending_model") | ||||
| class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Stiffness" | bl_label = "Stiffness" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| cloth = md.settings | cloth = md.settings | ||||
| Show All 14 Lines | def draw(self, context): | ||||
| col.prop(cloth, "shear_stiffness", text="Shear") | col.prop(cloth, "shear_stiffness", text="Shear") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "bending_stiffness", text="Bending") | col.prop(cloth, "bending_stiffness", text="Bending") | ||||
| class PHYSICS_PT_cloth_damping(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_damping(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Damping" | bl_label = "Damping" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| cloth = md.settings | cloth = md.settings | ||||
| Show All 14 Lines | def draw(self, context): | ||||
| col.prop(cloth, "shear_damping", text="Shear") | col.prop(cloth, "shear_damping", text="Shear") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "bending_damping", text="Bending") | col.prop(cloth, "bending_damping", text="Bending") | ||||
| class PHYSICS_PT_cloth_internal_springs(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_internal_springs(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Internal Springs" | bl_label = "Internal Springs" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | ||||
| 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'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cloth = context.cloth.settings | cloth = context.cloth.settings | ||||
| self.layout.active = cloth_panel_enabled(context.cloth) | self.layout.active = cloth_panel_enabled(context.cloth) | ||||
| self.layout.prop(cloth, "use_internal_springs", text="") | self.layout.prop(cloth, "use_internal_springs", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 25 Lines | def draw(self, context): | ||||
| col.prop(cloth, "internal_tension_stiffness_max", text="Max Tension") | col.prop(cloth, "internal_tension_stiffness_max", text="Max Tension") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "internal_compression_stiffness_max", text="Max Compression") | col.prop(cloth, "internal_compression_stiffness_max", text="Max Compression") | ||||
| class PHYSICS_PT_cloth_pressure(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_pressure(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Pressure" | bl_label = "Pressure" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | bl_parent_id = 'PHYSICS_PT_cloth_physical_properties' | ||||
| 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'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cloth = context.cloth.settings | cloth = context.cloth.settings | ||||
| self.layout.active = cloth_panel_enabled(context.cloth) | self.layout.active = cloth_panel_enabled(context.cloth) | ||||
| self.layout.prop(cloth, "use_pressure", text="") | self.layout.prop(cloth, "use_pressure", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 27 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop_search(cloth, "vertex_group_pressure", ob, "vertex_groups", text="Vertex Group") | col.prop_search(cloth, "vertex_group_pressure", ob, "vertex_groups", text="Vertex Group") | ||||
| class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Cache" | bl_label = "Cache" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| md = context.cloth | md = context.cloth | ||||
| point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 'CLOTH') | point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 'CLOTH') | ||||
| class PHYSICS_PT_cloth_shape(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_shape(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Shape" | bl_label = "Shape" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| ob = context.object | ob = context.object | ||||
| cloth = md.settings | cloth = md.settings | ||||
| Show All 33 Lines | def draw(self, context): | ||||
| col.active = not cloth.use_dynamic_mesh | col.active = not cloth.use_dynamic_mesh | ||||
| col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="Rest Shape Key") | col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="Rest Shape Key") | ||||
| class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Collisions" | bl_label = "Collisions" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| cloth = context.cloth.collision_settings | cloth = context.cloth.collision_settings | ||||
| md = context.cloth | md = context.cloth | ||||
| layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md) | layout.active = (cloth.use_collision or cloth.use_self_collision) and cloth_panel_enabled(md) | ||||
| flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "collision_quality", text="Quality") | col.prop(cloth, "collision_quality", text="Quality") | ||||
| class PHYSICS_PT_cloth_object_collision(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_object_collision(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Object Collisions" | bl_label = "Object Collisions" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_collision' | bl_parent_id = 'PHYSICS_PT_cloth_collision' | ||||
| 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'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cloth = context.cloth.collision_settings | cloth = context.cloth.collision_settings | ||||
| self.layout.active = cloth_panel_enabled(context.cloth) | self.layout.active = cloth_panel_enabled(context.cloth) | ||||
| self.layout.prop(cloth, "use_collision", text="") | self.layout.prop(cloth, "use_collision", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 19 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(cloth, "collection") | col.prop(cloth, "collection") | ||||
| class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Self Collisions" | bl_label = "Self Collisions" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth_collision' | bl_parent_id = 'PHYSICS_PT_cloth_collision' | ||||
| 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'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| cloth = context.cloth.collision_settings | cloth = context.cloth.collision_settings | ||||
| self.layout.active = cloth_panel_enabled(context.cloth) | self.layout.active = cloth_panel_enabled(context.cloth) | ||||
| self.layout.prop(cloth, "use_self_collision", text="") | self.layout.prop(cloth, "use_self_collision", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 20 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group") | col.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group") | ||||
| class PHYSICS_PT_cloth_property_weights(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_property_weights(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Property Weights" | bl_label = "Property Weights" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| md = context.cloth | md = context.cloth | ||||
| ob = context.object | ob = context.object | ||||
| cloth = context.cloth.settings | cloth = context.cloth.settings | ||||
| Show All 37 Lines | def draw(self, context): | ||||
| ) | ) | ||||
| col.prop(cloth, "shrink_max", text="Max Shrinking") | col.prop(cloth, "shrink_max", text="Max Shrinking") | ||||
| class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): | class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Field Weights" | bl_label = "Field Weights" | ||||
| bl_parent_id = 'PHYSICS_PT_cloth' | bl_parent_id = 'PHYSICS_PT_cloth' | ||||
| 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'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| cloth = context.cloth.settings | cloth = context.cloth.settings | ||||
| effector_weights_ui(self, cloth.effector_weights, 'CLOTH') | effector_weights_ui(self, cloth.effector_weights, 'CLOTH') | ||||
| classes = ( | classes = ( | ||||
| CLOTH_PT_presets, | CLOTH_PT_presets, | ||||
| Show All 19 Lines | |||||