PDA

View Full Version : Animation layers


JHN
05-01-2009, 03:27 PM
Does anyone use animation layers?

I never cared for the interface and use of animation layers, but I just discovered they have the useful .exposedN where N = X, Y or Z properties. So with that you can wire to just the exposed controllers and add layers at will above that, no worrying to break anything. One thing I don't like though is that disabling a layer still that layers values get sent out to a .exposeN property, you also have to weight the layer to 0 to make it work.

So I'm wondering is anyone using this layer controller? I want to incorperate different layers for setting stuff up (base layer) then different layers for mocap, procedural and handkey animation.

I wonder if people have experience using it in a scripted setup and are finding it usefull/stable to work with, before I'm setting up to much stuff depending on the layer controller.

Thanks,
-Johan

eek
05-01-2009, 03:49 PM
huh?

Is this like position list controllers? of the non-linear animation thingy?

JHN
05-01-2009, 04:04 PM
It's an interface that exposes a "new" (since max 9 I believe ) controller type: layer_controller.
It works almost identical to list controllers except for a bunch of features I do not care for, besides the exposeX Y and Z properties of the controller. If you wire a lot, you would have to wire to all sub controllers in the list controller, the layer controller exposes 1 value to wire to, and N number of layers. That's a good thing for me.

But now I'm hoping you can nest a layer controller in a list controller, if that can be done I'd be all set.. but I'm not quite sure yet, but I think I can think of another way to work around that problem.

The thing I don't like is that you can't rename the base layer.

But again the UI is just crap to work with, so hopefully I'll be scripting it all together.

Anyone with some more insights/experience?
-Johan

PEN
05-01-2009, 05:29 PM
Layer controller was added in Max 8 I think. I do use them but mostly I use my own systems as I developed it years ago that uses list controllers. I hadn't tried just switching off a layer in the layer controller as I think I have always just weighted it off. I would say that is a bug and should be reported. If a track is off I expect that it will be off every where. When I wire to the list controller I just break the tracks up my self and in the case of rotations I do the conversion my self. Much of the time how ever I use the exposeTM helper and get the values I want through that. The reason I do that is the whole controller stack can be changed and you don't break anything.

JHN
05-01-2009, 06:22 PM
What I like about a layer / list controller setup is that I can get values out of the controllers there are zero'd out by nature. And I don't need to put an extra null between the point needed to zero it out, but that means the base controller holds the "world" or "adjust" values. I'm looking for a way to have both. And use the base layer/controller as a world/adjust value and all following layers (preferably accumulated, like layer controller does) as the animation/keyframe/mocap values. I'm mostly talking facial rigging now, so the zeroing out of controller values are very handy. But now I can't have 1 controller which does both.

I want the results of all layers above base layer in 1 value and the base layer as 1 value. Probably have to zero out. What I don't like about the exposeTM helper is that I can't get the offset of an object to the exposeTM itself, it creates dependency loop... so that means another layer off nulls to manage... I like to keep it as simple as possible.

How do you manage layers with listcontrollers, you have a callback or some scene traversell to set all necessary weights and active controllers?

Thanks!
-Johan

PEN
05-01-2009, 07:46 PM
Well this is something that I do in my list controller layer setup as well. I use a list controller with two list controllers in it. The first is the current value or the setup controller list and the send contains all the animation tracks. I do wire directly some times to the animation list controller some times. All depends on what I'm doing and what I might think could happen to it all. I'm often over cautious about rigs as they are always being done for other productions. so I want to make sure that I can fix/change/update anything with out problems.

JHN
05-01-2009, 10:19 PM
Alright so you wire to a listcontroller sub controller's .x, y or z property.... I see know, that's great! I thought you could only wire directly to a track, but you can wire to a xyz controller to if you choose the .x y or z property...

Yes then a list controller is more effective to me then the layer controller, since you can't nest layer controllers it seems...

Ok cool! Thanks!
Some things I'm wondering, do you have a global control to switch all layers on a rig to a certain layer?
How do you do automated lipsync, do you plot to a layer or have a layer for each phoneme and animate the weights, a script I found here (http://www.annosoft.com/lipscripts.html) is setup like that, but I don't like it at all... I'd rather have the intermediate tool, figure out the keyframes from the data provided and plot it to 1 track each control. Then in a next layer I can keyframe on top of that.

Just starting to really like this rigging business :)

