List Input for Node Geometry Editor

I am using the Instantiate Linear block in the Node Geometry Editor. For each instance, I want to create a new Box with dimensions supplied from the input as an unbounded list like this [{width:5, height: 4}, {width:4, height: 3}, {width: 2, height:2}]…

How can I do this?

Can I use a PointList to supply the width and height, and if so, how would I iterate of the values and use the coordinates for my width and height - and not positions?

Thanks,
Michael

Something like that ?

Babylon.js Node Geometry Editor

In a nutshell: I use the point list to instantiate the box and have access to the scale I want

We only need to cancel the point list position and then use whatever method we want to position the cubes:

How can I access the number of items in the PointList?

visually it is simply by selecting the node and checking the properties on the right

by code: get the node and the property name is “points” which is a Vector3 array

Can I access the count as a value to perform a calculation in the node graph?

like the number of points? No but you can create an int input that will provide that value (up to you to set it up correctly off course)

lol and while I was typing it I had an idea! You can use the Geometry Info node to get the number of vertices ;D

1 Like

In the Node Geometry Editor, I have a point list with three vertices. After building the geometry, I want to update the point list to have four vertices, but I find that in stepping through the code, the points Array does not get updated:

const block = this._nodeGeometry?.getBlockByName(name);

if (block instanceof PointListBlock){

block.points = points;

}

this._nodeGeometry.updateMesh(this._mesh);

This is because you need to rebuild the geometry (the point list data is extracted at build time and store into internal data)