Skip to content

GasComponent

GasComponent

ambient_temperature property writable

ambient_temperature: float

Temperature particles cool/warm toward over time

can_dissipate property writable

can_dissipate: bool

Whether particles shrink and fade away over time. Applies to all current particles. When False, the other dissipation/wisp settings are ignored.

collision_radius property writable

collision_radius: float

Physical collision radius applied to every particle. Clamped to a small positive minimum. Distinct from particle_radius, which is purely visual.

color property writable

color: Vector4

Core fill color (RGBA, 0-1) of the rendered gas

cooling_rate property writable

cooling_rate: float

How quickly particles cool toward ambient_temperature

desired_particle_count property writable

desired_particle_count: int

Number of particles to seed when filling the source shape. Changing this re-seeds the whole gas, discarding any particles added individually via add_particle().

dissipation_rate property writable

dissipation_rate: float

Exponential rate at which each particle's radius scale decays per second (only when can_dissipate is True). Clamped to >= 0.

dissipation_spread property writable

dissipation_spread: float

How strongly dissipating particles drift outward along a random direction as they shrink. Clamped to >= 0.

emit_wisps_on_dissipate property writable

emit_wisps_on_dissipate: bool

Whether a dissipating particle splits into smaller visual-only wisps once it shrinks past wisp_split_threshold

enable property writable

enable: bool

Whether this component is active

epsilon property writable

epsilon: float

Relaxation parameter (CFM) for the position-based solver

gamma property writable

gamma: float

Polytropic exponent used in the gas's equation of state

initial_temperature property writable

initial_temperature: float

Temperature newly seeded particles start at. Changing this re-seeds the gas.

max_dissipation_generations property writable

max_dissipation_generations: int

How many times wisps may themselves split into further wisps. 0 means only original particles split. Clamped to >= 0.

max_dissipation_speed property writable

max_dissipation_speed: float

Speed cap applied to particles while they drift outward from dissipation. Clamped to >= 0.

metaball_edge_soft property writable

metaball_edge_soft: float

Softness of the metaball surface edge falloff

metaball_threshold property writable

metaball_threshold: float

Density threshold at which the metaball surface renderer considers the gas 'present'

min_radius property writable

min_radius: float

Radius scale (0-1, relative to full size) below which a dissipating particle is removed. Clamped to a small positive minimum.

noise_scale property writable

noise_scale: float

Spatial scale of the procedural noise applied to the gas surface

noise_strength property writable

noise_strength: float

Strength of the procedural noise applied to the gas surface

outline_color property writable

outline_color: Vector4

Edge color (RGBA, 0-1) blended in at the metaball surface's edge

outline_width_texels property writable

outline_width_texels: float

Width of the rendered outline, in texels

owner property

owner: Object

The Object that owns this component

particle_count property

particle_count: int

Number of particles currently in this gas

particle_mass property writable

particle_mass: float

Mass of each individual particle. Values <= 0 are clamped to 0.01.

particle_radius property writable

particle_radius: float

Visual radius of each rendered gas particle's splat quad. Clamped to a small positive minimum.

particles property

particles: list[GasParticle]

All GasParticle instances currently owned by this component, including visual-only wisps spawned by dissipation (check GasParticle.is_visual_only)

rest_density property writable

rest_density: float

Target ambient density the gas solver tries to maintain per particle

rise_speed property writable

rise_speed: float

Speed at which the surface noise animates upward, giving a rising-smoke look

smoothing_radius property writable

smoothing_radius: float

SPH smoothing (kernel) radius used for density/pressure calculations

stiffness property writable

stiffness: float

Equation-of-state stiffness: how strongly the gas resists compression

thermal_diffusivity property writable

thermal_diffusivity: float

How quickly heat diffuses between neighboring particles

viscosity property writable

viscosity: float

How resistant the gas is to flowing/shearing

vorticity_strength property writable

vorticity_strength: float

Strength of vorticity confinement, restoring small-scale swirling motion. Clamped to >= 0.

wisp_count_per_split property writable

wisp_count_per_split: int

Number of wisps spawned each time a particle splits. Clamped to >= 0.

wisp_split_threshold property writable

wisp_split_threshold: float