Thanks again for all the answers so far!

-Johan

eek
05-02-2009, 02:36 AM
Alright so you wire to a listcontroller sub controller's .x, y or z property.... I see know, that's great! I thought you could only wire directly to a track, but you can wire to a xyz controller to if you choose the .x y or z property...

Yes then a list controller is more effective to me then the layer controller, since you can't nest layer controllers it seems...

Ok cool! Thanks!
Some things I'm wondering, do you have a global control to switch all layers on a rig to a certain layer?
How do you do automated lipsync, do you plot to a layer or have a layer for each phoneme and animate the weights, a script I found here (http://www.annosoft.com/lipscripts.html) is setup like that, but I don't like it at all... I'd rather have the intermediate tool, figure out the keyframes from the data provided and plot it to 1 track each control. Then in a next layer I can keyframe on top of that.

Just starting to really like this rigging business :)

Thanks again for all the answers so far!

-Johan

To both of you,

yes this is pretty much how I do my rigging with list controllers. Puppet shop too pretty much works this way, and sort of the paradigm of max in general layers of things ontop of each other. Modifiers, controllers etc etc..

I've never really built my own anim layer system yet, - but if i would id basically abstract the list-controller methodology for it. I.e

Treat animation layers as the weight of a controller. Then interface the set active, weighting etc etc in a simple affective rollout. Have a 'base' or 'neutral' controller to act as the original pose of the rig to easily go back to the base pose - synonymous to PS. The key is to keep everything in sync when deleting layers etc etc.

$.pos.controller = position_list()
$.pos.controller.available = position_xyz()
$.pos.controller.setName 1 "layer_1"
$.pos.controller.setActive 1 -- makes it editable..
$.pos.controller.weight[1] = 100.0

etc,etc.. (this is very basic) maybe ill have some time to build a really simple (but solid) script. Current really busy refactoring and building new pipeline stuff.

JHN
05-02-2009, 09:00 AM
Eek, thank you very much for your insights! I'm glad I'm on the right track with this.

Thanks both for your answers.
Sincerely,
Johan

PEN
05-02-2009, 01:33 PM
Well to add and subtract layers I have all the control objects referenced into the control modifier and when you add a layer it works on all control objects at once. This is part of my RAIC system that I have built over the last couple of years.

As for facial I'm usually using a blended morph system and phonemes are built from multiple targets. I have not put layers on the facial animation in most cases but I can, not a bad idea to do automatically.

eek
05-02-2009, 03:41 PM
Eek, thank you very much for your insights! I'm glad I'm on the right track with this.

Thanks both for your answers.
Sincerely,
Johan

I think the hardest part is not so much doing the actual math and functions, its making it realy simple to the user - i.e making like an NLA animation system, draggable clips and so forth.

JHN
05-02-2009, 06:02 PM
I think the hardest part is not so much doing the actual math and functions, its making it realy simple to the user - i.e making like an NLA animation system, draggable clips and so forth.

You are absolutely right! For now I'd be happy to store and apply poses, apply automated lipsync and support an easy setup of the rig. The rest is still too much for a small studio to invest in right now. And we are using CAT for our body rigs, so some of that is covered.

What I am trying to build right now is a flexible, customizable facial rigging system. That is easy to setup and animate an automate, and I have all the pieces in my head right now, and half of it is coded and for the rest I have most proof of concept done. In it's first incarnation the animators controls will probably leave room for improvement as I like to have some feedback and improve on it again.

Thanks!
-Johan

eek
05-03-2009, 01:36 AM
You are absolutely right! For now I'd be happy to store and apply poses, apply automated lipsync and support an easy setup of the rig. The rest is still too much for a small studio to invest in right now. And we are using CAT for our body rigs, so some of that is covered.

What I am trying to build right now is a flexible, customizable facial rigging system. That is easy to setup and animate an automate, and I have all the pieces in my head right now, and half of it is coded and for the rest I have most proof of concept done. In it's first incarnation the animators controls will probably leave room for improvement as I like to have some feedback and improve on it again.

Thanks!
-Johan

What I would say about going into any big endevour like this, really spend a good chunk of time thinking and writing notes how the system would work, on a whole overview I.e

How to make poses?
How to wire them to an interface method?
How to save and load poses/interfaces?
How to export/bake into rig etc,etc

