PDA

View Full Version : Particle position


Nicool
05-07-2003, 11:51 PM
Hye,

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:

Nicool
05-07-2003, 11: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 ?

Jozvex
05-08-2003, 08: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:

Nicool
05-08-2003, 10: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.

:beer:

Jozvex
05-09-2003, 12:14 AM
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.

Nicool
05-09-2003, 03:01 PM
Ok, thanks :cool:

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

Als
05-10-2003, 11: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


Al

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);

}
else
{
$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);
};

};


end

Nicool
05-11-2003, 01: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-15-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.