PDA

View Full Version : Extracting rotations (cg academy)


bonne
03-12-2008, 03:37 PM
Been rigging a character using the cg academy dvd's and I've got the entire rig done except the shoulder. In the chapter extracting rotations, on the 2nd dvd. I'm using max 9 and he's using max 6. Does anyone know how to do this chapter in max 9?
This is the script he writes in:
depends0n $L_arm2 $Point01
rot=($L_arm2.transform * inverse $Point01.transform).rotation as eulerAngels
rot.x
When I get to the .rotation part I start to get errors.

scrimski
03-12-2008, 04:11 PM
Would be great to know what errors exactly.
Probably it's the dependsOn stuff which you don't need upwards from Max 7 anymore. Create/assign nodes in the script controller.

bonne
03-12-2008, 04:30 PM
Oh yea, forgott the error.
I did this a while ago and then gave up and rigged the hand instead so now everytime I open the file I get this error message from the script controller:

Type:error call needs function or class, got:undefined

marktsang
03-12-2008, 05:39 PM
if you are using anything above max 8 dependson no longer is used - instead you add the object as a variable to force updates

mark

bonne
03-12-2008, 05:44 PM
Allright, removed the depens on and created the variable "L_arm2". Then assigned the node as the "point 01" And got this error:
Type:error conversation needs a class argument,got:undefined

Still a bit of a noobie when it comes to 3d, especially the rigging part.

mberglund
03-12-2008, 06:26 PM
instead of selecting the a node, have the varible select a controller instead. like <var>.transform

then it would look like:

rot=(l_arm2 * inverse point01).rotation as eulerAngels
rot.x

mberglund
03-12-2008, 06:34 PM
This is what my script controller looked like:
rot = (arm2 * inverse point01).rotation as eulerAngles
degToRad -rot.x

The cg academdy rig isn't very good overall, leaves a lot of important stuff out. However, the facial stuff is really good. go to cyrptics website and download their free max rig to see what a good rig looks like.

bonne
03-12-2008, 06:44 PM
Hm. Now, using your script, I get an error message saying:
"No inverse funcion for undefined"
Btw, who's cyrptics (or cryptics?) I did a google search and a name search here on the forum and found nothing for cyrptics.

Im guessing since it's an intermediette level on the tutorial they couldn't include everything but probably got most of the important stuff in there? This is pretty much my first rig (done one using lynda too) so for me the controll I have over the rig is enough.

mberglund
03-12-2008, 06:51 PM
undefined:
it says undefined because nothing is assigned to it.
what you need to do is create a var called point19 (or whatever your point is) click assign track. located the point19 click the plus sign next to it and find tranform:Position/rotation/scale

then click ok. you should see at the bottom witht he point var selected
Target: point19.transform

Make sure you do the same for the arm joint, although it might read ik:transform or something like it.

Cryptic: i meant studio cryptic. here is the link (http://www.crypticar.com/). sorry about that, i wasn't very clear :)

labbejason
03-12-2008, 06:57 PM
Are you just trying to do a twist bone for your rig's upper arm? Maybe you should gives some steps of what your are trying to achieve and what you are doing, so everything is clear.

I've done the DVDs myself a while ago, and had absolutely no problems. It is afterall an intermediate DVD, so you should be comfortable with the basics.

EricDLegare
03-12-2008, 09:55 PM
Are you just trying to do a twist bone for your rig's upper arm? Maybe you should gives some steps of what your are trying to achieve and what you are doing, so everything is clear.

I've done the DVDs myself a while ago, and had absolutely no problems. It is afterall an intermediate DVD, so you should be comfortable with the basics.

Just listen to the guy that works with BOBO ^_^

PEN
03-12-2008, 11:04 PM
What I sugges is you skip to the last DVD and check out the extras. There is a section that is on the Expose Transform helper. This will replace the need for the script controller to extract the local rotations of the joint as it will do it for you. You can then wire your twist bones to the exposed values.

I don't work with Bobo, but wish I did;) I did get to teach Jason how ever, and I bet I could now learn alot form him.

EricDLegare
03-12-2008, 11:26 PM
Actually I was talking about Jason Labbé because he works at Frantics, I wanted to say "Take this advice, it comes from a guy that works with BOBO", my bad, anyway you should listen to PEN's Advices/DVDs because there great too ( even if he dosen't work with BOBO :) )!

eek
03-13-2008, 03:01 AM
An example:

Assign a script controller to the rotation x of a object. Create two variables assigned as 'nodes' to two points in the scene, (preferably aligned to world too) called 'p0' and 'p1'. We will take the space of one point in relation to the other point.

(p1.transform * inverse p0.transform) - this take the transform space of p1 relative to p0. Further examination shows that were doing similiar math to standard arithmetic thus:

if a = 10, b = 20. a * inverse b can be shown as, a + -b or 10 + -20 = -10. Now transforming this space relative to its transform shows. b + (a + -b) = 10 because 20 + -10 = 10.

So as we showed before we have the transform space now. Now we can transform this by an other space simple my multipling it by it thus:

(p1.transform * inverse p0.transform)*p0.transform This is the space relative to a reference transform, namely p0.transform.

To extend this and get the rotation, we can get the quaternion of the matrix via:

(quattoeuler ((p1.transform*inverse p0.transform)*p0.transform)) and now get the specific attribute:

(quattoeuler ((p1.transform*inverse p0.transform)*p0.transform)).x

You may have to convert this to radians for max to behave with:

degtorad (quattoeuler ((p1.transform*inverse p0.transform)*p0.transform)).x

I would however recommend, using a reference for both top and bottom controls of the twist i.e a bias - which allows the animators to twist the bias to fix pops such as:

n1 = degtorad(quattoeuler(p0.transform * inverse bias.transform)).z
n2 = degtorad(quattoeuler(p1.transform * inverse bias.transform)).z

n1 + 0.5*(n2-n1) - this is standard linear interpolation.

cheers,

PEN
03-13-2008, 11:28 AM
I know what you were saying eric, I was trying to be funny, I guess that didn't come across.
Script controllers have changed a fair bit since the DVD was done. I believe there is an extra on the end of the 4th DVD that covers how to use them.

A few things to note. First off you don't use dependsOn any more. You add variables and connect them to tracks and nodes in the left hand window and then use those variables in your script controller body. For this reason you should never be refering to an object by name directly in the script controller body. Doing so makes script controllers slow and error prone if a name of an object changes.

The better method is to now use the expose transform helper and wires.

bonne
03-13-2008, 06:36 PM
Thanks guys, just re-installed windows and deleted everything on computer today though. Right now the only thing I've got installed is firefox. When I get max installed again I'll check out your tips/ideas.

Edit: wow, a reply from the man himself. I really enjoyed your tutorials Paul :).

labbejason
03-13-2008, 07:02 PM
Just listen to the guy that works with BOBO ^_^

LOL Eric! We're actually in different locations. I'm at Vancouver, while he's in Winnipeg. Although he's still very nice to help out whenever I'm stumped on something. I would jump to the opportunity if I could work directly with him :P

EricDLegare
03-13-2008, 10:37 PM
LOL Eric! We're actually in different locations. I'm at Vancouver, while he's in Winnipeg.

Oh, I really failed on this one :D ...

I thougth Frantic was ONE studio ...

labbejason
03-14-2008, 09:09 PM
Nope! There's one at Vancouver, LA, and finally Winnipeg. Winnipeg is the main office where they have the RnD department and such.

CGTalk Moderation
03-14-2008, 09:09 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.