And crucial how to make it appear to work beautifully, as if 'magic' to the tech guy or animator making the poses/interface. Thats like 60% of the work :)

oh and p.s get your animators to give feedback as your building it!

PEN
05-03-2009, 02:12 PM
The system that I have doesn't have clips that can be dragged and what not other then just filtering for the current list controller and only seeing the keys in the track bar. You can't see the others at the same time how ever so a nice NLA editor would be nice. One of the things on a very long list. I tend to use Motion Mixer for that sort of thing at the moment.

JHN
05-03-2009, 03:26 PM
Eek, for poses I'm thinking of using the same technique Pauls attribute holder is doing, values of the instanced controllers, probably be copy and pasting it for a bit (with proper credits in the script! ;)). I'm thinking in 3 "layers" of poses: eyes, mouth and all. And storing and ramping the poses in. Interface is just going to be position markers on the face, no seperate UI for now. The controls provide acces to an empty mod with storing and posing.
No baking (or now), we're just doing "pre-rendered" animation for TV and such.
The magic comes in tweaking the weights of the controls and skinning, imo. Since controls drive other controls in a weighted sense (like for example 20% of the cheek "muscles" moves with the mouth corner). I feel that's going to be the magic part... the rest is just layering controllers... for now I'm still not using a scripted controller... all wire and lookats. and some position constraints.

Paul, do you instance the tracks to temporary nulls? I have a morphtarget animation script that assigns instances of the selected morph controllers to a customAttribute track on a temporary null that then only shows the keyframes of the selected tracks. But that clearly means you don't have the object itself selected anymore. Good you maybe give a hint of how you do that?
And motionmixer? You really use that...!? I tried and just ran away, but maybe I missed out the obvious!

Thanks,
-Johan

eek
05-03-2009, 05:35 PM
Eek, for poses I'm thinking of using the same technique Pauls attribute holder is doing, values of the instanced controllers, probably be copy and pasting it for a bit (with proper credits in the script! ;)). I'm thinking in 3 "layers" of poses: eyes, mouth and all. And storing and ramping the poses in. Interface is just going to be position markers on the face, no seperate UI for now. The controls provide acces to an empty mod with storing and posing.
No baking (or now), we're just doing "pre-rendered" animation for TV and such.
The magic comes in tweaking the weights of the controls and skinning, imo. Since controls drive other controls in a weighted sense (like for example 20% of the cheek "muscles" moves with the mouth corner). I feel that's going to be the magic part... the rest is just layering controllers... for now I'm still not using a scripted controller... all wire and lookats. and some position constraints.

Paul, do you instance the tracks to temporary nulls? I have a morphtarget animation script that assigns instances of the selected morph controllers to a customAttribute track on a temporary null that then only shows the keyframes of the selected tracks. But that clearly means you don't have the object itself selected anymore. Good you maybe give a hint of how you do that?
And motionmixer? You really use that...!? I tried and just ran away, but maybe I missed out the obvious!

Thanks,
-Johan


Hey Johan,

I've built and am still building a pretty dam flexible face pipeline for our characters at work, and no i cant discuss it too much as i'm bound by NDAs. What i will say is that it leans towards a lot of what were discussing, and is very flexible into how poses are mediated. With game engines you have to worry about not only save/loading in you source too, but how the engine interpolates its exported data, whether there's a middle man etc etc.

If your using list controllers to store the face poses, you can not only control them by there weight. But also internally by using wiring, script controllers on the actual controller.

For example you could do this:

Have an eyelid follow pose, where is rotation controller or morph value follows the eye, via a script or wire. But on top of this drive its actual weight, for things like sleepy eyes. Or just if the animator wants to animate the eyelids by hand.

As for instancing controls, I do this with CA (not related to faces). But as you say the issue is you haven't got the actual object selected. All you care about in the end is if the animator or use believes that this 'temp' object or slider is the value. Its just a case of making the controller easily accessible, in the viewport/rollout or trackview.


The other thing you can do is have a weak pointer/reference to the morph object, and re populate the rollout on the fly using execute "". But that would be quite a bit of work if you rebuilding the morphs for a character into instanced controllers via rollout sliders.

Nice thing about this is that you only need to do it when you swap characters. Make the rollout tearable (pop out) and you have a pretty nice system.