Radius scale (0-1) at or below which a dissipating particle spawns its wisps. Clamped to [0, 1].

add_child

add_child(obj: Object) -> Object

Add obj as a child of this component's owning Object

add_component

add_component(component_class: Any) -> typing.Any

Attach a new component of the given type to this component's owning Object.

Example
render = self.add_component(RenderComponent)

add_object

add_object(obj: Object, parent: Object = None) -> Object

Add a newly created Object to the scene, optionally parented to another Object

get_component

get_component(component_class: Any) -> typing.Any

Look up a component on this Object

get_owner

get_owner() -> Object

The Object that owns this component

get_particle

get_particle(index: SupportsInt | SupportsIndex) -> GasParticle

Get a particle by index

has_component

has_component(component_class: Any) -> bool

Check whether this component's owning Object has a component of the given type

remove_component

remove_component(component_class: Any) -> None

Remove a component of the given type from this component's owning Object

remove_object

remove_object(obj: Object) -> None

Remove an object from the scene

remove_particle

remove_particle(particle: GasParticle) -> None

Remove and delete a specific GasParticle previously returned by add_particle(), particles, or get_particle()

reseed

reseed() -> None

Discard all particles (including manually added ones and wisps) and re-fill the shape according to desired_particle_count

set_ambient_temperature

set_ambient_temperature(ambient_temperature: SupportsFloat | SupportsIndex) -> None

Set ambient_temperature. See the ambient_temperature property.

set_can_dissipate

set_can_dissipate(can_dissipate: bool) -> None

Set can_dissipate. See the can_dissipate property.

set_collision_radius

set_collision_radius(collision_radius: SupportsFloat | SupportsIndex) -> None

Set collision_radius. See the collision_radius property.

set_color

set_color(color: Vector4) -> None

Set color. See the color property.

set_cooling_rate

set_cooling_rate(cooling_rate: SupportsFloat | SupportsIndex) -> None

Set cooling_rate. See the cooling_rate property.

set_desired_particle_count

set_desired_particle_count(desired_particle_count: SupportsInt | SupportsIndex) -> None

Changing this re-seeds the whole gas on its source shape, discarding any particles added individually via add_particle()

set_dissipation_spread

set_dissipation_spread(dissipation_spread: SupportsFloat | SupportsIndex) -> None

Set dissipation_spread. See the dissipation_spread property.

set_emit_wisps_on_dissipate

set_emit_wisps_on_dissipate(emit_wisps_on_dissipate: bool) -> None

Set emit_wisps_on_dissipate. See the emit_wisps_on_dissipate property.

set_enable

set_enable(enable: bool) -> None

Set enable. See the enable property.

set_epsilon

set_epsilon(epsilon: SupportsFloat | SupportsIndex) -> None

Set epsilon. See the epsilon property.

set_gamma

set_gamma(gamma: SupportsFloat | SupportsIndex) -> None

Set gamma. See the gamma property.

set_initial_temperature

set_initial_temperature(initial_temperature: SupportsFloat | SupportsIndex) -> None

Set initial_temperature. See the initial_temperature property.

set_max_dissipation_generations

set_max_dissipation_generations(max_dissipation_generations: SupportsInt | SupportsIndex) -> None

Set max_dissipation_generations. See the max_dissipation_generations property.

set_max_dissipation_speed

set_max_dissipation_speed(max_dissipation_speed: SupportsFloat | SupportsIndex) -> None

Set max_dissipation_speed. See the max_dissipation_speed property.

set_metaball_edge_soft

set_metaball_edge_soft(metaball_edge_soft: SupportsFloat | SupportsIndex) -> None

Set metaball_edge_soft. See the metaball_edge_soft property.

set_metaball_threshold

set_metaball_threshold(metaball_threshold: SupportsFloat | SupportsIndex) -> None

Set metaball_threshold. See the metaball_threshold property.

set_min_radius

set_min_radius(min_radius: SupportsFloat | SupportsIndex) -> None

Set min_radius. See the min_radius property.

set_noise_scale

set_noise_scale(noise_scale: SupportsFloat | SupportsIndex) -> None

Set noise_scale. See the noise_scale property.

set_noise_strength

