Skip to main content

sm.visualization

Associated object type: BlueprintVisualization

A visualization is used for visualizing game objects.

Functions

createBlueprint

sm.visualization.createBlueprint( blueprint )
Client-Only

Creates a Blueprint Visualization from blueprint data.

Arguments:
  • blueprint [ string/table ]: The path to the blueprint file OR the table containing blueprint data.
Returns:

createBuilderGuide

sm.visualization.createBuilderGuide( path, shape, ignoreBlockUuid, completeEffectName )
Client-Only

Creates a builder guide Blueprint Visualization, comparing the creation from the root Shape to the given blueprint.

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.

Arguments:
  • path [ string ]: The file path to the builder guide blueprint.
  • shape [ Shape ]: The root Shape for comparing the creation from.
  • ignoreBlockUuid [ bool ]: Whether the block UUID should be evaluated for stage completion. Defaults to false.
  • completeEffectName [ string ]: The name of the effect to play when the guide is completed. Defaults to none.
Returns:

setBlockVisualization

sm.visualization.setBlockVisualization( position, illegal, target )
Client-Only

Visualizes a block.

Arguments:
  • position [ Vec3 ]: The world position of the block. Local position if using a target.
  • illegal [ bool ]: Whether the visualization should render as illegal.
  • target [ Shape / Joint / nil ]: The target shape or joint. Defaults to none (visualizes in world space).

getShapePlacementVisualization

sm.visualization.getShapePlacementVisualization()
Client-Only

Returns a table containing the current state of the shape placement visualization.

Returns:
  • [ table ]: The state of the visualization.

setCreationBodies

sm.visualization.setCreationBodies( bodies )
Client-Only

Sets an array of bodies to visualize.

Arguments:
  • bodies [ table ]: The array of bodies to visualize.

setCreationFreePlacement

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.

Arguments:
  • valid [ bool ]: The transform state.

setCreationFreePlacementPosition

sm.visualization.setCreationFreePlacementPosition( pos )
Client-Only

Set the world position of the creation visualization. Only works setFreePlacement is true.

Arguments:
  • pos [ Vec3 ]: The visualization position.

setCreationFreePlacementRotation

sm.visualization.setCreationFreePlacementRotation( index )
Client-Only

Set the rotation index of the creation visualization. Only works setFreePlacement is true.

Arguments:
  • index [ int ]: The rotation index.

setCreationValid

sm.visualization.setCreationValid( valid, lift )
Client-Only

Controls the rendering of the creation visualization.

Arguments:
  • valid [ bool ]: Whether the visualization should be rendered as valid or invalid.
  • lift [ bool ]: Whether the visualization should render a lift (?).

setCreationVisible

sm.visualization.setCreationVisible( visible )
Client-Only

Controls the visibility of the creation visualization.

Arguments:
  • visible [ bool ]: Whether the visualization should be visible or not.

setLiftLevel

sm.visualization.setLiftLevel( level )
Client-Only

Sets the lift level of the lift visualization.

Arguments:
  • level [ int ]: The level of the lift.

setLiftPosition

sm.visualization.setLiftPosition( pos )
Client-Only

Sets the lift position of the lift visualization.

Arguments:
  • pos [ Vec3 ]: The position of the lift.

setLiftValid

sm.visualization.setLiftValid( valid )
Client-Only

Controls the rendering of the lift visualization.

Arguments:
  • valid [ bool ]: Whether the lift renders as valid or invalid.

setLiftVisible

sm.visualization.setLiftVisible( visible )
Client-Only

Controls the visibility of the lift visualization.

Arguments:
  • visible [ bool ]: Whether the lift is visible or not.