View Full Version : bones and morph modifier - wire parameters
Dreamsign 02-02-2003, 12:40 PM Im trying to find a good way to skin in 3dsmax5.1.
Using morph angle deformer and joint angle deformer works allright on a joint that only rotates in one axis. For those who rotate in several, as the shoulder and legs, it doesnt work correctly.
What Im trying to do is to use a morph modifier below skin, and wire the morph targets to the respective bone rotation with wire parameters. But my problem is that the controller for the bone rotation stays at zero, probably because I use IK for movement. So I got to find a way to link the morph target with the actual rotation value of the bone. Anyone got any idea to do this, or a workaround?
Help would be most appreciated !
|
|
scytales
02-02-2003, 11:44 PM
:cry:
Ho my god !!!! i m looking exactly for the same thing since 3dsmax 3.If only i could have the solution i should set very advanced character rigging, actualy the < morph angle deformer> gizmo is a real sh..biiip!!!! Because this system read the xyz rotation at the same time and all the the animators know after a few minutes of animation 3ds max lost the head arrgh!!! so you correct this by manual keyframing but it is impossible whith the gizmo angle deformer system wich is totaly inaccesible.
So the one who will be able to give me the solution will be my hero for the rest of my life
LFShade
02-03-2003, 06:09 AM
You can extract the bone rotations from an IK chain through MAXScript by using $some_bone.transform.rotation (where some_bone is the name of the bone you wish to get the rotation values for), so it's possible to assign script controllers to the morpher channels and hook things up that way. You need a bit of a mind for math and scripting to get it working, though.
couple of ideas,
if u want to use 'wire parameters' then it might work to link a box (or whatever) to the bone and wire to the box rather than the bone.
or.
what about a reactor controller? might work best to again link a box/dummy to the bone and then setup reactor controllers on the different morph targets which look to the rotation of the dummy. (depending on your situation it might be a good idea to use a euler xyz controller on the rotation of the dummy so that u can look at the axis independantly of one another.)
of coarse scripting or expressions would be a better way to do it but that's a much longer story,
hope that helps a bit.
cheers
LFShade
02-03-2003, 06:53 AM
Linking a dummy to the bones wouldn't help, because the rotation controllers of the dummy will still have unchanging values (since there would be no rotation relative to the parent). That's why you need to use MAXScript to pull those values out - it will give you the bone's actual rotation rather than just its controller values.
ah, that's a bugger.
just a quick question (LFShade), will max script give the rotation of the bone relative to it's parent or to the world?
or can you choose which value you get?
be a bugger to have the morph targets going crazy everytime the character turns around :p
cheers,
phil
just had a little play with this and thought i'd post a little script that would get you pointed in the rigth direction. if you put a script controller on your characters' morph target that you want to manipulate and then paste this script into the window it will link the morph to the rotation of bone01. If you want to change the bone then just replace 'bone01' with the name of your bone.
__________________________________________
arm_angle_quat = $bone01.transform.rotation
arm_euler = quattoeuler arm_angle_quat
a = arm_euler.x
sqrt(a^2)
__________________________________________
i added the last line just as an afterthought to ensure you always get a positive value and to show that you can add/multiply... this value all you want.
this is only a real basic example, there's no easy way to do an example that would suit all situations but this should point u in the right direction. You will probably have to put a few if statements in there so that you can limit the effect. There will also be some maths involved to get the values you want.
hope it's some use
cheers
ps. might b a better way, i'm no scripting guru.
johnny_riptide
02-03-2003, 10:49 AM
This is the line of MaxScript that worked for me:
in coordsys parent $bone02.rotation.z_rotation
The trick, however, is to take the value that is returned from the above line and convert that into something to drive your morph channel. Now, as you probably already know, the morph channel goes from 0 to 100. Let's say the active joint rotation of my bone about the z axis is from 20deg to 120deg. So, when the value returned from the maxscript line above is 20deg I want my morph channel to be at 0 and when it returns 120deg I want my channel to be at 100.
http://www.articulatevision.com/MXS.gif
Applying a Script Controller on the morph channel, I wrote:
100*(((in coordsys parent $bone02.rotation.z_ROTATION)-20)/(120-20))
or, to generalize:
100*(((in coordsys parent $bone02.rotation.z_ROTATION) - JOINT_LOWER_LIMIT )/(JOINT_UPPER_LIMIT - JOINT_LOWER_LIMIT))
I hopes this makes sense.
Dreamsign
02-03-2003, 11:58 AM
thank you so very much for your replys, I'll go ahead and try that.
I think alot of people would be interested in this so when I make my website maybe I'll put up a tutorial if noone else does. (that is if I can do it right).
btw, the same thing would be possible with BIPED right? If one can find the right thing to type? I haven't scripted much before but I'll get into it.
Thanks again!
Dreamsign
02-03-2003, 12:19 PM
I can verify that it works, but only with FK, when I tried with IK I only got the same value all the time as I did with wire parameters.
Please tell me if anyone can make this work with IK. I'll continue testing it and tell what I find out.
scytales
02-03-2003, 09:33 PM
:beer:
like i d said the last time ,the person who will find the solution of this problem,will be the "BONE" super hero !!!!
for anyone interested there is a thread on the discreet boards about exactly this.
the thread is in the animation conference.
thread name: Maintaining Volume in Deformations
http://support.discreet.com/webboard/wbpx.dll/~3dsmax/login
the problem is solved but you'll still have to do a little maths to make the solution fit your exact situation, but no rocket science.
cheers,
phil.
Dreamsign
02-04-2003, 10:36 AM
Thank you very much Phil !
To save all the others the trouble, I'll just say it simple here:
rot = ($Bone02.transform * (inverse $Bone01.transform)) as eulerangles
rot.z
As bone01 and bone02 you put in child and parent, dunno if it needs to be in right order yet. You also put your calculations in the last line to fit the 0-100 morpher range to the rotations.
One question ; is it important to set the number of frames to a large number to keep the script working beyond the standard 100 frames or what you have in scene?
gaggle
02-04-2003, 02:48 PM
When wiring, yes, because the wire is a controller, and the controller has its ranges set to the ranges of when it was created.
..a little confusing explanation perhaps, but yes, you do if you're using Wire Parameter.
If you're using a Script Controller of some sort I do not belive this problem occurs.
Oh, and for the record, Discreet's take on that behaviour is "it's not a bug, it's a feature", as far as I know.
LFShade
02-04-2003, 04:49 PM
...and the "feature" does in fact extend to script controllers. It also extends to custom attributes and expression and reactor controllers. You know, all the stuff you use to make cool character rigs :hmm:
I have yet to discover the benefit of this feature. Thanks, Discreet! :wip:
CGTalk Moderation
01-14-2006, 08:00 AM
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.