View Full Version : Particle position

05 May 2003, 10:51 PM

I've instanced geometries as particles.
For a still images, I want move the instanced object (eg. turn a bit more this one, and move this other one).
So, can we do a "batch" a action to have independant geometry placed where the emiter had placed them?

(Notice : with mel, you can't query the flag -position of the function particle )

Trying to be enough clear to be understand :cool:

05 May 2003, 10:55 PM
Mistake about the mel case
The function particleInstancer doesn't prevent to query -position.

So get the position of each instanced object, and then place a mesh on... But what about the rotation of the instanced object ?

05 May 2003, 07:21 AM
Well, in the instancing section of the attribute editor for particles there's an attribute called "Aim Direction" that controls the rotation of the instances, because particles don't really have rotation.

So for example setting Aim Direction to Velocity, makes the instances face the way the particle is moving. But you could write a per-particle expression to change individual instances directions, based on something like ParticleID.

Maybe?? Just a thought, :hmm:

05 May 2003, 09:27 AM
I wasn't clear :annoyed:

_An emiter emit particles.
_I want place a mesh on each particle.
(keeping the position, the rotation and the scale)
_I don't want my meshs move.
(I know the particle instancer)
_It's for a still image.

So I want use the particle as a "random" placer of mesh.
_Use mel like : a loop to get the position, rotation, scale, and put the mesh like this.
_Use a tool like : batch the particle instanced objects.


05 May 2003, 11:14 PM
Well, as far as I know particles don't use a rotation valuie because they're just points in space.

So without the instancer I have no idea.

05 May 2003, 02:01 PM
Ok, thanks :cool:

Note : I'm keen on your tutorials, and I'm waiting for the forwardings:bounce:

05 May 2003, 10:47 PM
Copy this in shef, select whatever you want
to copy to, then select last object you want
to copy, and click on it.

Hope this helps


here is is:

// Select vertex, particles, points, then as last an object to copy
string $objList[] = `ls -sl -flatten`;
int $end = `size ($objList)`;
$end -= 1;
string $thing = $objList[$end];

$count = 0;
for ($count; $count < $end; $count++)

string $nodeType = `nodeType ($objList[$count])`;

if ($nodeType == "particle")
//print "particle!\n";
select -r $objList[$count];
$ari=`getParticleAttr -at position $objList[$count]`;

string $mikx = $ari[0];
string $miky = $ari[1];
string $mikz = $ari[2];

select -cl;
select $thing;
string $name = ( "copy_of_" + $thing + "_" + $count );
duplicate -name ( $name) -rr -ic;
$mika = ( "move -rpr " + $mikx + " " + $miky + " " + $mikz + " " + $name );

eval ($mika);

$c2 = `xform -q -ws -t $objList[$count]`;
string $mikx = $c2[0];
string $miky = $c2[1];
string $mikz = $c2[2];
select -cl;
select $thing;
string $name = ( "copy_of_" + $thing + "_" + $count );
duplicate -name ( $name) -rr -ic;
$mika = ( "move -rpr " + $mikx + " " + $miky + " " + $mikz + " " + $name );

eval ($mika);



05 May 2003, 12:38 AM
Yes it's good, thanks. But as it was said, the particles has not any notion of rotation and scale...

Good application !

CGTalk Moderation
01 January 2006, 03:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.