Plugin for Godot 3

Requirements

  • Godot 3.3 or higher

Installation

  1. Extract the addons folder from the archive.
  2. Move the addons folder into your project's root folder.
  3. Start Godot and enable the plugin in the project settings.

Usage

Importing An Effect

Save the effect you created in Pixelpart as a .ppfx file and place it in a folder inside your Godot project. Then in Godot, import the effect file as a Pixelpart Effect. You can set a scale value here if the effect appears too small or too large when imported into Godot.

Godot3 Import

Playing An Effect

In order to actually play the effect, create a new PixelpartEffect2D node in your 2D scene (PixelpartEffect for 3D scenes) and move the imported effect asset onto the Effect field in the node's inspector window. The effect will now be played inside you game and you can use the effect node like any other CanvasItem or Spatial node.

Godot3 Play

Scripting

An effect and its particle emitters, particle types, force fields and colliders can be controlled dynamically from GDScript.

PixelpartEffect2D / PixelpartEffect

Property
Description
PixelpartEffectResource effectThe attached effect resource.
bool playingWhether the effect is currently playing or not.
bool loopWhether the effect restarts automatically after time loop_time.
float loop_timeTime after which the effect loops (only effective if loop = true).
float speedHow fast the effect is being played.
float frame_rateAt which rate the effect is simulated, in frames per second.
bool flip_hWhether the effect is flipped horizontally.
bool flip_vWhether the effect is flipped vertically.

Method
Description
void play(bool p)Starts playing the effect or pauses the effect if p = false.
void pause()Pauses the effect.
void restart()Restarts the effect and removes all existing particles.
void reset()Restarts the effect, but does not remove existing particles.
bool is_playing()Returns whether the effect is currently playing or is paused.
float get_time()Returns the time since the effect has started playing.
float get_import_scale()Returns the scale applied to the effect resource.
PixelpartParticleEmitter find_particle_emitter(String name)Returns the particle emitter with the given name or null if no particle emitter with this name exists.
PixelpartParticleType find_particle_type(String name)Returns the particle type with the given name or null if no particle type with this name exists.
PixelpartForceField find_force_field(String name)Returns the force field with the given name or null if no force field with this name exists.
PixelpartCollider find_collider(String name)Returns the collider with the given name or null if no collider with this name exists.
PixelpartParticleEmitter get_particle_emitter(int id)Returns the particle emitter with the given id or null if no particle emitter with this id exists.
PixelpartParticleType get_particle_type(int id)Returns the particle type with the given id or null if no particle type with this id exists.
PixelpartForceField get_force_field(int id)Returns the force field with the given id or null if no field field with this id exists.
PixelpartCollider get_collider(int id)Returns the collider with the given id or null if no collider with this id exists.
PixelpartParticleEmitter get_particle_emitter_at_index(int index)Returns the particle emitter at the given index, starting with 0, or null if no particle emitter exists at this index.
PixelpartParticleType get_particle_type_at_index(int index)Returns the particle type at the given index, starting with 0, or null if no particle type exists at this index.
PixelpartForceField get_force_field_at_index(int index)Returns the force field at the given index, starting with 0, or null if no force field exists at this index.
PixelpartCollider get_collider_at_index(int index)Returns the collider at the given index, starting with 0, or null if no collider exists at this index.

PixelpartParticleEmitter

Attribute
Description
float lifetime_startWhen the emitter becomes active, in seconds.
float lifetime_durationHow long the emitter stays active, in seconds.
bool repeatWhether the emitter continues to stay active after lifetime_duration has passed.
int shapeShape of the emitter area (POINT, LINE, ELLIPSE, RECTANGLE, PATH, ELLIPSOID, CUBOID, CYLINDER).
int distributionHow particles are distributed in the emitter area (UNIFORM, CENTER, HOLE, BOUNDARY).
int emission_modeHow particles are created over the lifetime of the emitter (CONTINUOUS, BURST_START, BURST_END).
int direction_modeIn which direction particles are accelerated towards in relation to the emitter area (FIXED, OUTWARDS, INWARDS).

Method
Description
int get_id()Returns the ID of the emitter.
int get_parent_id()Returns the ID of the parent particle type.
String get_name()Returns the name of the emitter.
bool is_active()Returns whether the emitter is active and spawns particles at the current point in time.
float get_local_time()Returns the time fraction the emitter has been active for, in range 0.0 (0%) to 1.0 (100%).
PixelpartCurve3 get_position()Returns the motion path of the emitter.
PixelpartCurve3 get_path()Returns the spawn path of the emitter if PATH is selected as the emitter shape.
PixelpartCurve3 get_size()Returns the curve describing the size of the emitter area.
PixelpartCurve3 get_orientation()Returns the curve describing the orientation of the emitter area in degrees.
PixelpartCurve3 get_direction()Returns the curve describing the emission direction in degrees.
PixelpartCurve get_spread()Returns the curve describing the variance in emission direction in degrees.

