View Full Version : Maya api
conomara 04162005, 01:36 PM Hello, this could very well be a stupid question but i'm new to maya apia nd just coming to terms witht the whole function set methodology.....
Q: How does one change rigid body node attributes using the api. the only compatible function set seems to be MFnDependencyNode. there doesnt seem to be a specific function set like MFnNurbsCurve for the nurbcurve node.
if anyone could shed light on ths then i'd be very grateful.
cheers
conor


playmesumch00ns
04162005, 02:18 PM
MFnNurbsCurve
Description This is the function set for NURBS (NonUniform Rational BSpline) curves.
The shape of a NURBS curve is described from an array of CVs (control vertices), an array of knot values, a degree, and a form. There are 3 possible "forms" for the curve: open, closed and periodic.
The open and closed forms are quite similar, and in fact a closed curve will become and open curve if either the first or last CV is moved so that they are no longer in the same position. So to create an open or closed curve, of degree N, with M spans, you must provide M+N CVs. This implies that for a degree N curve, you must specify at least N+1 CVs to get a curve with a single span.
The number of knots required for the curve will then be "M + 2*N  1". As well, if you want the curve to start exactly at the first CV and end exactly at the last CV, then the knot vector must be structured to have N degree "multiplicity" at the beginning and end. This means that the first N knots must be identical, and the last N knots must be identical.
A periodic curve is a special case of a closed curve. Instead of having just the first and last CVs coincident, the last N CVs in the curve, where N is equal to the degree, overlap the first N CVs. This results in a curve with no tangent break anywhere along it. The last N CVs in a periodic curve are permanently bound to the first N CVs, and Maya will not allow those last N CVs to be repositioned. If one or more of the first N CVs of the curve are repositioned, the overlapping CV's will remain bound, and will also be moved.
In order to create a periodic curve, you must specify at least 2N+1 CVs, so that that last N can overlap the first N and you still have 1 nonoverlapping CV left. The number of CVs required to create a periodic curve is still N+M, but you must ensure that the positions of the last N CVs are identical to the positions of the first N.
You still require "M + 2*N  1" knots for a periodic curve, but the vector required is a little more confusing than that for open or closed curves because of the overlap of the last N CVs. The first N knots should be specified at the beginning of the knot array as values { (N1), (N2), ... 1 } in order to implement the overlap. Additionally there can be no knot multiplicity at the end of the curve, because that would compromise the tangent continuity property.
conomara
04182005, 03:57 PM
cheers, but i probably didnt make myself very clear, i was looking for info re: the rigid solver node and what available function sets are relevent to it in the maya api, my problem is i dont see any methods in the stated funtion set for it ("MFnDependency i think it was"), i was giving the MFnNurbsCurve as an analogy for what i wanted for the rigid solver node, but cheers for replying anyway.
so having introduced a bit of clarity to the original question, i'm still a in state of confusion regarding it.
by the way, re: the einstein quotei think its his 50 aniversary today......
Robert Bateman
04182005, 05:04 PM
alright conner, how goes it !
you might find my website useful, www.robthebloke.org
yeah, there is no function set for rigid body stuff, you'll need to access the attributes directly by using an MPlug and the MFnDependencyNode::findPlug() method. It's a pain, but thats the only real way to do it. :(
conomara
04182005, 09:55 PM
jesus rob, didnt expect to run into u here. good to hear from you. i got around to downloading all the tutorials you put up and they kick ass... specially seen as there are only a tiny amount of material out on the api. are u still juggling dylans and spells of permacrunch in that cave beside pg16? how does it feel to be one of the academic hierarchy again??
anyway i am still in ireland helping arthur guinness send his children through school but i have been offered some work in mountreal which i hope to formalise before my liver files for divorce
should be able to work out how to manipulate the nodes i want to know that i have a idea of methodology
thanx for the help
will drop you a mail
cheers
conor
CGTalk Moderation
04182005, 09:55 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 ©20002015, Jelsoft Enterprises Ltd.