Skip to content

FxVoxelLayer ​

This module contains functions for modifying nodes of type VoxelLayer and VoxelFrame.

INFO

Source grids and voxels define the data on which the functions of this module operate.

A source node is any VoxelLayer or VoxelFrame node identified by the specified NodeID.

A source grid refers to the voxel grid of a source node. If a function takes an LOD as an argument, the voxel grid for that LOD is considered the source grid. Otherwise, all voxel grids for all LODs are affected. If the LOD is not LOD0 and the source node does not have manual LOD enabled, LOD0 is used instead.

The source voxels are all voxels within the source grid, unless the NodeID wildcard /a is used and the active node is a VoxelLayer or VoxelFrame with selected voxels. In this case, only the selected voxels are treated as the source voxels.

Load ​

lua
FxVoxelLayer = require "FxVoxelLayer";

Functions ​

FunctionDescription
Bevel (NodeID, LOD)Smooths the edges of a voxel grid.
BrightnessContrast (NodeID, LOD, Brightness, Contrast)Adjusts the brightness and contrast of the voxel grid.
Clear (NodeID, LOD)Removes voxels from the specified grid.
ClearDifference (NodeID, IntersectingID)Removes voxels that do not intersect with the specified ID.
ClearIntersection (NodeID, IntersectingID)Removes voxels that intersect with the specified ID.
ColorOverlay (NodeID, LOD, Color, Opacity)Blends the voxel colors with a specified overlay color.
CopyIntersection (NodeID, LOD, IntersectingID)Copies voxels that intersect with the specified ID.
Crop (NodeID, LOD, X, Y, Z, Width, Height, Depth)Crops the voxel grid to the specified dimensions.
Desaturate (NodeID, LOD)Desaturates the colors of the voxels.
Detach (NodeID)Moves selected voxels to a new layer, detaching them from the current layer.
Downsample (NodeID, LOD)Reduces the resolution of the voxel grid LOD.
Fill (NodeID, LOD, Voxel)Fills the grid with solid voxels of the specified type.
FillCore (NodeID, LOD, Voxel)Fills the core of the voxel grid with the specified voxel type.
FillHollows (NodeID, LOD, Voxel)Fills hollow areas of the grid with the specified voxel type.
FillColor (NodeID, LOD, Color)Sets the color of the voxels in the grid.
FillMaterial (NodeID, LOD, Material)Sets the material type for the voxels in the grid.
Flip (NodeID, LOD, Axis)Flips the voxel grid along the specified axis.
Hollow (NodeID, LOD)Removes enclosed voxels, creating hollow spaces.
HueSaturation (NodeID, LOD, Hue, Saturation, Lightness)Adjusts the hue, saturation, and lightness of the voxel colors.
InvertColors (NodeID, LOD)Inverts the colors of the voxels.
LoadPrefab (NodeID, PrefabID)Loads a predefined voxel structure (prefab).
LoadScan (NodeID, AssetID, ScanBoxID)Loads a voxel scan from the specified asset and Scan Box.
Merge (NodeID1, NodeID2)Merges two voxel layers into one.
Mirror (NodeID, LOD, Direction)Mirrors the voxel grid in the specified direction.
OptimizeSize (NodeID, LOD)Removes empty areas to optimize the size of the voxel grid.
ReduceColors (NodeID, LOD, ColorCount)Reduces the number of distinct colors used in the voxel grid.
RemoveSlopes (NodeID, LOD, Replace)Removes sloped voxels, optionally replacing them with a specified voxel type.
ReplaceColor (NodeID, LOD, Color, ReplacementColor)Replaces specified colors in the voxel grid with a new color.
ReplaceMaterial (NodeID, LOD, Material, ReplacementMaterial)Replaces specified materials in the voxel grid with a new material.
Resize (NodeID, LOD, X, Y, Z, AnchorX, AnchorY, AnchorZ, Resample)Resizes the voxel grid based on specified dimensions and anchor points.
Rotate (NodeID, LOD, X, Y, Z)Rotates the voxel grid arbitrarily around the specified axes.
Rotate90 (NodeID, LOD, Axis, Steps)Rotates the voxel grid in 90° increments around the specified axis.
SavePrefab (NodeID, PrefabID)Saves the current voxel grid as a prefab for future use.
Scale (NodeID, LOD, X, Y, Z)Scales the voxel grid by the specified factors along each axis.
ScaleToFit (NodeID, LOD, X, Y, Z, AnchorX, AnchorY, AnchorZ)Resizes the voxel grid and scales its contents to fit the new dimensions.
Shear (NodeID, LOD, Axis, ShearFactor1, ShearFactor2)Applies a shear transformation to the voxel grid along the specified axis.
Translate (NodeID, LOD, X, Y, Z)Offsets the position of the voxels in the grid by the specified amounts.
Upsample (NodeID, LOD)Increases the resolution of the voxel grid LOD.
WrapAround (NodeID, LOD, X, Y, Z)Offsets voxels, moving those pushed out to the opposite side of the grid.

