Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_particle.py
| Show All 36 Lines | def particle_panel_enabled(context, psys): | ||||
| if psys.settings.type in {'EMITTER', 'REACTOR'} and phystype in {'NO', 'KEYED'}: | if psys.settings.type in {'EMITTER', 'REACTOR'} and phystype in {'NO', 'KEYED'}: | ||||
| return True | return True | ||||
| else: | else: | ||||
| return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable) | return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable) | ||||
| def particle_panel_poll(cls, context): | def particle_panel_poll(cls, context): | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| settings = 0 | settings = 0 | ||||
| if psys: | if psys: | ||||
| settings = psys.settings | settings = psys.settings | ||||
| elif isinstance(context.space_data.pin_id, bpy.types.ParticleSettings): | elif isinstance(context.space_data.pin_id, bpy.types.ParticleSettings): | ||||
| settings = context.space_data.pin_id | settings = context.space_data.pin_id | ||||
| if not settings: | if not settings: | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): | class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES) | return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| if context.scene.render.engine == 'BLENDER_GAME': | if context.engine == 'BLENDER_GAME': | ||||
| layout.label("Not available in the Game Engine") | layout.label("Not available in the Game Engine") | ||||
| return | return | ||||
| ob = context.object | ob = context.object | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| part = 0 | part = 0 | ||||
| if ob: | if ob: | ||||
| ▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): | class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): | ||||
| bl_label = "Hair Dynamics" | bl_label = "Hair Dynamics" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| 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): | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| if psys is None: | if psys is None: | ||||
| return False | return False | ||||
| if psys.settings is None: | if psys.settings is None: | ||||
| return False | return False | ||||
| return psys.settings.type == 'HAIR' and (engine in cls.COMPAT_ENGINES) | return psys.settings.type == 'HAIR' and (engine in cls.COMPAT_ENGINES) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): | class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): | ||||
| bl_label = "Cache" | bl_label = "Cache" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| 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): | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| if psys is None: | if psys is None: | ||||
| return False | return False | ||||
| if psys.settings is None: | if psys.settings is None: | ||||
| return False | return False | ||||
| if psys.settings.is_fluid: | if psys.settings.is_fluid: | ||||
| return False | return False | ||||
| phystype = psys.settings.physics_type | phystype = psys.settings.physics_type | ||||
| if phystype == 'NO' or phystype == 'KEYED': | if phystype == 'NO' or phystype == 'KEYED': | ||||
| ▲ Show 20 Lines • Show All 368 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): | class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): | ||||
| bl_label = "Boid Brain" | bl_label = "Boid Brain" | ||||
| 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): | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| settings = particle_get_settings(context) | settings = particle_get_settings(context) | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| if settings is None: | if settings is None: | ||||
| return False | return False | ||||
| if psys is not None and psys.point_cache.use_external: | if psys is not None and psys.point_cache.use_external: | ||||
| return False | return False | ||||
| return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES | return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_render(ParticleButtonsPanel, Panel): | class PARTICLE_PT_render(ParticleButtonsPanel, Panel): | ||||
| bl_label = "Render" | bl_label = "Render" | ||||
| 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): | ||||
| settings = particle_get_settings(context) | settings = particle_get_settings(context) | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| if settings is None: | if settings is None: | ||||
| return False | return False | ||||
| return engine in cls.COMPAT_ENGINES | return engine in cls.COMPAT_ENGINES | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | |||||
| class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): | class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): | ||||
| bl_label = "Display" | bl_label = "Display" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| 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): | ||||
| settings = particle_get_settings(context) | settings = particle_get_settings(context) | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| if settings is None: | if settings is None: | ||||
| return False | return False | ||||
| return engine in cls.COMPAT_ENGINES | return engine in cls.COMPAT_ENGINES | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| psys = context.particle_system | psys = context.particle_system | ||||
| ▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines | |||||