Notifications
Clear all

[Closed] exporting xafs without "frozen" controller data

Say I have Rig A and Rig B
A and B have identically named control objects to key
but They were not “freeze transform” at the same values.
I want to copy the animation form A to B using xaf

the problem:

when I select the controllers of A and export xaf,
the xaf includes the values for its “active” controller track -the one I want
PLUS the vlaues of the forzen position/rotation controller -which I don’t want.

so importing the xaf to rig B with different “frozen” values cause all the unwanted data to muck thigns up.

is there any way ( in max script) to create “clean” xaf export data , that excludes all the frozen stuff, for use with LoadSaveAnimation.saveAnimation ?

I guess I need to iterate a list of the ctrl objects and search out the animation controllers I want… the problem here is not every ctrl object has identical list controller ‘stack’ . Some have list controllers, some do not…is there any kind of ‘exclude all the frozen stuff’ function I can use?

10 Replies

what do you not want to do – save or load?

I’m working on tools that both save and load xafs.
I would prefer to export “clean ” data to begin with,
but we have already a lot of xafs with the ‘dirty’ data.
so filtering out frozen controllers on import would be best.

lock all undesired for loading controllers.

seems obvious now that you mention. Away from max at the moment, do animation controllers have a .locked attribute?

also would locked controller channels also not export to xaf?

both would help my project immensely.

thanks again.

no. see LockedTracksMan Interface

also would locked controller channels also not export to xaf?

no. check keyableTracks option

wow, after seeing this thread and this one on the use of LockedTracksMan, my head is spinning a bit. how convoluted!

from the first thread , it seems a confusing ammount of information is passed to LockedTransMan:

For example, if you create a Teapot and want to lock its Position and Rotation controllers including their sub-controllers, you would say

tp = teapot()
   select tp
   lockedTracksMan.setLocks true #(tp[3][1], tp[3][2]) #(tp[3], tp[3]) #(1,2) true
   trackviews.open "Test"

This creates the teapot, writes it to variable tp, then locks the sub-anims tp[3][1] (position track) and tp[3][2] (rotation track) which have both as parents tp[3] (one entry each in the second array). The third array contains the indices of the sub-anims within their respective parents (first and second sub-anim of Transform track). The last flag says that all their sub-controllers (X,Y,Z position and rotation sub-anims) should also be locked. The first argument (true) tells the function you want to set the flag, false unlocks, but the children unlocking doesn’t seem to work, at least in Max 2010, so you have to go through all the sub-controllers one by one.

yet from the second thread:


lockedTracksMan.setLocks false #(tp[3][1], tp[3][2]) #($Box001, $Box001) #(1, 2) true


It seems that the contents of the second array don’t matter as long as the count matches the first array. I can even plugin garbage like this #(asdf, asdf) and it will work. Likewise, the third array, the subnums, don’t appear to matter as long as the array count matches and they are integers. The actual value of the integer appears to be meaningless.

Oh well, guess I better dive in…

as for keyableTracks, is there a way to set a track keyable in mxs?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

yes. for keyable controllers the property .keyable is read/write

Thanks again, Dennis.

So I scripted a function to build a array of all the subAnim nodes I wished to lock (any Frozen and any Scale subanims). Per the second thread linked to above, I generated garbage arrays for the client and index arrays. Which confirms Spacegroo’s thread post that most of what lockedTracksMan.setLocks wants as args seems superfluous

so I can lock the tracks and -i suppose- prevent them for being over written when I import an xaf (I still need to test that…)

However, I also want them keyable = false , to prevent the data exporting into .xaf in the first place. The problem : If I iterate the same array of subAnim nodes above and try .keyable=false , max script listener says

Unknown property: “keyable” in SubAnim:<subAnimName>

it seems that sub anims do not have a ‘keyable’ attribute.
which means that a frozen tansform, being a sub-anim, cannot be set keyable=false
and therefore cannot be prevented from muckign up an xaf file. 🙁

please let me know if I have that wrong…

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

subanim doesn’t have this property but its controller has. <subanim>.controller.keyable

BTW… the LockedTracksMan interface is very confusing. it works and works well but sometimes i don’t see any logic in the passing data.
for example, what the help says

[left][/left]

[left]<void>LockedTracksMan.SetLocks <bool>lock <&maxObject array>anims <&maxObject array>clients <&index array>subNums includeChildren
[/left]
[left]anims is In and Out parameter
clients is In and Out parameter
[/left]
[left]subNums is In and Out parameter[/left]

[left]
[/left]

which means i have to pass list of subanims, list of their parents, and list of their indexes.
but what is the reason for that if getting a subanim system know its parent and index…
which can illustrate this snippet:


 (
 	a = box name:"a"
 	b = box name:"b" 
 	addmodifier b (Skin())
 	c = box name:"c" material:(Standard())
 
 	anims = #(a.pos.controller[1].controller,a.pos.controller[2].controller)
 	clients = #(b.skin,c.material)
 	subNums = #(-1,1e9)
 
 	LockedTracksMan.SetLocks true &anims &clients &subNums off
 )
 

it works fine in spite of the fact that my second and third arrays are garbage.
ok. help says that all arrays are in and out parameters. so maybe the system returns there the right clients and subnums? nope… why have we pass these arrays if the system anyway ignores them.
well… i thought that right arrays might help the system to work faster… nope. i couldn’t see any difference.

is it not funny?