Bevel (NodeID, LOD) ​

This function automatically smoothes the edges of the source grid by replacing edge voxels with the best-fitting slope.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- auto-bevel LOD0 of layer1
FxVoxelLayer.Bevel("layer1", 0);

BrightnessContrast (NodeID, LOD, Brightness, Contrast) ​

This function roughly adjusts the brightness and contrast of the source grid. For each source voxel the adjusted color is calculated, then the index color that best matches the calculated color is determined and assigned to the voxel.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • Brightness: The brightness shift, clamped to [-1.0, 1.0]
  • Contrast: The contrast shift, clamped to [-1.0, 1.0]

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- shift brightness of layer1:LOD0 by 0.5
FxVoxelLayer.BrightnessContrast("layer1", 0, 0.5, 0);

Clear (NodeID, LOD) ​

This function deletes all source voxels.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- delete all voxels of the LOD0 voxel grid of layer1
FxVoxelLayer.Clear("layer1", 0);

ClearDifference (NodeID, IntersectingID) ​

This function deletes all voxels of the source grid that don't intersect with any voxel of the specified intersecting node. If the nodes are not axis-aligned, then the intersecting node’s grid will be transformed.

Parameters ​

  • NodeID: The NodeID of the source node, can't be a VoxelFrame node
  • IntersectingID: The NodeID to identify the intersecting VoxelObject nodes

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ClearDifference("layer1", "layer2");

ClearIntersection (NodeID, IntersectingID) ​

This function deletes all voxels of the source grid that intersect with any voxel of the specified intersecting node. If the nodes are not axis-aligned, then the intersecting node’s grid will be transformed.

Parameters ​

  • NodeID: The NodeID of the source node, can't be a VoxelFrame node
  • IntersectingID: The NodeID to identify the intersecting VoxelObject nodes

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ClearIntersection("layer1", "layer2");

ColorOverlay (NodeID, LOD, Color, Opacity) ​

This function roughly blends the source grid with a color and opacity. For each source voxel, the adjusted color is calculated, then the index color that best matches the calculated color is determined and assigned to the voxel.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
color = FxColor.CreateFromHex("ff00ff");
FxVoxelLayer.ColorOverlay("layer1", 0, color, 0.5);

CopyIntersection (NodeID, IntersectingID) ​

This function copies all voxels of the specified intersecting node that intersect with the source grid. If the nodes are not axis-aligned, then the intersecting node’s grid will be transformed.

Parameters ​

  • NodeID: The NodeID of the source node, can't be a VoxelFrame node
  • IntersectingID: The NodeID to identify the intersecting VoxelObject nodes

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.CopyIntersection("layer1", "layer2");

Crop (NodeID, LOD, X, Y, Z, Width, Height, Depth) ​

This function cuts off areas of the source grid outside of the specified box.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The X coordinate of the box position
  • Y: The Y coordinate of the box position
  • Z: The Z coordinate of the box position
  • Width: The box width
  • Height: The box height
  • Depth: The box depth

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Crop("layer1", 0, 5, 5, 5, 10, 10, 10);

Desaturate (NodeID, LOD) ​

This function roughly reduces the saturation of the source grid to 0.0. For each source voxel the adjusted color is calculated, then the index color that best matches the calculated color is determined and assigned to the voxel.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Desaturate("layer1", 0);

Detach (NodeID) ​

This function moves all selected voxels from the LOD0 grid of the specified node to a new VoxelLayer node. Possible voxel selections in LOD1 to LOD3 are ignored. The new layer is initialized not to use manual LOD. The specified node can't be a VoxelFrame node.

Parameters ​

  • NodeID: The NodeID of the VoxelLayer node, can't be a VoxelFrame node

Returns ​

The NodeID of the new VoxelLayer node

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Detach("layer1");

Downsample (NodeID, LOD) ​

This function replaces the source grid with a downsampled voxel grid of the next higher LOD.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- replace LOD1 with a downsample of LOD0
FxVoxelLayer.Downsample("layer1", 1);

