sm.visualization
Associated object type: BlueprintVisualization
Visualization is used for visualizing game objects.
Functions:
sm.visualization.createBlueprint(path)
Client only
Create a BlueprintVisualization from a blueprint file path.
Parameters:
Type | Name | Description |
---|---|---|
string | path | A file path to the blueprint to be visualized |
Returns:
Type | Description |
---|---|
BlueprintVisualization | The blueprint visualization |
sm.visualization.createBlueprint(blueprintTable)
Client only
Create a BlueprintVisualization from a blueprint table.
Parameters:
Type | Name | Description |
---|---|---|
table | blueprintTable | Table with blueprint information to be visualized |
Returns:
Type | Description |
---|---|
BlueprintVisualization | The blueprint visualization |
sm.visualization.createBuilderGuide(path, shape, ignoreBlockUuid=false, completeEffectName="")
Client only
Create a builder guide BlueprintVisualization, comparing the creation from the root Shape to the blueprint give by path.
The builder guide blueprint contains stage indices based on shape color, stage color order is the same as the color order in the PaintTool color picker.
Parameters:
Type | Name | Description |
---|---|---|
string | path | A file path to the builder guide blueprint |
Shape | shape | Root Shape for comparing the creation from |
boolean | ignoreBlockUuid=false | Should block uuid be evaluated for stage completion |
string | completeEffectName="" | The name a effect that should be played once the builder guide is completed |
Returns:
Type | Description |
---|---|
BlueprintVisualization | The builder guide blueprint visualization |
sm.visualization.getShapePlacementVisualization()
Client only
Returns a table containing the current state of the shape placement visualization.
Returns:
Type | Description |
---|---|
table | Table containing { worldPosition = Vec3, worldRotation = Quat, shapeUuid = Uuid, isLegal = boolean }. |
sm.visualization.setBlockVisualization(position, illegal=false, shape)
Client only
Visualizes a block on a shape
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | position | The local space position |
boolean | illegal=false | Whether the visualization should render as illegal |
Shape | shape | Shape to visualize on |
sm.visualization.setBlockVisualization(position, illegal=false, joint)
Client only
Visualizes a block on a joint
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | position | The local space position |
boolean | illegal=false | Whether the visualization should render as illegal |
Joint | joint | joint to visualize on |
sm.visualization.setBlockVisualization(position, illegal=false)
Client only
Visualizes a block in world space
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | position | The world space position |
boolean | illegal=false | Whether the visualization should render as illegal |
sm.visualization.setCreationBodies(bodies)
Client only
Sets an array of bodies to visualize.
Parameters:
Type | Name | Description |
---|---|---|
table | bodies | Array of bodies to visualize {Body, ..}. |
sm.visualization.setCreationFreePlacement(valid)
Client only
Controls the transform of the creation visualization. If true the visualization will render using setFreePlacementPosition/setFreePlacementRotation functions.
If false the visualization will render on top of the creation.
Parameters:
Type | Name | Description |
---|---|---|
boolean | valid | Should the creation visualization be free placement |
sm.visualization.setCreationFreePlacementPosition(position)
Client only
Set the world position of the creation visualization. Only works if setFreePlacement is true.
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | position | World position of the creation visualization |
sm.visualization.setCreationFreePlacementRotation(index)
Client only
Set the rotation index of the creation visualization. Only works if setFreePlacement is true.
Parameters:
Type | Name | Description |
---|---|---|
integer | index | Index to rotate the creation visualization with |
sm.visualization.setCreationValid(valid, lift=false)
Client only
Controls the rendering of the creation visualization.
Parameters:
Type | Name | Description |
---|---|---|
boolean | valid | Should the visualization should render be valid |
boolean | lift=false | Should the visualization should render be lift or place |
sm.visualization.setCreationVisible(visible)
Client only
Controls the visibility of the creation visualization
Parameters:
Type | Name | Description |
---|---|---|
boolean | visible | Should the creation visualization be visible |
sm.visualization.setLiftLevel(level)
Client only
Set the lift level of the lift visualization.
Parameters:
Type | Name | Description |
---|---|---|
integer | level | The level of the lift |
sm.visualization.setLiftPosition(position)
Client only
Set the world position of the lift visualization.
Parameters:
Type | Name | Description |
---|---|---|
Vec3 | position | World position of the lift visualization |
sm.visualization.setLiftValid(valid)
Client only
Controls the rendering of the lift visualization.
Parameters:
Type | Name | Description |
---|---|---|
boolean | valid | Whether the visualization should render as valid |
sm.visualization.setLiftVisible(visible)
Client only
Controls the visibility of the lift visualization
Parameters:
Type | Name | Description |
---|---|---|
boolean | visible | Whether the lift visualization is visible |