PixelpartParticleType

Attribute
Description
float lifespan_varianceHow much the lifespans of particles vary.
bool position_relativeWhether the position of particles is tied to the position of their emitter.
float motion_path_forceHow much the particles follow the motion path.
float velocity_varianceHow much the velocities of particles vary.
int rotation_modeRotation mode of particles (ANGLE, VELOCITY).
int alignment_modeTo which object or vector particles align (NONE, CAMERA, MOTION, EMISSION, EMITTER).
Vector3 rotation_varianceHow much the rotations of particles vary.
Vector3 angular_velocity_varianceHow much the angular velocities of particles vary.
Vector3 pivotThe point around which the particles rotates, relative to the particle center.
bool visibleWhether the particles of this particle type are visible.
int layerLayer on which the particles are drawn, starting at 0.
float size_varianceHow much the sizes of particles vary.
float color_hue_varianceHow much the hue of particles varies.
float color_saturation_varianceHow much the color saturation of particles varies.
float color_value_varianceHow much the color value of particles varies.
float opacity_varianceHow much the opacities of particles vary.

Method
Description
int get_id()Returns the ID of the particle type.
int get_parent_id()Returns the ID of the parent particle emitter.
String get_name()Returns the name of the particle type.
PixelpartCurve3 get_position()Returns the motion path of particles.
PixelpartCurve get_num_particles()Returns the curve describing the number of the particles spawned.
PixelpartCurve get_lifespan()Returns the curve describing the lifespan of particles.
PixelpartCurve get_initial_velocity()Returns the curve describing the starting velocity of particles.
PixelpartCurve get_acceleration()Returns the curve describing the acceleration of particles over their lifetime.
PixelpartCurve get_radial_acceleration()Returns the curve describing the radial acceleration of particles over their lifetime.
PixelpartCurve get_damping()Returns the curve describing the damping of particles over their lifetime.
PixelpartCurve3 get_initial_rotation()Returns the curve describing the starting rotation of particles.
PixelpartCurve3 get_rotation()Returns the curve describing the rotation of particles over their lifetime.
PixelpartCurve get_weight()Returns the curve describing the weight of particles over their lifetime.
PixelpartCurve get_bounce()Returns the curve describing the bounce of particles over their lifetime.
PixelpartCurve get_friction()Returns the curve describing the friction of particles over their lifetime.
int get_blend_mode()Returns the blend mode of the particles (NORMAL, ADDITIVE, SUBTRACTIVE).
PixelpartCurve get_initial_size()Returns the curve describing the starting size of particles.
PixelpartCurve3 get_size()Returns the curve describing the size of particles over their lifetime.
PixelpartGradient get_color()Returns the gradient describing the colors of particles over their lifetime.
PixelpartCurve get_initial_opacity()Returns the curve describing the initial opacity of particles.
PixelpartCurve get_opacity()Returns the curve describing the opacity of particles over their lifetime.
void spawn_particles(int count)Spawns count particles of this particle type.

PixelpartForceField

Attribute
Description
float lifetime_startWhen the force field becomes active, in seconds.
float lifetime_durationHow long the force field stays active, in seconds.
bool repeatWhether the force field continues to stay active after lifetime_duration has passed.
int typeType of the force field (POINT, AREA).
float direction_varianceHow much the force direction is allowed to vary between grid cells of the force field.
float strength_varianceHow much the force strength is allowed to vary between grid cells of the force field.

Method
Description
int get_id()Returns the ID of the force field.
String get_name()Returns the name of the force field.
bool is_active()Returns whether the force field is active.
float get_local_time()Returns the time fraction the force field has been active for, in range 0.0 (0%) to 1.0 (100%).
PixelpartCurve3 get_position()Returns the motion path of the force field.
PixelpartCurve3 get_size()Returns the curve describing the size of the force field.
PixelpartCurve3 get_orientation()Returns the curve describing the orientation of the force field.
PixelpartCurve3 get_direction()Returns the curve describing the force direction of the area force field.
PixelpartCurve get_strength()Returns the curve describing the strength of the force field.
void set_grid_size(int width, int height, int depth)Sets the number of cells in each dimension of the force field grid. Each cell of the grid varies in direction and strength determined by direction_variance and strength_variance.
int get_grid_width()Returns the number of grid cells on the X axis of the force field grid.
int get_grid_height()Returns the number of grid cells on the Y axis of the force field grid.
int get_grid_depth()Returns the number of grid cells on the Z axis of the force field grid.

PixelpartCollider

