Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_field.py
| Show All 27 Lines | |||||
| class PhysicButtonsPanel: | class PhysicButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "physics" | bl_context = "physics" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return (context.object) and (rd.engine in cls.COMPAT_ENGINES) | return (context.object) and (view_render.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_CLAY', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ob = context.object | ob = context.object | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return (rd.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') | return (view_render.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE') | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ob = context.object | ob = context.object | ||||
| field = ob.field | field = ob.field | ||||
| split = layout.split(percentage=0.2) | split = layout.split(percentage=0.2) | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
| class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): | class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): | ||||
| bl_label = "Collision" | bl_label = "Collision" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ob = context.object | ob = context.object | ||||
| rd = context.scene.render | view_render = context.scene.view_render | ||||
| return (ob and ob.type == 'MESH') and (rd.engine in cls.COMPAT_ENGINES) and (context.collision) | return (ob and ob.type == 'MESH') and (view_render.engine in cls.COMPAT_ENGINES) and (context.collision) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| md = context.collision | md = context.collision | ||||
| split = layout.split() | split = layout.split() | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||