PDA

View Full Version : Animation Clip Duration trouble


gattomanzo
02-21-2008, 08:50 AM
PROBLEM SOLVED, READ BELOW


hi there,

having some serious troubles with animation clip length in XNA,
i've tryed almost anything but i couldn't have a loop animation clip inside xnaviewer, everything i export goes beyond its last keyframe and have infinite (00:00:00) duration value.

it could be caused by a bug inside the export process, because the tutorial objects and scenes export correctly (so they could have inherited correct values from 1.0 XNA plugin), even if i create new clips, and alternatively xna models creatd from scratch do all have the same duration lentgh problem.


any help appreciated.


(link to wrong file removed)


-----------------------------SOLUTION-----------------------------------------

mirroring here solution posted in XNA forums

"aiutati, che Dio t'aiuta" :-)

well guys, it seems that this time we helped ourselves alone.

after an entire day on this problem we've managed to solve the Duration Action Clip problem.

to obtain a correct animation time do the following steps:
xna toolbar -> create model (yup NOT skinned).
put you mesh inside this newly creatd model and remove the cube.
give a phong.fx to your mesh (without this skeleton will not work).
create your skeleton, if you have multiple segments keep in mind that you mustn't parent roots to effectors, but to last bone (jeez my english is terrible!). At last you must have only one compact skeleton.
middle click the entire skeleton root and drag it inside your model.
do envelope procedure.
select all roots, activate translation and create a Character Key Set.
select all bones, activate rotation and add market parameters to key set.
animate your character with key character set option.
action->store->character key set animation or current values, ok with default parameters.
publish your model.et voilą

sincerely hoping that this can be of any help, if not drop a line here.

Mentezero staff

slayczar
02-21-2008, 11:16 PM
Hey there - firstly let me thank you for researching this problem because it's driving me up the wall.

Secondly, I still can't get the animation to loop; even the example "sample.xsi" model does not seem to be looping. I'd followed your directions and the models that I'd created do not loop as well.


I'm using the basic softimage_xnaviewer project along with the xsi 6.0 mod tool.

Regards,
Caesar

slayczar
02-22-2008, 12:06 AM
I have successfully imported and re-published the simple_joint.xsi from the sample models directory and it still loops correctly - so I don't think it's the 2.0 exporter.

I have tried to recreate an exact copy of the simple_joint model from scratch, but I've had no luck yet with getting it to loop.

Thanks,
Caesar

slayczar
02-22-2008, 12:20 AM
Ok I got it now...

I followed your directions again, but this time I added a root null and then escorted the envelope nulls under it; my model now loops as desired.

~Caesar

gattomanzo
02-22-2008, 09:24 AM
Ok I got it now...

I followed your directions again, but this time I added a root null and then escorted the envelope nulls under it; my model now loops as desired.

~Caesar

i'm very happy that my work has been useful, anyway i've seen that the important thing for skeleton is that you have only one main parent in hyerarchy, null of chain root, and it seems that XNA takes the length of the clip by its animation.

soon i'll hope to show our job in this forum.

keep up the good work!

hank freid love
05-31-2008, 05:50 AM
I was having problems with this too and while I still cant get the models to export with the correct clip duration I did find out that you can set the cip duration in code by doing this Models[CurrentModel].Animations[0].Duration = new TimeSpan(0,0,2); just thought I would let everyone know this is another work around for the problem.

jentzenmooney
09-28-2008, 02:26 AM
Thank you for sharing your findings with others
/J