View Full Version : Particle CV depends on Locator
braam 08-11-2003, 10:35 AM I created a curve to make it softbody. I want to make one of particle point of particle/softbody curve depended on the positional information of locator.
But, the point is depended on the local position of the locator which produces undesired results.
I want to extract worldPosition information - readable attribute - of locator to use it instead, but the main problem is that I couldn't extract value from worldPosition attribute of locator.
Could anyone help me how to write command for that action?
My Expression:
P22 = locator
if (curve1ParticleShape.particleId == 22)
curve1ParticleShape.position = <<P22.translateX,P22.translateY,P22.translateZ>>;
Worked but the particle point positioned at undesired place.
I have tried this:
curve1ParticleShape.position = <<P22.worldPointX,P22.worldPointY,P22.worldPointZ>>;
It isn't working.
Any suggestions will be appreciated.
Cheers
Braam
|
|
loked
08-11-2003, 04:11 PM
I shouldnt be helping my competition, but I guess you're South African, so it's alright:) J/K
In order to get the worldspace of the locator, you can just use this:
float $ws[2]=`xform -q -t -ws locatorName`;
It will save it as an array, so you could then say
float $wsX=$ws[0];
float $wsY=$ws[1];
float $wsZ=$ws[2];
Now you have float variables for all your axis.
just point the particles position to the variables and it should follow it.
Let me know if it works!
By the way, do you work for Wicked Pixels??
later:wavey:
loked
boraddd
08-12-2003, 08:30 PM
i small addition to what loked said...
when you use, `particleShape1.position` you refer to its object space coordinates.. so you may want to use `particleShape1.worldPosition` instead....
braam
08-13-2003, 08:05 AM
Hi Loked,
Thanks for the tip, though I got alternative way to extract value from locator's worldposition attribute. I will check your tip and keep it for future use. Where are you working?
Yep, I am working at Wicked Pixels...but how do you know?
All the best
Braam :wavey:
Hi boraddd
I use particleShape.position and it worked well in conjuction with conditional statement (If particleId = 22 then...) Thanks for your time...
cheers
Braam
loked
08-13-2003, 08:22 AM
Hey Braam,
I work for and own a company called Back2Back. It's joburg based and has an alliance with Depth Animation. So basically we work from the same premises and lend each other our strengths.
Give me your email address and we can stay in contact that way.
Speak to you soon.
Cheers :wavey:
Judd (loked)
braam
08-13-2003, 09:29 AM
My email address is braam@wickedpixels.com
mark_wilkins
08-13-2003, 05:13 PM
It's probably better to use connections in the dependency graph rather than xform if you want Maya to update correctly whenever you move the locator. This also can speed up dependency graph evaluation a LOT if you're constraining the locator to something else.
To do this:
1) Use a matrix multiply utility node to get the product of the world space transform matrix and the local translate of the locator.
2) Connect the matrix multiply output to custom attributes on the particle node.
3) Reference those custom attributes directly in a particle expression to set a per-particle goal position for the particle. (The dynamics engine likes it better if you set goal locations rather than setting position directly.)
-- Mark
loked
08-13-2003, 09:32 PM
The advantages of CGtalk:
You get Mark to answer your question and make all those that tried seem like they dont know what they're doing :beer:
Later:wavey:
loked
mark_wilkins
08-13-2003, 09:45 PM
I should have added the caveat that most people would just use xform and it would work great most of the time -- it's only where there are hundreds of these things in your scene or you're really frustrated with glitches in the interactivity that you'd want to do it the other way.
-- Mark
CGTalk Moderation
01-15-2006, 08:00 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.