Notifications
Clear all

[Closed] Strange behaviour with the LoadAnimation method

Hey there,

I’ve been struggling with this for a while now. I’ve made a small tool to aid me with a hobby of mine that requires the use of 3DS Max with DAE files. I’ve made a Rollout Floater with some buttons that when pressed load an animation xaf file to all objects. This works fine when I run the script after importing the DAE, however when I run the script before importing or when I import something new into the scene it no loner works and the LoadAnimation method just returns a false.

If anyone has any idea as to what’s going on it’d be very much appreciated.

7 Replies

The animation save and load is very very fussy.
As you have saved off data for a specific set of objects, it would seem you need to try and load it back onto the same objects or it will fail.

The weird thing is that after it starts returning false if I close the floater and rerun the script through Scripting -> Run Script… and click the button again to try and load the animation it works perfectly. This made me think I was just doing someting wrong. I wish it gave a little more information on why it failed instead of just returning false…

you’re right about the “fussiness” … I also struggled with this. But it works if everything is set correctly.

yep, the correct way is poorly documented.

@danvdrees
let’s figure it out … show the ‘scene – code – problem’

without it, I may only sympathize

I’ve recorded some that hopefully shows the problem I’m having. I start with a scene with just the skeleton and no animations on the bones whatsoever. I then run the script and load a movement animation which works. I then reopen the same scene and try to load the animation file through the button again but this time it fails. I close the floater and re-run the script, press the button again and now it does load. My goal would be to not have to constantly run my script again when anything changes in the scene.

The first thing I would recommend is printing out all the nodes in objects in your event handler, to confirm there is not something weird going on there.

What properties should I be printing? I’ve already tried printing it with the following loop and the outputs were identical:

  for o in objects do 
  (
  	objName = o.name as string
  	objPos = o.pos as string
  	objRot = o.rotation as string 

  	print ("name:" + objName + " pos:" + objPos + " rot:" + objRot )
  )