Notifications
Clear all

[Closed] Track "path"

 JHN

Hi all,

I can’t seem to find a way to get the current controllers “path” like seen in the trackview or recorded by “save animation”.

So for a morph target track in save animation I get something like :
“c_face_sss_geo_001 \ Modified Object \ Modified Object \ Modified Object \ Morpher \ [3] lips (Target Available)”

I tried something like:


exprForMAXObject $.modifiers[3][1].controller
"$c_face_sss_geo_001.modifiers[#Morpher]"

Obviously not what I want.

Is there any known way to get a good path like from the trackview (including Modified Object) without a lot of hacking?

Thanks,
-Johan

8 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

it sounds like you want to know how openSaveAnimation interfaces saves the controller above. here is how to do it:

[b]a = LoadSaveAnimation.setUpAnimsForSave $c_face_sss_geo_001[/b]

showinterface a[1]
  Interface: nodeAndAnims
   Properties:
   Methods:
	<Interface>getList()
	<node>getNode()
   Actions:
OK

[b]b = a[1].getList()[/b]

showinterface b
  Interface: xmlAnimTreeEntryList
   Properties:
   Methods:
	<Interface>getEntry index
	<integer>count()
	<void>zeroCount()
	<void>shrink()
	<integer>deleteItems start num
	<integer>findFromAnim anim start
	<integer>find name unique
   Actions:
OK

[b]c = b.getEntry 1

[/b]showinterface c
  Interface: xmlAnimTreeEntry
   Properties:
	.getAnim : maxObject : Read
	.getClient : maxObject : Read
	.getSubName : integer : Read
	.getName : string : Read
	.getUnique : integer : Read
	.getMapName : string : Read
	.getMapUnique : integer : Read
   Methods:
	<bool>isType type
	   type enums: {#none|#transform|#baseObject|#modObject|#noteTracks|#visTracks|#matMaps|#matParams|#customAttributes|#iK|#pos|#rot|#scale|#pos|#posY|#posZ|#list|#keyable|#rotX|#rotY|#rotZ|#scaleX|#scaleY|#scaleZ|#exposeWorldTransform}
   Actions:
OK

[b]c.getName [/b]

it’s the name you are looking for if only this controller was animated
if not, you have to search through all Entries and compare their anim (getAnim) with your controller (or any other subanim you want to find)

Is there any known way to get a good path like from the trackview (including Modified Object) without a lot of hacking?

Hi Johan,

Without hacking? no. My attempts to save custom XAF files involved saving the file as normal but using LoadSaveAnimation.setUpAnimsForSave and removing any entries that I didn’t want. I then had to parse the file to remove the /MaxAnimation/Node/Samples to clean up the file so I just had modifier animation left.

Horrible, but functional – my scripting ethos in one…

 JHN

Hi Pete, hope all is well!

I figured something like that too, but hoped to have missed that one obvious global max function that would save me… but alas.

Already figured out the parser, now all I need is a autoremapper… It’s awesome how easy PRS data is transferred and how easy modifier data is stored, it’s mind boggling load animation doesn’t pick up any of that stuff and matching is such a joke. Ohwell, time to earn that paycheck

A related question, is there any solid way to iterate the subAnims to check for animated tracks, again like save animation does.

Thanks!
-Johan

Auto-remapping is simple between character rigs that are the same, you just use regex or stringbuilder (dont use MXS – it sucks with string ops) to change the object names in the xaf file. We use this to remap between instances of the same character or characters with a similar rig component. Works perfectly!

 JHN

Yeah, I don’t foresee a lot of problems with the logics, more with max… just found a nice bug.

If you have an instanced skin over multiple objects, like a head and body. Then beneath skin you have a morpher for facial expressions and on top of it all a instanced TurboSmooth.
TS

  • Skin
    -Morpher
    -Poly

Now Load animation cannot load on the Morpher anymore, also the mapping dialog doesn’t see the morpher anymore, probably because of the modifier stack being branched or something. Now I need to move the morpher to the top, change the map file (.xaf) and when done, move the modifier down again… It’s tiresome…

I really think load save animation is pretty good, all key data is preserved and you can safely transfer to a different framerate because of ticks, but then it fails in the simplest of things…

Sounds like a pain, Johan. I hadn’t had anything like that. Yes the tangent data is solid, it’s scripting interface that’s the problem. But delving into to that is a million times better than enduring the remap animation dialog. :argh:

 JHN

Hi Denis,

Yeah, I found that interface too and figured it out, not thanks to the manual, there’s no mention of any of those interfaces. And the help itself is very thin on details or best practices… on such an important feature.

It goes to show how important animation is to max.

here is all said above made as function:

fn getLoadSaveAnimationName node anim firstOnly:off = 
(
	data = LoadSaveAnimation.setUpAnimsForSave node animatedTracks:off includeContraints:on keyable:off
	names = #()
	out = off
	for d in data while not out do
	(
		list = d.getList()
		for k=1 to list.count() do
		(
			entry = list.getEntry k
			if entry.getAnim == anim do
			(
				append names entry.getName
				if firstOnly do out = on
			)
		)
	)
	if firstOnly then names[1] else names

)