Addon ID

  • rtg_voxelmodel

Info

Statistics

  • Download count5 total downloads
  • Latest download count 1 downloads of latest version
  • Average download count1 downloads per day average

Owners

A list of all Actions, Conditions and Expressions supported in this addon.

Voxel model

  • Actions

    Load project file {0}

    Load a .vox file from the project's Files folder.

    Load from URL {0}

    Load a .vox file from a URL (must allow cross-origin access).

    Set projection to {0}

    Switch between orthographic and perspective camera.

    Set model scale to {0}%, {1}%, {2}%

    Set the extra scale of the model on each axis, in percent (100 = normal).

    Set model offset to {0}, {1}, {2}

    Shift the model inside its box, in pixels along the model's own axes.

    Set transform mode to {0}

    Change how the model is sized inside the object's box.

    Set ambient occlusion {0}

    Turn the soft shading in creases on or off.

    Replace colour {0} with {1} (tolerance {2}%)

    Change every model colour that matches a colour to another colour, for example to make colour variants of one model. Use rgb(r, g, b) for the colours. The change stays until Reset colours or a new model is loaded.

    Set palette colour {0} to {1}

    Change one colour of the model by its MagicaVoxel palette index (1-255).

    Reset model colours

    Bring back the colours stored in the .vox file.

    Remove voxel at ({0}, {1}, {2})

    Remove one voxel, for example where the model was hit. The cut goes through all animation frames. Restore voxels brings it back.

    Set voxel at ({0}, {1}, {2}) to palette colour {3}

    Put a voxel of a palette colour (1-255) at a position inside the model's box, or recolour the voxel that is there.

    Fill the hollow interior of the model

    Fill empty space enclosed inside the model (a hollow shell), so a hole cut into the surface shows a solid interior. Each new voxel takes the colour of the nearest voxel.

    Restore all voxels

    Bring back the voxels stored in the .vox file (undoes every removal and addition).

    Break apart from ({0}, {1}, {2}): strength {3}, gravity {4}, lifetime {5} s

    The whole model bursts into cubes that fly away from the explosion point, tumble and fall to the floor (the object's Z elevation). Use Restore voxels to get the model back. Works in 3D scene mode.

    Blast a hole of radius {3} at ({0}, {1}, {2}): strength {4}, gravity {5}, lifetime {6} s

    Voxels within a radius of a point are thrown off as debris and removed from the model, for example where it was hit.

  • Conditions

    On model loaded

    Triggered when a .vox file has finished loading.

    On model load failed

    Triggered when loading a .vox file failed. See LastError.

    Model is loaded

    True if a model is currently loaded.

    Option {0} is on

    True while the performance option is switched on (see Set option).

    On debris settled

    Triggered when all debris has come to rest (or has disappeared).

    Debris is moving

    True while pieces are still flying, sliding or turning.

    Path ({0}, {1}, {2}) to ({3}, {4}, {5}) hits the model (bullet radius {6})

    True when a straight path between two layout positions (for example a bullet's last and current position, each with X, Y and height Z) passes through a voxel. Picks the model instances that are hit, so the actions of the same event only affect those. Every voxel on the path is tested, so a bullet cannot skip a thin part. HitX, HitY and HitZ give the first voxel on the path.

    On debris landed (impact speed at least {0})

    Triggered each time a piece of debris hits the floor or the model hard enough, once per piece and per impact (a piece that bounces reports every bounce), strongest first and at most a few per tick (see Set landing limit). Read where and how hard with LandX, LandY, LandZ and LandSpeed, for example to play a sound.

    Hit was normal voxel

    True when the last Path hits model (or SegmentHit) of this model hit a voxel of the model (every voxel, in this edition). False when nothing was hit.

    On collapsed

    Triggered when the rest of the model falls apart because fewer voxels are left than Collapse below (see Collapse when few voxels are left). BrokenCount is how many voxels fell apart, BrokenX, BrokenY and BrokenZ where the middle of them was: use it for the sound of a collapse.

  • Expressions

    SizeX

    Model width in voxels.

    SizeY

    Model depth in voxels.

    SizeZ

    Model height in voxels.

    VoxelCount

    Number of voxels in the model.

    FaceCount

    Number of exposed voxel faces.

    VoxelAt

    Palette index (1-255) of the voxel at a 0-based position, or 0 if empty.

    LastError

    Message of the last load error.

    PaletteColour

    Colour of a palette index (1-255), as a number you can pass to the colour actions. Use GetRValue / GetGValue / GetBValue-style maths or compare it with rgb(r, g, b).

    VoxelsRemoved

    How many voxels have been removed from the model so far (in the current animation frame).

    DebrisCount

    Number of debris pieces that are still visible.

    WorldToVoxelX

    X index of the voxel cell at a layout position (0-based; can be outside the model).

    WorldToVoxelY

    Y index of the voxel cell at a layout position (0-based; can be outside the model).

    WorldToVoxelZ

    Z index of the voxel cell at a layout position (0-based; can be outside the model).

    HitIsGlass

    1 if the first voxel found by the last SegmentHit or Path hits model that returned true is glass, otherwise 0 (always 0 for a model that has Glass shatters switched off).

    GlassAt

    1 if the voxel at a layout position (X, Y and height Z) is glass, otherwise 0 (also 0 where there is no voxel, and for a model that has Glass shatters switched off).

    SolidAt

    1 if there is a voxel at a layout position (X, Y and height Z), otherwise 0. Use it to test where a bullet really hits the model.

    SegmentHit

    1 if a straight path from one layout position to another (for example a bullet's last and current position, each with X, Y and height Z) passes through a voxel, otherwise 0. Unlike SolidAt a fast bullet cannot jump over the model. When it returns 1, HitX, HitY and HitZ give the first voxel on the path.

    HitX

    Layout X of the first voxel found by the last SegmentHit that returned 1.

    HitY

    Layout Y of the first voxel found by the last SegmentHit that returned 1.

    HitZ

    Layout height (Z elevation) of the first voxel found by the last SegmentHit that returned 1.

    BoundsMinX

    Lowest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): X.

    BoundsMaxX

    Highest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): X.

    BoundsMinY

    Lowest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): Y.

    BoundsMaxY

    Highest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): Y.

    BoundsMinZ

    Lowest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): height (Z elevation).

    BoundsMaxZ

    Highest of the model's box in the layout (the whole voxel space of the model, following the object's angle, size and offset): height (Z elevation).

    DebrisFloor

    The height (Z) where debris comes to rest right now.

    DrawMs

    Milliseconds the plugin spends drawing this object per frame (building and sorting the geometry and handing the quads to the renderer), averaged over about ten frames. The graphics card's own time is not included. Use it to see whether the plugin is what slows the game down.

    QuadCount

    Number of quads (faces) the plugin handed to the renderer in the last frame, including debris. Fewer quads means less work for the engine and the graphics card.

    BuildMs

    Part of DrawMs spent building, culling and sorting the geometry for the camera (averaged over about ten frames; drops towards 0 when nothing needs rebuilding).

    SubmitMs

    Part of DrawMs spent handing the quads to the renderer (averaged over about ten frames). It grows with QuadCount.

    LandX

    Layout X of the landing that On debris landed is reporting.

    LandY

    Layout Y of the landing that On debris landed is reporting.

    LandZ

    Height (Z) of the landing that On debris landed is reporting.

    LandSpeed

    Impact speed (pixels per second) of the landing that On debris landed is reporting: use it for the volume of a sound.

    LandSurface

    What the piece hit: 0 = the floor, 1 = the model.

    RockBreakKind

    How the rock broke in the last On rock broken: 0 = the whole rock broke into its first pieces, 1 = a piece broke into smaller pieces, 2 = a piece crumbled into cubes.

    BrokenCount

    How many voxels broke in the hit that On voxels broken is reporting.

    BrokenX

    Layout X of the hit that On voxels broken is reporting.

    BrokenY

    Layout Y of the hit that On voxels broken is reporting.

    BrokenZ

    Height (Z) of the hit that On voxels broken is reporting.

    GpuMesh

    1 when the model was drawn from a mesh kept in the graphics card in the last frame (it stands still), 0 when it was drawn face by face.

    BuildInfo

    A short text that tells which features this build of the plugin has, for example when you are not sure that the newest addon file is the one that is loaded.

    Culled

    1 while the model is outside the view of the 3D Camera and is therefore skipped, otherwise 0. Use it to see whether a model that seems to disappear is being skipped.