set_noise_strength(noise_strength: SupportsFloat | SupportsIndex) -> None

Set noise_strength. See the noise_strength property.

set_outline_color

set_outline_color(outline_color: Vector4) -> None

Set outline_color. See the outline_color property.

set_outline_width_texels

set_outline_width_texels(outline_width_texels: SupportsFloat | SupportsIndex) -> None

Set outline_width_texels. See the outline_width_texels property.

set_particle_mass

set_particle_mass(particle_mass: SupportsFloat | SupportsIndex) -> None

Set particle_mass. See the particle_mass property.

set_particle_radius

set_particle_radius(particle_radius: SupportsFloat | SupportsIndex) -> None

Set particle_radius. See the particle_radius property.

set_rest_density

set_rest_density(rest_density: SupportsFloat | SupportsIndex) -> None

Set rest_density. See the rest_density property.

set_rise_speed

set_rise_speed(rise_speed: SupportsFloat | SupportsIndex) -> None

Set rise_speed. See the rise_speed property.

set_smoothing_radius

set_smoothing_radius(smoothing_radius: SupportsFloat | SupportsIndex) -> None

Set smoothing_radius. See the smoothing_radius property.

set_stiffness

set_stiffness(stiffness: SupportsFloat | SupportsIndex) -> None

Set stiffness. See the stiffness property.

set_thermal_diffusivity

set_thermal_diffusivity(thermal_diffusivity: SupportsFloat | SupportsIndex) -> None

Set thermal_diffusivity. See the thermal_diffusivity property.

set_viscosity

set_viscosity(viscosity: SupportsFloat | SupportsIndex) -> None

Set viscosity. See the viscosity property.

set_vorticity_strength

set_vorticity_strength(vorticity_strength: SupportsFloat | SupportsIndex) -> None

Set vorticity_strength. See the vorticity_strength property.

set_wisp_count_per_split

set_wisp_count_per_split(wisp_count_per_split: SupportsInt | SupportsIndex) -> None

Set wisp_count_per_split. See the wisp_count_per_split property.

set_wisp_split_threshold

set_wisp_split_threshold(wisp_split_threshold: SupportsFloat | SupportsIndex) -> None

Set wisp_split_threshold. See the wisp_split_threshold property.

update_collision_layer_mask

update_collision_layer_mask() -> None

Sync every particle's collision_layer/collision_mask with this Object's CollisionComponent

GasParticle

A single SPH particle owned by a GasComponent.

ambient_temperature property writable

ambient_temperature: float

Temperature this particle cools/warms toward, overriding GasComponent.ambient_temperature

can_dissipate property writable

can_dissipate: bool

Whether this individual particle shrinks and fades over time, overriding GasComponent.can_dissipate

collision_radius property writable

collision_radius: float

Physical collision radius of this individual particle

compliance property writable

compliance: float

Constraint compliance (inverse stiffness) for this individual particle

cooling_rate property writable

cooling_rate: float

Cooling rate for this individual particle, overriding GasComponent.cooling_rate

density property

density: float

Density computed by the solver this substep (read-only)

dissipation_generation property

dissipation_generation: int

How many wisp splits deep this particle is (0 = original particle)

drift_dir property writable

drift_dir: Vector3

Direction this particle drifts in while dissipating (unit vector, randomized on seed)

epsilon property writable

epsilon: float

Relaxation parameter (CFM) for this individual particle, overriding GasComponent.epsilon

gamma property writable

gamma: float

Polytropic exponent for this individual particle, overriding GasComponent.gamma

has_split property writable

has_split: bool

Whether this particle has already spawned its dissipation wisps. Set to True to prevent it from splitting.

inverse_mass property writable

inverse_mass: float

1/mass of this individual particle

is_visual_only property

is_visual_only: bool

True for wisps spawned by dissipation: they are rendered and drift, but aren't part of the physics solver

lambda_ property

lambda_: float

Constraint multiplier from the solver's last substep (read-only)

mass property writable

mass: float

Mass of this individual particle. Values <= 0 are clamped to 0.001.

owner property

owner: Object

The Object whose GasComponent owns this particle

position property writable

position: Vector3