Attribute
Description
float lifetime_startWhen the collider becomes active, in seconds.
float lifetime_durationHow long the collider stays active, in seconds.
bool repeatWhether the collider continues to stay active after lifetime_duration has passed.

Method
Description
int get_id()Returns the ID of the collider.
String get_name()Returns the name of the collider.
bool is_active()Returns whether the collider is active.
float get_local_time()Returns the time fraction the collider has been active for, in range 0.0 (0%) to 1.0 (100%).
void add_point(Vector3 point)Adds a vertex to the collider at the given position.
void set_point(int index, Vector3 point)Sets the position of the given vertex.
void remove_point(int index)Removes the given vertex from the collider.
Vector3 get_point(int index)Returns the position of the given vertex.
int get_num_points()Returns the number of vertices.
PixelpartCurve get_bounce()Returns the curve describing the bounciness of the collider.
PixelpartCurve get_friction()Returns the curve describing the friction of the collider.

PixelpartCurve

Attribute
Description
int interpolationInterpolation applied to the curve (NONE, LINEAR, SPLINE).

Method
Description
float get(float t)Returns the (interpolated) value of the curve at time t (in range 0.0 to 1.0)
float get_point(int index)Returns the value of the curve point with the given index.
void set(float value)Sets the curve to a constant with value value.
void add_point(float t, float value)Adds a curve point at time t with value value.
void set_point(int index, float value)Sets the value of the curve point with the given index to value.
void move_point(int index, float delta)Adds delta to the value of the curve point with the given index.
void shift_point(int index, float delta)Moves the curve point with the given index forward or backward in time by delta.
void remove_point(int index)Removes the point with the given index from the curve.
void clear()Removes all points from the curve.
int get_num_points()Returns the number of curve points.
void move(float delta)Adds delta to the value of all curve points.
void shift(float delta)Moves all curve points forward or backward in time by delta.
void enable_adaptive_cache()Enables an adaptive cache, which resizes itself automatically if the number of curve points increases or decreases a lot.
void enable_fixed_cache(int size)Enables a fixed cache with the given size, which only stores up to size different values.
int get_cache_size()Returns the size of the cache.

PixelpartCurve3

Attribute
Description
int interpolationInterpolation applied to the path (NONE, LINEAR, SPLINE).

Method
Description
Vector3 get(float t)Returns the (interpolated) path point at time t (in range 0.0 to 1.0).
Vector3 get_point(int index)Returns the path point with the given index.
void set(Vector3 value)Sets the path to a constant point with position value.
void add_point(float t, Vector3 value)Adds a path point at time t with position value.
void set_point(int index, Vector3 value)Sets the position of the path point with the given index to value.
void move_point(int index, Vector3 delta)Adds delta to the position of the point with the given index.
void shift_point(int index, float delta)Moves the point with the given index forward or backward in time by delta.
void remove_point(int index)Removes the point with the given index from the path.
void clear()Removes all points from the path.
int get_num_points()Returns the number of path points.
void move(Vector3 delta)Adds delta to the position of all path points.
void shift(float delta)Moves all path points forward or backward in time by delta.
void enable_adaptive_cache()Enables an adaptive cache, which resizes itself automatically if the number of path points increases or decreases a lot.
void enable_fixed_cache(int size)Enables a fixed cache with the given size, which only stores up to size different values.
int get_cache_size()Returns the size of the cache.

PixelpartGradient

Attribute
Description
int interpolationInterpolation applied to the gradient (NONE, LINEAR, SPLINE).

Method
Description
Color get(float t)Returns the (interpolated) gradient color at time t (in range 0.0 to 1.0).
Color get_point(int index)Returns the color of the gradient mark with the given index.
void set(Color value)Sets the gradient to the constant color value.
void add_point(float t, Color value)Adds a gradient mark at time t with color value.
void set_point(int index, Color value)Sets the color of the gradient mark with the given index to value.
void move_point(int index, Color delta)Adds delta to the color of the gradient mark with the given index.
void shift_point(int index, float delta)Moves the gradient mark with the given index forward or backward in time by delta.
void remove_point(int index)Removes the gradient mark with the given index from the gradient.
void clear()Removes all marks from the gradient.
int get_num_points()Returns the number of gradient marks.
void move(Color delta)Adds delta to the color of all gradient marks.
void shift(float delta)Moves all gradient marks forward or backward in time by delta.
void enable_adaptive_cache()Enables an adaptive cache, which resizes itself automatically if the number of gradient marks increases or decreases a lot.
void enable_fixed_cache(int size)Enables a fixed cache with the given size, which only stores up to size different values.
int get_cache_size()Returns the size of the cache.

Platform Support

PlatformsArchitecturesSupported
Windowsx64, x86
Linuxx64, x86
macOSUniversal
Android
iOS
Web
Console