Fill (NodeID, LOD, Voxel) ​

This function replaces all solid source voxels with the specified voxel.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
voxel = FxVoxel.Create(0, 0);
FxVoxelLayer.Fill("layer1", 1, voxel);

FillColor (NodeID, LOD, Color) ​

This function assigns the given color to all source voxels.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_ITEM_INDEX_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.FillColor("layer1", 0, 10);

FillCore (NodeID, LOD, Voxel) ​

This function replaces all core voxels of the source grid with the specified voxel. If the voxel is a slope, it will be converted to a cube.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
voxel = FxVoxel.Create(0, 0);
FxVoxelLayer.FillCore("layer1", 1, voxel);

FillHollows (NodeID, LOD, Voxel) ​

This function replaces all air core voxels of the source grid with the specified voxel. If the voxel is a slope, it will be converted to a cube.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
voxel = FxVoxel.Create(0, 0);
FxVoxelLayer.FillHollows("layer1", 1, voxel);

FillMaterial (NodeID, LOD, Material) ​

This function assigns the given material to all source voxels.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_ITEM_INDEX_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.FillMaterial("layer1", 0, 1);

Flip (NodeID, LOD, Axis) ​

This function flips the source voxels, both in its shape and relative position.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Flip("layer1", 0, 1);

Hollow (NodeID, LOD) ​

This function deletes all fully enclosed source voxels.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Hollow("layer1", 0);

HueSaturation (NodeID, LOD, Hue, Saturation, Lightness) ​

This function roughly adjusts the hue, saturation, and lightness of the source grid. For each source voxel, the adjusted color is calculated, then the index color that best matches the calculated color is determined and assigned to the voxel. The hue, saturation, and lightness values range from 0.0 to 1.0.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • Hue: The hue shift, clamped to [-1.0, 1.0]
  • Saturation: The saturation shift, clamped to [-1.0, 1.0]
  • Lightness: The lightness shift, clamped to [-1.0, 1.0]

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.HueSaturation("layer1", 0, -0.2, -0.5, 0);

InvertColors (NodeID, LOD) ​

This function roughly inverts the colors of the source grid. For each source voxel the adjusted color is calculated, then the index color that best matches the calculated color is determined and assigned to the voxel.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.InvertColors("layer1", 0);

LoadPrefab (NodeID, PrefabID) ​

This function replaces the source grids with the voxel grids of the specified Prefab.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_FILE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- open prefab package "furniture"
FxFile.Open(445, "furniture");
-- create new voxel layer
nodeid = FxNode.Create(11);
-- load prefab "chair" from package
FxVoxelLayer.LoadPrefab(nodeid, "chair");

LoadScan (NodeID, AssetID, ScanBoxID) ​

This function replaces the source grids with the voxel data of a scan created with the specified Scan Box. If ScanBoxID is an empty string, the default Scan Box of the specified asset is used.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • AssetID: The FileID of the source asset
  • ScanBoxID: The NodeID of the Scan Box node contained in the source asset

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_FILE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- create new voxel layer
nodeid = FxNode.Create(11);
-- load scan
FxVoxelLayer.LoadScan(nodeid, "asset1", "scanbox1");

Merge (NodeID1, NodeID2) ​

This function merges the two grids of the given nodes and deletes the second node. If the nodes are not axis-aligned, then the second node's grid will be transformed. If the second node has children, they are parented to the parent of the second node.

Parameters ​

  • NodeID1: The NodeID of the first VoxelLayer node
  • NodeID2: The NodeID of the second node, can be any VoxelObject node

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Merge("layer1", "layer2");

Mirror (NodeID, LOD, Direction) ​

This function mirrors one half of the source grid to the other depending on the given direction.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- mirror bottom to top
FxVoxelLayer.Mirror("layer1", 0, 3);

OptimizeSize (NodeID, LOD) ​

This function cuts the surrounding empty areas from the source grid.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.OptimizeSize("layer1", 0);

ReduceColors (NodeID, LOD, ColorCount) ​

This function reduces the number of colors used in the specified source voxels.

Parameters ​

  • NodeID: The NodeID that identifies the source nodes.
  • LOD: The level of detail (LOD) for the voxel grid.
  • ColorCount: The target number of colors to be used in the voxel grid.

Errors ​

Possible errors include: FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID.

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ReduceColors("layer1", 0, 10);

RemoveSlopes (NodeID, LOD, Replace) ​

