Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Azrael on June 03, 2009, 08:16:25 AM

Title: Attached Object and looping animation
Post by: Azrael on June 03, 2009, 08:16:25 AM
I have a 3D actor with an object attached to it. The problem is that if a try to play a looped animation the animation play correctly, but don't loop.
It's possible to loop it? It's set to loop in the object act3d file.

I have also tried to set the animation as idle with "IdleAnimName" attributes, but with no results.
Title: Re: Attached Object and looping animation
Post by: Mnemonic on June 03, 2009, 02:29:13 PM
You mean animation of the actor, or animation of the attachment?
Title: Re: Attached Object and looping animation
Post by: Azrael on June 03, 2009, 03:42:31 PM
Sorry, animation of the attachment.
Title: Re: Attached Object and looping animation
Post by: Mnemonic on June 03, 2009, 10:04:00 PM
You should be able to achieve looping animation for attachment by creating a file with the same name as the .X model, and the .anim extension (e.g. for SomeDude.x create file SomeDude.anim). The file would contain something like this:

Code: [Select]
ANIMATION
  {
    NAME="idle"
    LOOPING=TRUE
  }

The IdleAnimName property is not available for attachments, only for actors (attachments are somewhat limited in functionality compared to actors).
Title: Re: Attached Object and looping animation
Post by: Azrael on June 04, 2009, 07:52:08 AM
Where should this file be placed?

I tried to create this file for the actor, with the same name of the actor, and it didn't work.
I also tried to create this file for the attached object, with the same name of the attached object, and it didn't work.

The animation won't loop  :(
Title: Re: Attached Object and looping animation
Post by: Mnemonic on June 04, 2009, 07:57:16 AM
I tried to create this file for the actor, with the same name of the actor, and it didn't work.
Not the actor, the .X file containing the animation you want to loop.
It must be in the same directory as the .X file.
Title: Re: Attached Object and looping animation
Post by: Azrael on June 04, 2009, 09:31:32 AM
Done. It play the animation ad before, without loop.

The .anim file is in the same directory as the object .x file and with the same name. The name of the anim is the same of the anim that is played trough scripts.
Title: Re: Attached Object and looping animation
Post by: Mnemonic on June 19, 2009, 07:38:33 AM
As far as I can say, it should work. When the X file is loaded, the engine is looking for the .anim file, no matter if the mesh is used for character or for attachment.
I'll have to test it.

Alternatively, there can be looping information stored directly in the .X file, providing the exporter supports this feature, though.
Title: Re: Attached Object and looping animation
Post by: Azrael on June 19, 2009, 12:29:45 PM
I think we tried everything. Also the looping information stored in the .x file.

Everytime the animation works perfectly if the object was placed in the scene alone. But when attached to the main 3d object there was no loop.

Don't worry Mnemonic, we solved taking the two objects separated. It's the best solution because we have to move the main 3d object but with a trick it works however :)