Message 1 of 4
Move object to a position stored in an array

Not applicable
08-18-2017
03:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a vector array that contains the positions of particles in a scene.
I would like to create spheres at every particle position.
Can someone tell me why this code isn't working? I'm getting "Error while parsing arguments", which isn't very informative.
int $numberOfParticles = `getAttr particleShape1.count`; for ($i=0; $i <= $numberOfParticles; $i++) { polySphere -radius 0.2; move $particlesPos[$i]; }
particlesPos is the global array that contains the positions, and in itself it works fine (prints positions with no problem).
One note, I know I can use the instancer, but I'm trying to learn MEL so this is just an exercise.