This function deletes all sloped source voxels or replaces them with cubes.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • Replace: Whethter to replace all sloped voxels with cubes, or to delete them

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.RemoveSlopes("layer1", 0, true);

ReplaceColor (NodeID, LOD, Color, ReplacementColor) ​

This function assigns given ReplacementColor to all source voxels that have Color assigned.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_ITEM_INDEX_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ReplaceColor("layer1", 0, 0, 1);

ReplaceMaterial (NodeID, LOD, Material, ReplacementMaterial) ​

This function assigns the specified new material to all source voxels that have Material assigned.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_ITEM_INDEX_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ReplaceMaterial("layer1", 0, 0, 1);

Resize (NodeID, LOD, X, Y, Z, AnchorX, AnchorY, AnchorZ) ​

This function resizes the source grid from given anchors.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The new voxel grid width
  • Y: The new voxel grid height
  • Z: The new voxel grid depth
  • AnchorX: The X-axis Anchor
  • AnchorY: The Y-axis Anchor
  • AnchorZ: The Z-axis Anchor

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Resize("layer1", 0, 20, 30, 40, 0, 0, 0);

Rotate (NodeID, LOD, X, Y, Z) ​

This function rotates the source grid arbitrarily. All sploped voxels are converted to cubes.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The X-axis rotation angle in degrees
  • Y: The Y-axis rotation angle in degrees
  • Z: The Z-axis rotation angle in degrees

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Rotate("layer1", 0, 45, 0, 0);

Rotate90 (NodeID, LOD, Axis, Steps) ​

This function rotates the source grid by the specified number of 90° steps.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • Axis: The rotation Axis3D
  • Steps: The number of 90° rotation steps

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Rotate90("layer1", 0, 1, 1);

SavePrefab (NodeID, PrefabID) ​

This function replaces the voxel grids of the specified Prefab with the voxel grids of the specified VoxelLayer node.

Parameters ​

  • NodeID: The NodeID of the VoxelLayer node
  • PrefabID: The FileID of the target Prefab

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_FILE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- open package
FxFile.Open(445, "mypackage");
-- create new prefab in open package
fileid = FxFile.Create(444);
-- save layer1 to new prefab
FxVoxelLayer.SavePrefab("layer1", fileid);

Scale (NodeID, LOD, X, Y, Z) ​

This function scales the source grid. All sploped voxels are converted to cubes.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The X-axis scaling
  • Y: The Y-axis scaling
  • Z: The Z-axis scaling

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Scale("layer1", 0, 0.2, 0.2, 0.2);

ScaleToFit (NodeID, LOD, X, Y, Z, AnchorX, AnchorY, AnchorZ) ​

This function resizes the source grid from given anchors and scales its content to fit the new size.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The new voxel grid width
  • Y: The new voxel grid height
  • Z: The new voxel grid depth
  • AnchorX: The X-axis Anchor
  • AnchorY: The Y-axis Anchor
  • AnchorZ: The Z-axis Anchor

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.ScaleToFit("layer1", 0, 20, 30, 40, 0, 0, 0);

Shear (NodeID, LOD, Axis, ShearFactor1, ShearFactor2) ​

This function skews the source grid. All sploped voxels are converted to cubes.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • Axis: The shear Axis3D
  • ShearFactor1: The shear factor 1 (e.g. if axis is X then this is the shear factor for the Y-axis)
  • ShearFactor2: The shear factor 2 (e.g. if axis is X then this is the shear factor for the Z-axis)

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Shear("layer1", 0, 0, 1.0, 1.0);

Translate (NodeID, LOD, X, Y, Z) ​

This function offsets the position of the source voxels.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The X-axis offset
  • Y: The Y-axis offset
  • Z: The Z-axis offset

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.Translate("layer1", 0, 10, 0, 0);

Upsample (NodeID, LOD) ​

This function replaces the source grid with an upsampled voxel grid from the next lower LOD.

Parameters ​

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
-- replace lod0 with upsample of lod1
FxVoxelLayer.Upsample("layer1", 0);

WrapAround (NodeID, LOD, X, Y, Z) ​

This function offsets the grid position of source voxels. The voxels that are pushed out are moved to the opposite side.

Parameters ​

  • NodeID: The NodeID to identify the source nodes
  • LOD: The voxel grid LOD
  • X: The X-axis offset
  • Y: The Y-axis offset
  • Z: The Z-axis offset

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
FxVoxelLayer.WrapAround("layer1", 0, 10, 0, 0);