Curve point constraint
Curve point constraint
Hey, guys.
I have a curve and i need to constrain it's different points to some different objects' position (in python) so their movement would animate the curve as-well.
I know you can do that easily in 3DS Max, but I couldn't find such type of constraint in SoftImage.
Any suggestions? For some reason I think it's not as difficult as I imagine.
I have a curve and i need to constrain it's different points to some different objects' position (in python) so their movement would animate the curve as-well.
I know you can do that easily in 3DS Max, but I couldn't find such type of constraint in SoftImage.
Any suggestions? For some reason I think it's not as difficult as I imagine.
Re: Curve point constraint
Select Point(s) > MCP Edit > Cluster with Center
Then animate that center.
Then animate that center.
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Curve point constraint
Or just envelope it using those objects as deformers, a lot cleaner than multiple deformers/clusters.
Re: Curve point constraint
envelope is way faster than cluster center!
Re: Curve point constraint
I wonder why... isn't it the simpler algorithm? No weights and such.Ahmidou wrote:envelope is way faster than cluster center!
Re: Curve point constraint
There is, you can modulate a cluster center op with a weight map, there also is some matrix multiplications for the offset,
and I'm not sure this operator is multitreaded.
and I'm not sure this operator is multitreaded.
Re: Curve point constraint
Thanx for the tips.
But how do I envelope them through python?
I've just started working with SoftImage about 3 months ago with some specific tasks, so sorry for dumb questions. Didn't have a chance to work with enveloping yet. For me it's still new.
But how do I envelope them through python?
I've just started working with SoftImage about 3 months ago with some specific tasks, so sorry for dumb questions. Didn't have a chance to work with enveloping yet. For me it's still new.
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Curve point constraint
General recipe: Do it manually and check the command log, look for those commands in the SDK docs and you will know how to implement it ;)
http://download.autodesk.com/global/doc ... exEnv.html
Cheers!
http://download.autodesk.com/global/doc ... exEnv.html
Cheers!
Re: Curve point constraint
Everything worked fine. Thanks again!
... on second thought, somethings still wrong What I did is just created the envelope, adjusted the weights and used XSI's generated script.
But it doesn't seem to work this way. What could be wrong?
By "Argument 0 is invalid" it's pointing to "crvlist.pnt[0]", which is the first point of a curve. What's wrong with that?
... on second thought, somethings still wrong What I did is just created the envelope, adjusted the weights and used XSI's generated script.
But it doesn't seem to work this way. What could be wrong?
By "Argument 0 is invalid" it's pointing to "crvlist.pnt[0]", which is the first point of a curve. What's wrong with that?
Re: Curve point constraint
The argument error points to the envelope weights property.
(see documentation: http://download.autodesk.com/global/doc ... vWght.html)
Here's a version that should work:
Ideally, you'll want to use the object model for changing weights instead of running the ModifyFlexEnvWght command. See:
http://download.autodesk.com/global/doc ... ights.html
(see documentation: http://download.autodesk.com/global/doc ... vWght.html)
Here's a version that should work:
Code: Select all
A = Application
op = A.ApplyFlexEnv("crvlist;sphere,sphere1,sphere2,sphere3,sphere4", "", 2)
env_weightcls = op(0).Parent
A.SIModifyFlexEnvWght(env_weightcls, "sphere", "crvlist.pnt[0]", 0)
http://download.autodesk.com/global/doc ... ights.html
Re: Curve point constraint
That worked perfectly. But what did you do here?Chris_TC wrote:The argument error points to the envelope weights property.
(see documentation: http://download.autodesk.com/global/doc ... vWght.html)
Here's a version that should work:Code: Select all
A = Application op = A.ApplyFlexEnv("crvlist;sphere,sphere1,sphere2,sphere3,sphere4", "", 2) env_weightcls = op(0).Parent A.SIModifyFlexEnvWght(env_weightcls, "sphere", "crvlist.pnt[0]", 0)
That may be true, but unfortunately that means learning and experimenting and I don't have time for that now, since the deadline for the project is closing.Chris_TC wrote:Ideally, you'll want to use the object model for changing weights instead of running the ModifyFlexEnvWght command. See:
http://download.autodesk.com/global/doc ... ights.html
But maybe I'll study it when I have some free time. I'll have to learn all of this anyway.
Thanks for the help!
Re: Curve point constraint
You supplied a name as the cluster, but that name may not always be correct (for example if your curve already had an identically named cluster before you applied the script).Judicator wrote:That worked perfectly. But what did you do here?
ApplyFlexEnv returns the automatic enveloping operator whose parent is the cluster you want (it actually returns a collection because you can run the enveloping command on multiple objects, so you'd get multiple operators - therefore I use op(0).Parent, assuming you only ever do this to one curve). By using that as the argument, you don't have to rely on string names. The other arguments are still strings ("sphere" and "crvlist.pnt[0]") - these too would be more bulletproof if they didn't rely on specific names, for example:
Code: Select all
mycurve = Application.Selection(0) #assuming you always select the curve first
# Then instead of "crvlist.pnt[0]" use this as your argument:
# mycurve.FullName + ".pnt[0]"
Who is online
Users browsing this forum: trendiction [Bot] and 16 guests