View Full Version : Trouble with wiring, rotational stuff
gaggle 10-21-2002, 10:21 PM Hello fellow human beings,
I'm having problems trying to wire the rotation of a bone to a custom attribute (CA) slider.
The idea is to control the jaw of my character through CAs. I've hooked up sideways and front/back movements just fine, but the rotational stuff baffles me. I thought I had it all figured, thinking I was smrt ("s m r t, I mean, s m a r t") since I thought I knew of the RadToDeg MAXScript command. But no, apparently I do not posses the adequate skill to do battle.
It's probably something obvious.. regardless of the cause though, I just can't seem to get it working. I've messed around for a while now, referenced the MAXScript manual, searched here on CGTalk for clues, and.. now is the time to just admit defeat and see if someone can lend me a hand :)
I've attached a picture of what I want to accomplish, the top bone (bone01) is the one that should have its rotation determined by the slider on Dummy01.
The attached image had to be very compressed, so for those who can, here's (http://gaggle.dhs.org/files/gaggle_bone_rotation.jpg) a high-rez prettier version, weighting in at 286 kb.
There's also this (http://gaggle.dhs.org/files/gaggle_bone_rotation.max), the sample MAX file of what I want to accomplish. It's in MAX5 format, in case someone wants to get all creative.
So anyways, bone rotation being driven by a slider, any suggestions? You, sir, in the back perhaps? Yes, you, please, speak up :wavey:
|
|
GRMac13
10-22-2002, 04:21 PM
Have you tried changing the rotation type to Euler XYZ and wiring the CA to each axis seperately? I had the same prob while trying to wire a controller to change the dilation of my character's pupils.
dvornik
10-22-2002, 04:25 PM
Wire them directly, without RadToDeg. Just like you see it in your picture. Your file works here - I just hit direction button and connect. You can divide it by 5 or something so it goes slower.
Another good idea with custom attributes is to use them in combination with rotation reactor (float reactor) controllers. Then you can control a number of bones with one slider (like finger curl or foot roll).
dvornik
10-22-2002, 04:51 PM
Check this (http://home.earthlink.net/~dvornik/cgt/tech/gaggle_bone_rotation01.max) out. I guess r-click and "save target as".
gaggle
10-22-2002, 05:12 PM
.. :eek:, doh, good lord dvornik, it works indeed, without any fancysmanty conversion.
..ooh.. so RadToDeg is used when converting to and from a TCB controller I take it, but since all my controllers are XYZ Euler types, flat out float-numbers works like a charm.. wow.. I overcomplicated stuff needlessly :)
Anyways, so yeah, indeed, I'm dividing by 50 so far and it seems to work nicely. Much thanks for the help! I'm a bit miffed of not having tried that yesterday :)
There's still something puzzling me about the setup, so if anyone is feeling like doing more help, read on :)
The bone apparently has its own local rotational value as it lies there, unwired. As soon as I hook up the slider, the bone snaps to another rotational position. Which makes sense, the slider reads zero, thus the bone has its own rotation set to zero. Is it possible to nullify the transform values of the bone or whatnot prior to wiring? When I wired up the positional sliders I didn't have any popping-issues..
I thought I could zero out the transforms by creating a dummy with zero rotation values, and linking the bone to it, but apparently that's not it. I picked that up from the character rigging tutorial from MAX5, but probably it's meant for something else and I just thought it applied in this situation.
What I'm doing now, to counter-act the bones built-in rotational value, is to first hook up the bone so it controls the slider, so now the slider displays the exact value of the bone. I copy that number, then turn the wiring into the slider-controlling-bone connection, and minus the number I copied from the actual slider script.
Ie. instead of having "bone_rotation/50", I have "1.608+(bone_rotation/50)", which seems to work. But that seems like a potentially overly odd solution, I'm pondering if someone knows a cleaner solution? (the divide by 50 is a bit of a simplification of the script, it'll run through "if bone_rotation > 0 then blah else blah" conditions)
But still, that's more of an interest in doing things better, the system works now, and I'm just happy about that :) I've always had difficulty finding resources on character rigging and things a TD would usually be involved in. I only know of the newly reopened tdmax.com, but if you know of any other places carrying nifty information or tutorials and articles about rigging and scripting, please yell out.
gaggle
10-22-2002, 05:21 PM
ooh, dvornik, that's pretty neat. I can't figure out how it's done, could you run through it? You mentioned the reactor controller in your previous post, but nontheless, I can't find any such controller controlling the bones. There's a highly curious "euler xyz manual" controller, so yeah, please, feel free to run through the magic :)
I would've done a curl by applying maxscript/wiring on the rotation controller of each bone, ie. have the slider control all bones simultanously. Would there be an advantage to your way of doing things?
dvornik
10-22-2002, 07:48 PM
I learned this in school, so i don't take credit for it.
Here's how it works: Aply a rotation list controller to each bone first, list lets you use multiple controllers. In the list create 2 euler XYZ - one is for manual tweaking in case you need it later. In the second euler apply a float reactor controller to the axis you want to control. Do it for each bone.
Read up on float reactor controller - make it react to your custom attribute and create several states of bones for several positions of the spinner (you do this with spinners in the reactor controller dialog). The advantage is you can get exactly the poses you want by playing with reactor controllers settings, so it's almost like setting keyposes.
CGTalk Moderation
01-13-2006, 07: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.