The result from the previous script is a kind of “voxelized” representation of the objects in your scene, but the basic script has some annoying limitations regarding names. So here is an idea: what if it was possible to attach particles to the vertices instead of objects? These particles could then be meshed with the “Clone obj” method. This workflow would directly solve our problems without complex name checks.
Name | Particles2Vertices.rfs |
Type | Batch script |
Description | This script reads out the vertices of all objects in the scene and writes them into a list. The position data are then used to add and place particles at the object’s vertex location. |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
nullVelocity = Vector.new(0, 0, 0) emitter = scene.getEmitterget_PB_Emitter("Container01") objectList = scene.getObjects() for singleObject in objectList: vertexList = singleObject.getVertices() for singleVertex in vertexList: vertexPos = singleVertex.getPosition() emitter.addParticle(vertexPos, nullVelocity) |
...