Skip to main content

vJSONCreateAsset

Bundle points, edges, UVs, UV edges and a matrix into one vGeometry asset with a name, version, wire color and bounding box.

IntermediateMograph / JSONJSONArrayScriptVal
vJSONCreateAsset node

vJSONCreateAsset takes arrays on its Points, Edges, UVs, UV Edges and Matrix sockets and outputs one JSON asset of type vGeometry. The asset adds a name, a version, a wire color, a soft edge value and the bounding box of the points.

Parameters​

ParameterTypeDefaultDescription
Asset NameText—Name stored in the asset. An empty name becomes Object.
Asset VersionInteger1Version number stored in the asset. Default 1.
PointsText—Array of points to store.
EdgesText—Array of face or edge index lists to store.
UVsText—Array of texture coordinates to store.
+8 more parameters
ParameterTypeDefaultDescription
UV EdgesText—Array of UV index lists to store.
MatrixText—4x4 matrix as JSON text. Its list of numbers is stored in the asset.
RedFloat0.0Red level of the wire color. Default 0.
GreenFloat1.0Green level of the wire color. Default 1.
BlueFloat1.0Blue level of the wire color. Default 1.
AlphaFloat1.0Alpha level of the wire color. Range 0 to 1, default 1.
Soft EdgeFloat0Soft edge value stored in the asset. Minimum 0, default 0.
Show InputInteger1.0Shows or hides the input sockets and the Asset Name connection point. Default on.
Read the full description

The node collects the arrays that are connected and stores them in the asset under the names Points, Edges, UVs, UVEdges and Matrix. The Matrix is stored as its flat list of numbers. Sockets without a connection are stored as empty lists.

The asset also holds the Name from Asset Name, the Version from Asset Version, the color from Red, Green, Blue and Alpha, the Soft Edge value, the ID vGeometry and a new UUID. If Asset Name is empty or only a space or tab, the name Object is used. The UUID is created on every calculation, so it changes each time the node renders.

The bounding box is calculated from the points and stored as BBoxPoints and BBoxEdges. For three-value points it is the 8 corners of a box with 6 faces. For two-value points it is the 4 corners of a rectangle with 4 edges. For one-value points it is the minimum and maximum with one edge. The values in the bounding box are the minimum and the maximum of each axis, over all points.

The asset is the input of vJSONRenderAsset, which draws it as a 3D wireframe, and of vJSONRenderAssetSVG, which exports an SVG wireframe. The Show Input checkbox shows or hides the input sockets and the Asset Name connection point.

Example Connections​

vJSONPointsOnGrid.Output -> vJSONCreateAsset.ArrayPoints
vJSONCreateAsset.Output -> vJSONRenderAsset.Input