JHN
05-03-2009, 06:37 PM
Hi Eek, I understand you cannot go in to deep with this stuff. Trying to keep it flexible here to... in the end I have build 2 scripted plugins, 1 for the setting up of stuff and 1 for the control objects. For tearing off rollouts I use a subrollout on the control that needs that specific rollout, I use a maxObject/instance to the other CA and just pops the rollouts in the subrollout tool.

Setting this stuff up is quite an interresting journey, I first build my tool as CA on a emptymodifier (no plugin errors on the renderfarm) but less flexible with updating. So now I build a set of scripted modifiers (thanks paul ;)) which are easy updateably but a bit less flexible on instancing, since now it references the object it's applied to, so no instance modifiers... So I tear of the rollouts that I need to the new scripted plugin on the control objects. A bit convoluted still, but I think it will work out in the end. What I want to end up with is a setup script, that guides the whole process and 2 or 3 scripted plugins that take care of all wiring and weighting of the controls, and a script to quickly setup/align all the stretchy bones. Abstracting this stuff further and further I feel that 1 particular control system can be used to control all sorts of animation. And I have some pretty interresting setup for following the contours of a face for the control points, which I cannot tell to much about right now...

Really starting to like this rigging business, mostly did pipeline tools before this.

-Johan

eek
05-03-2009, 11:24 PM
So now I build a set of scripted modifiers (thanks paul ;)) which are easy updateably but a bit less flexible on instancing, since now it references the object it's applied to, so no instance modifiers...

Scripted modifiers can share persistent values, all you need to do is have them point to it. For example i have a modifier that checks where it gets its data from, if the directory is undefined it asks the user to point to one. Now any additional copies of that modifier will point to this directory. The way i do it is in a file that gets created the first time the user creates the modifier. Any additional copies of the modifier point to this created file. You could do this with an custom attribute in the scene too.

So I tear of the rollouts that I need to the new scripted plugin on the control objects. A bit convoluted still, but I think it will work out in the end. What I want to end up with is a setup script, that guides the whole process and 2 or 3 scripted plugins that take care of all wiring and weighting of the controls,

Yep, you basically need to just identify an object and its controllers, i do this via its name. When i build a pose in a list controller, I check if it already exists and if not i build the pose. Then when i go about rigging it i just query the name and the rig its part of.

So really what you want is a) Functions to build the pose, delete, rename it etc. b) set of functions to build the handle/slider/ui element and c) functions to wire them, unwire etc

Thats pretty much it - i have most of mine in a struct. I do this with pretty much everything i do. I do this because firstly i like to run tools without any ui, but also have the ablity to batch everything. This is really important if you have several characters etc.

Shout if you need a hand, my brain is currently firmly stuck in character pipeline re-factoring at the minute. :)

JHN
05-04-2009, 10:24 AM
Scripted modifiers can share persistent values, all you need to do is have them point to it. For example i have a modifier that checks where it gets its data from, if the directory is undefined it asks the user to point to one. Now any additional copies of that modifier will point to this directory. The way i do it is in a file that gets created the first time the user creates the modifier. Any additional copies of the modifier point to this created file. You could do this with an custom attribute in the scene too.


Yes, that is actually a very good idea! CA's for scene specific stuff. Thanks!
The more I use them I find them annoying to work with (setup/redefine) and invaluable atr the same time, mostly in a metadata sort of way.


Yep, you basically need to just identify an object and its controllers, i do this via its name. When i build a pose in a list controller, I check if it already exists and if not i build the pose. Then when i go about rigging it i just query the name and the rig its part of.

Yes, I too use naming conventions in the list controller, would like to have a better handler to foolproof it, but I think names is the best a listontroller can provide. You say you build poses on layers, is that a setup pose then, I don't think you build a pose a layer and animate it's weights?! (or maybe for phonemes?!) Or do you store poses in the layers? And not just the controller values, like PEN attribute holder does?


So really what you want is a) Functions to build the pose, delete, rename it etc. b) set of functions to build the handle/slider/ui element and c) functions to wire them, unwire etc

Yes, most of that I have already or prototyped.


Thats pretty much it - i have most of mine in a struct. I do this with pretty much everything i do. I do this because firstly i like to run tools without any ui, but also have the ablity to batch everything. This is really important if you have several characters etc.

I use structs almost exclusively since a year orso, they are very versatile, although I hate the fact the order of function declaration is important when functions use each other in the struct. And I have some more pet peeves with them, but there's nothing better in maxscript, I think.


