generate_particles
Generates a particles object using structured data supplied to the command. See below for the description of the particles format.
References:
arguments
- "name" : String
Name to give the object once generated
- "particles" : Data
Map representing particle data. The points property is an array of arrays of numbers. The length of the individual arrays must be equal and correspond to the number of numbers required to represent a particle of the type being created (e.g., spheres require 4 numbers). Optionally you can include a map property user whos property keys are the names of user data attribute vectors you wish to create. The values of the these properties must be either arrays of arrays of numbers or an array of numbers. The number of array values must match the number of particles being created. The size and type of each array element must be the same. You can specify multiple sets of user data, up to the limits imposed by Iray. The optional motion property is an array of arrays of Float32<3> vectors. The number of array values must match the number of particles being created. The number and type of vectors in each array must be equal. Below is an example for four particles with 2 sets of user data and motion vectors for each particle.
Note: When the particles object is created the object will not have its visible attribute set. You must call the element_set_attribute command to do so.
Example:{ "points" : [ [0.0, 0.0, 0.0, 0.2], [1.0, 0.0, 0.0, 0.1], [2.0, 0.0, 0.0, 0.3], [3.0, 0.0, 0.0, 0.4] ], "user" : { "Particle_color" : [ [0.7, 0.2, 0.2], [0.2, 0.7, 0.2], [0.2, 0.2, 0.7], [0.7, 0.2, 0.7] ], "Particle_opacity" : [ 0.7, 1.0, 0.2, 0.7 ] }, "motion" : [ [ {"x": 0.0,"y": 0.0,"z": 0.0}, {"x": 1.0,"y": 0.0,"z": 0.0} ], [ {"x": 0.0,"y": 0.0,"z": 0.0}, {"x": -1.0,"y": 0.0,"z": 0.0} ], [ {"x": 0.0,"y": 0.0,"z": 0.0}, {"x": 0.0,"y": 1.0,"z": 0.0} ], [ {"x": 0.0,"y": 0.0,"z": 0.0}, {"x": 0.0,"y": -1.0,"z": 0.0} ] ] }
The generate_particles command also accepts the optimized binary format generated by the geometry_get_particles command. See the documentation for that command for more details on this format. This format is automatically detected when the particles parameter contains the appropriate structure. - "type" : String (default: "sphere")
The type of particle geometry to be generated.
Possible Values:
- sphere
return value
VoidVoid.