Home Technical Talk

(3DS Max) Wiring and Constraining scale.

RedShiny
null
Offline / Send Message
RedShiny null
Okay, I've got a side-project that i'm working on to see about getting a stretchy bone setup sent over to Unity which will need to use scale.

At first the exporting process of collapsing the track information would cause issues since the heirarchy doesn't seem to want to listen to the "do not inherit scale" from the previous bone. I've managed to get past that but what i'm hoping to do is to make a test rig so that i can set up a splineIK system to control the stretchy limb.

I've gotten to a good place with the rig and it works in max itself but the workflow i have to keep it in line with is to have a base rig of bones to aid in the deformations. as such, i have to find a way to constrain the scale of the bones to this other rig and so far it seems that a scale constraint isn't offered right off the bat. So, to work around this i have been looking into the expression controller system as well as wiring the parameters together.

This is what i've got to figure out... as much as i'd love to use the standard bone-tools of "Squash" it doesn't seem to translate that into the track-view so this is a bit of a problem... one which i have to find a way to do something like that without having to rely on the squash from the bone tools. (i'm using max 10 if that's important.)

So, i've figured out what i need to do... i need to calculate the base distance between the first bone and the next bone's pivot... this one i think i've got... but, how do i wire it up to the scale so that i can then tell it to change the scaling as needed? for starters i'm focusing on the length scaling first... and from there if i can figure out the next bit i'd like to see about making a squash and stretch (though i'd like to add in a bit more fancy stuff but for now i'm focusing on the main distance scaling.)

thing is, i'm not that good with the coding and i'm coming up with a blank as to how to hook these parameters into the scale. Can anyone here point me in the right direction of tutorials or articles that might help me with this?

to note, if it helps i'm hoping to emulate a limb like you'd see from Elastigirl from the Incredibles that will translate... I already know that Unity will accept scaling of the bones (in their legacy system... Mecanim doesn't seem to like scaling very much) so mostly the bottle neck i've got right now is getting this rig system set up in max first.

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    I don't really have a solution to your entire problem, I do have this script that constrains POS/ROT/SCALE all at once.

    DOWNLOAD

    1. Drag and drop it into the 3ds Max viewport to install.
    2. Open Customize User Interface, and look in the "monsterBlues" category to bind to a hotkey or menu item.

    Usage: select the slave object(s) and run the script. A targeting line will appear, click on the master object. All the slave objects should now follow the master.
  • Mrfred
    Options
    Offline / Send Message
    Mrfred polycounter lvl 4
    Can we see your bone setup?

    What are you exporting exactly?

    Usually if the game engine support the scale, its pretty easy to simply export it.

    The easy way is to create 1 bone with a bone end then constraint the position of the bone end to a dummy, and add a lookat on the bone that targets the dummy. Now you need to export BOTH bones in some game engine asthe engine might need the child to build the scale matrices properly.
  • MattRennie
    Options
    Offline / Send Message
    Personally, I would put a scalexyz controller on your scale, then have a seperate float expression on the x y and z channels. Then say the X is the length of your bone, have a expression on there that factors in your distances in order give you lengthening/shortening. Then also have the fatness of the squash and stretch driven in a similar fashion on our other 2 axes
  • RedShiny
    Options
    Offline / Send Message
    RedShiny null
    Here's a little vid just explaining what i've got so far... thinking it's easier to just show and tell rather than screencap and text-explain.

    http://youtu.be/szDtMOWe5ss

    Monster: That looks like it might help with some of the things i'm looking at for other projects but i'm not sure if it's what i'd need for this. thank you for the script though and i'll be sure to see if i can find a use for it!

    Mrfred: well, you've got it in that the bone system is using a position and look at constraints. thing that i've noticed is that when collapsing the tracks down to export to unity (that's the engine that i'm looking at) the method that max uses (the bone tools object properties) doesn't seem to use the same track that max collapses down for scaling and as such, even though the rig works ok in max in giving that nice squash and stretch feeling, getting that into unity is trickier.

    MattRennie: I was thinking that too as i was fiddling about with it the other night... there was a tutorial i came across that showed using the expression controller and wire parameters that pointed me in that direction however i've still not managed to get something to work successfully (though, in defence of max, i'm not terribly good at the higher-end stuff so this is a learning opportunity for me.) to be honest, i think you and I are on the same page as to how to accomplish this. :)

    EDIT: so, huge facepalm moment here but the solution was what Matt said. did some testing and did a quick scale paramater wiring and it then gave the track i want to export down to some information. going to do one more test to ensure that that scaling information IS collapsing down but as long as it does then this can be considered resolved. i'll post an update tomorrow though since it's getting late and there are things i need to do yet.
  • RedShiny
    Options
    Offline / Send Message
    RedShiny null
    http://youtu.be/TCEedebgZ1U

    Here's the final video (well, part one... the rest are there too.)
  • Mrfred
    Options
    Offline / Send Message
    Mrfred polycounter lvl 4
    Do you want the stretch andsquash or the only the scale? If so you need to export the child ...
    In a strecthy bone hsetup the bone doesnt really strecth... Its more like a position animation rather than a scale.
Sign In or Register to comment.