Shout if you need a hand, my brain is currently firmly stuck in character pipeline re-factoring at the minute. :)
Thanks for the offer(!!), for now I seem to cope, it's more the abstract thinking and the consequences and simply the time I can put into the system.

Thanks for picking your mind!
-Johan

PEN
05-04-2009, 04:10 PM
Sounds like we are all going down similar roads. In the system that I have built I have several scripted plugins, some modifiers and some objects. All reference each other through the weak referencing. I did another system for Pinky Dinky Doo where I had scripted objects, scripted modifiers and scripted materials all talking to one another and reading XML data from the drive. That mixed with Custom Attributes for the character specific tools made a very solid character pipeline. My car rig also uses the same ideas about scripted plugins referencing each other. Works great and about as unbreakable as I think you can get.

JHN
05-04-2009, 04:30 PM
But you can only store node references through weak referencing or am I mistaken? I now have a instance of the modifier in a maxObject attribute. How do you go about weak referencing a modifier... first the node and then try to get the name of the modifier
<weakrefence>.node.modifiers[#theMod]?

Thanks,
-Johan

eek
05-04-2009, 07:53 PM
But you can only store node references through weak referencing or am I mistaken? I now have a instance of the modifier in a maxObject attribute. How do you go about weak referencing a modifier... first the node and then try to get the name of the modifier
<weakrefence>.node.modifiers[#theMod]?

Thanks,
-Johan

Nope you can have a node tab, in a custom attribute. I think even controllers etc.. eg.

append nodeTab $.test.pos.controller

Mathieson
05-05-2009, 07:56 AM
But you can only store node references through weak referencing or am I mistaken? I now have a instance of the modifier in a maxObject attribute. How do you go about weak referencing a modifier... first the node and then try to get the name of the modifier
<weakrefence>.node.modifiers[#theMod]?

Thanks,
-Johan

You can store them in a maxObject or maxObjectTab param type. You just have to store them directly, not through a nodeTransformMonitor.

def = attributes testA
(
parameters testP
(
testMaxObj type:#maxObject
)
)

obj = box()
b = bend()
em = emptyModifier()

addModifier obj b
addModifier obj em
custAttributes.add em def
em.testMaxObj = b

em.testMaxObj.enabled = false
em.testMaxObj.angle = 72.5

JHN
05-05-2009, 08:57 AM
Eek, Matthieson: I know that you can do that, that's what I do now, I was thrown off guard bij Paul saying he's storing weakreferences. Would instancing a controller/CA or modifier be regarded as a weak reference? I would like to use the safest way possible, and if that's storing weakreferences in a maxObjectTab and walking the modifier array then I use that, otherwise I'd be assigning directly to maxObjectTabs.

Thanks!
-Johan

Mathieson
05-05-2009, 04:12 PM
Ah, okay, I misunderstood you question in the first post. Now that I understand better, good question!

There is RefTargMonitor. I have not used this before (just found it in the help right now), but it seems to work the same as nodeTransformMonitor with the ability to hold reference to any maxObject. There could be drawbacks I am not aware of, but at least now I feel like I'm contributing something! haha Maybe someone has used it before and can say a little more about it.

eek
05-05-2009, 04:14 PM
Eek, Matthieson: Would instancing a controller/CA or modifier be regarded as a weak reference?

-Johan

I dont think it would in a node sence, it would just be a reference as the controller itself isnt changing and if it did the reference would be lost i think.

i.e if i make a reference to a.pos.controller[1].controller which say is a list controller and now i make it a position_xyz() i dont think it will keep that reference. But if you go up a level in your reference it will i.e a.pos.controller would work i think.

Polimeno
11-30-2009, 07:07 PM
Eek, for poses I'm thinking of using the same technique Pauls attribute holder is doing, values of the instanced controllers, probably be copy and pasting it for a bit (with proper credits in the script! ;)). I'm thinking in 3 "layers" of poses: eyes, mouth and all. And storing and ramping the poses in. Interface is just going to be position markers on the face, no seperate UI for now. The controls provide acces to an empty mod with storing and posing.

have you seen POSETOOL (http://www.simoworks.com/posetool/htmls/pt_what_is_posetool.html) script ?
i would strongly recomend you to ckeck it out, i use it a lot since it can layer things as you said.

CGTalk Moderation
11-30-2009, 07:07 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.