PDA

View Full Version : API: Orient along curve (like Motion Path / Spline IK)


BigRoyNL
11-12-2012, 09:35 AM
Hey everyone,

I've been trying to figure out how to orient along a curve within the Maya API like a Motion Path or Spline IK (with advanced twist) setup. This is because I'm looking into creating a custom Stretchy Spline IK setup that doesn't pop (over & under extends in extreme situations).
But I seem to be unable to wrap my head around how to calculate orientations on points on the curve.
Since the points on the curve don't have any orientation I have no clue on how to actually start with this.

My main references of tools in Maya would be the Motion Path and the Spline IK (with Advanced Twist controlled by a start and end object).
If anybody has any starting points for this it would be greatly appreciated!

Thanks in advance.

Regards,
Roy

tontonsuspect
11-12-2012, 10:39 AM
Hello,

what is your background ?How much experience do you have with maya, with scripting or the API?

Without knowing all the intricate part of math do you know what common vector and matrix operation do?

Have you use an aim/tangent/ normal constraint, or know how to play with a nurbs curve/surface?

With a bit of effort a curve is enough to build a coherent matrix along its path, but using a nurbsSurface is easier:(shameless plug: this is a subject i have study a lot )
http://vimeo.com/38788082
http://vimeo.com/52387664

My advice would be to build with several standard nodes a matrix system to orient stuff on it
be it with aim constraint / fourbyfourMatrix+decomposeMatrix etc

BigRoyNL
11-12-2012, 10:58 AM
Hey Cedric,

First of all let me start with saying I love your blog. If you would've just finished your blog posts about these things I would've probably know the answer. ;)

I've a good knowledge of Mel and Python and have recently started working my way through the API. I've been mainly busy writing deformers, i.e. Motion Deformer, Attract Deformer, Collision deformer.

I had actually seen your videos while doing research on this topic, I'm really interested in actually reading/seeing how you implemented these tools.

tontonsuspect
11-12-2012, 12:01 PM
Yeah , there is a lot of unfinished stuff on this blog. I try to show how and why i build tools ,but between jobs or demo reel updating sometimes some article start to lose the attention they deserve...

Just a hint : in a curve the data you can trust is the control point and the tangent:
The real work is to find a way to extract a reliable upVector/normal( 2 vector and a point position will give you a matrix: its the most fundamental thing you will use over and over when building tools )

BigRoyNL
11-12-2012, 03:52 PM
I've been able to find some time playing with the tangents and the normals of the curve with the pointOnCurve node and the aimConstraint. So far I haven't found a practical setup. ;) Thanks for the tip anyway. Maybe I can find some more time this week experimenting with a setup that can help me understand on how to actually do this.

CGTalk Moderation
11-12-2012, 03:52 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.