PDA

View Full Version : particle query


brassi
06-06-2008, 02:14 PM
i don't know why,i can't make it work

for example

particle -e -at mass -fv 5 -id 5 particle1(or particleshape1) is working.

but querying this doesn't work on me

particle -q -at mass -id 5 particle1 . is not working . same error" mass is not recognized" or something like this. even the query examples of this kind,in mel command referance causes the same error massage.

long story short i want to query a particular attribute,based on its id,actualy i want to go there from parentId of ppemission particles,query the parent particle xxx atribute and pass it to child particles. i know i can do it with loops and if's,but why this is not working.

any ideas would be appreciated.

thank you.

ctp
06-06-2008, 02:28 PM
give this one a try instead...

getParticleAttr -at mass particleShape1.pt[5]

note however that it returns two values! the first value is what you'd want.

Don3Don
06-06-2008, 02:49 PM
oh, I was fooled by the doc before too.
type in this way would work.

particle -at mass -id 5 -q particle1

brassi
06-09-2008, 09:36 PM
don3don you are the man.thank you. one more question have you found it in some secret place,or trial and error.

thank you,this was cool.

ctp, thank you too.

Don3Don
06-10-2008, 08:24 AM
don3don you are the man.thank you. one more question have you found it in some secret place,or trial and error.

thank you,this was cool.

ctp, thank you too.

I've forgot how do I know that... maybe try and error.
recently I am doing the same thing with this method.
I use "getAttr particleShape1.sid" (sorted ID), then for-in loop to query each particle's attr.
but I always have strange error that sometimes it will report some id particles cannot be found....
it is strange that when I run the script online is fine, it can found that particles.
but run it offline, (pre/post mel). It will give me this error....

Aikiman
06-10-2008, 11:19 AM
I noticed this as well just recently where you can do this...

int $count = `particle -q -count particle1`;

but you have to query position like this...

float $pos[] = `particle -attribute position -id 5 -q particle1;

the inconsistancies can be very annoying.

CGTalk Moderation
06-10-2008, 11:19 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.