Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_field.py
| Show All 32 Lines | class PhysicButtonsPanel: | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.object) and (context.engine in cls.COMPAT_ENGINES) | return (context.object) and (context.engine in cls.COMPAT_ENGINES) | ||||
| class PHYSICS_PT_field(PhysicButtonsPanel, Panel): | class PHYSICS_PT_field(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Force Fields" | bl_label = "Force Fields" | ||||
| 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): | ||||
| ob = context.object | ob = context.object | ||||
| if not ob: | if not ob: | ||||
| return False | return False | ||||
| return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') | return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(field, "use_smoke_density") | col.prop(field, "use_smoke_density") | ||||
| else: | else: | ||||
| basic_force_field_settings_ui(self, context, field) | basic_force_field_settings_ui(self, context, field) | ||||
| class PHYSICS_PT_field_falloff(PhysicButtonsPanel, Panel): | class PHYSICS_PT_field_falloff(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Falloff" | bl_label = "Falloff" | ||||
| bl_parent_id = "PHYSICS_PT_field" | bl_parent_id = "PHYSICS_PT_field" | ||||
| 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): | ||||
| ob = context.object | ob = context.object | ||||
| return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type not in {'NONE', 'GUIDE'}) | return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type not in {'NONE', 'GUIDE'}) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(field, "use_radial_max", text="Use Maximum") | col.prop(field, "use_radial_max", text="Use Maximum") | ||||
| sub = col.column() | sub = col.column() | ||||
| sub.active = field.use_radial_max | sub.active = field.use_radial_max | ||||
| sub.prop(field, "radial_max", text="Distance") | sub.prop(field, "radial_max", text="Distance") | ||||
| class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): | class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Collision" | bl_label = "Collision" | ||||
| 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): | ||||
| ob = context.object | ob = context.object | ||||
| return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(settings, "absorption", text="Force Field Absorption") | col.prop(settings, "absorption", text="Force Field Absorption") | ||||
| class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel): | class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Particle" | bl_label = "Particle" | ||||
| bl_parent_id = "PHYSICS_PT_collision" | bl_parent_id = "PHYSICS_PT_collision" | ||||
| 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): | ||||
| ob = context.object | ob = context.object | ||||
| return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 25 Lines | def draw(self, context): | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| sub.prop(settings, "friction_factor", text="Friction", slider=True) | sub.prop(settings, "friction_factor", text="Friction", slider=True) | ||||
| sub.prop(settings, "friction_random", text="Randomize", slider=True) | sub.prop(settings, "friction_random", text="Randomize", slider=True) | ||||
| class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel): | class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Softbody" | bl_label = "Softbody" | ||||
| bl_parent_id = "PHYSICS_PT_collision" | bl_parent_id = "PHYSICS_PT_collision" | ||||
| 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): | ||||
| ob = context.object | ob = context.object | ||||
| return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 32 Lines | |||||