World-space position of this particle. Setting this also resets predicted_position, teleporting the particle immediately.

predicted_position property

predicted_position: Vector3

Position predicted by the solver this substep (read-only)

radius_scale property writable

radius_scale: float

Current size multiplier (1 = full size). Decays toward 0 while dissipating; the particle is removed once it drops below GasComponent.min_radius.

rest_density property writable

rest_density: float

Target ambient density for this individual particle, overriding GasComponent.rest_density

smoothing_radius property writable

smoothing_radius: float

SPH smoothing radius for this individual particle, overriding GasComponent.smoothing_radius

stiffness property writable

stiffness: float

Equation-of-state stiffness for this individual particle, overriding GasComponent.stiffness

temperature property writable

temperature: float

Current temperature of this individual particle

thermal_diffusivity property writable

thermal_diffusivity: float

Heat diffusion rate for this individual particle, overriding GasComponent.thermal_diffusivity

velocity property writable

velocity: Vector3

Linear velocity of this particle

viscosity property writable

viscosity: float

Viscosity for this individual particle, overriding GasComponent.viscosity

vorticity_strength property writable

vorticity_strength: float

Vorticity confinement strength for this individual particle, overriding GasComponent.vorticity_strength

__repr__

__repr__() -> str

set_ambient_temperature

set_ambient_temperature(ambient_temperature: SupportsFloat | SupportsIndex) -> None

Set ambient_temperature. See the ambient_temperature property.

set_can_dissipate

set_can_dissipate(can_dissipate: bool) -> None

Set can_dissipate. See the can_dissipate property.

set_collision_radius

set_collision_radius(collision_radius: SupportsFloat | SupportsIndex) -> None

Set collision_radius. See the collision_radius property.

set_compliance

set_compliance(compliance: SupportsFloat | SupportsIndex) -> None

Set compliance. See the compliance property.

set_cooling_rate

set_cooling_rate(cooling_rate: SupportsFloat | SupportsIndex) -> None

Set cooling_rate. See the cooling_rate property.

set_drift_dir

set_drift_dir(drift_dir: Vector3) -> None

Set drift_dir. See the drift_dir property.

set_epsilon

set_epsilon(epsilon: SupportsFloat | SupportsIndex) -> None

Set epsilon. See the epsilon property.

set_gamma

set_gamma(gamma: SupportsFloat | SupportsIndex) -> None

Set gamma. See the gamma property.

set_has_split

set_has_split(has_split: bool) -> None

Set has_split. See the has_split property.

set_inverse_mass

set_inverse_mass(inverse_mass: SupportsFloat | SupportsIndex) -> None

Set inverse_mass. See the inverse_mass property.

set_mass

set_mass(mass: SupportsFloat | SupportsIndex) -> None

Set mass. See the mass property.

set_position

set_position(position: Vector3) -> None

Set position. See the position property.

set_radius_scale

set_radius_scale(radius_scale: SupportsFloat | SupportsIndex) -> None

Set radius_scale. See the radius_scale property.

set_rest_density

set_rest_density(rest_density: SupportsFloat | SupportsIndex) -> None

Set rest_density. See the rest_density property.

set_smoothing_radius

set_smoothing_radius(smoothing_radius: SupportsFloat | SupportsIndex) -> None

Set smoothing_radius. See the smoothing_radius property.

set_stiffness

set_stiffness(stiffness: SupportsFloat | SupportsIndex) -> None

Set stiffness. See the stiffness property.

set_temperature

set_temperature(temperature: SupportsFloat | SupportsIndex) -> None

Set temperature. See the temperature property.

set_thermal_diffusivity

set_thermal_diffusivity(thermal_diffusivity: SupportsFloat | SupportsIndex) -> None

Set thermal_diffusivity. See the thermal_diffusivity property.

set_velocity

set_velocity(velocity: Vector3) -> None

Set velocity. See the velocity property.

set_viscosity

set_viscosity(viscosity: SupportsFloat | SupportsIndex) -> None

Set viscosity. See the viscosity property.

set_vorticity_strength

set_vorticity_strength(vorticity_strength: SupportsFloat | SupportsIndex) -> None

Set vorticity_strength. See the vorticity_strength property.