Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_common.py
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if md: | ||||
| "object.modifier_remove", | "object.modifier_remove", | ||||
| text=name, | text=name, | ||||
| text_ctxt=i18n_contexts.default, | text_ctxt=i18n_contexts.default, | ||||
| icon='X', | icon='X', | ||||
| ) | ) | ||||
| if toggles: | if toggles: | ||||
| row.prop(md, "show_viewport", text="") | row.prop(md, "show_viewport", text="") | ||||
| row.prop(md, "show_render", text="") | row.prop(md, "show_render", text="") | ||||
| return row | |||||
| else: | else: | ||||
| row.operator( | row.operator( | ||||
| "object.modifier_add", | "object.modifier_add", | ||||
| text=name, | text=name, | ||||
| text_ctxt=i18n_contexts.default, | text_ctxt=i18n_contexts.default, | ||||
| icon=typeicon, | icon=typeicon, | ||||
| ).type = type | ).type = type | ||||
| Show All 25 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| if obj.field.type == 'NONE': | if obj.field.type == 'NONE': | ||||
| col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE') | col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE') | ||||
| else: | else: | ||||
| col.operator("object.forcefield_toggle", text="Force Field", icon='X') | col.operator("object.forcefield_toggle", text="Force Field", icon='X') | ||||
| if obj.type == 'MESH': | if obj.type == 'MESH': | ||||
| physics_add(col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) | row = physics_add(col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) | ||||
| if row and obj.collision: | |||||
| row.prop(obj.collision, "use", text="", icon="HIDE_OFF" if obj.collision.use else "HIDE_ON") | |||||
| physics_add(col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) | physics_add(col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) | ||||
| physics_add(col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True) | physics_add(col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True) | ||||
| col = flow.column() | col = flow.column() | ||||
| if obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE', 'FONT'}: | if obj.type in {'MESH', 'LATTICE', 'CURVE', 'SURFACE', 'FONT'}: | ||||
| physics_add(col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True) | physics_add(col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True) | ||||
| ▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines | |||||