Ogremax animation separate timelines? [solved]

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
mpellegr
Halfling
Posts: 73
Joined: Thu Jan 10, 2013 4:29 pm
x 1

Ogremax animation separate timelines? [solved]

Post by mpellegr »

I currently have models exported from 3DS Max using Ogre Max. I have a set of animations for these models. The problem is when Ogre loads the mesh file, the animations are all contained in one AnimationState. It's like Ogre isn't recognizing that there are multiple animations and it's just lumping them in to one timeline. Is there a way to export the animations so that I can retrieve them in app like I'm currently doing:

Code: Select all

//getting animations
AnimationState* idleState = entity->getAnimationState("idle");
AnimationState* walkState = entity->getAnimationState("walk"); 

//animate the appropriate animation
if(velocity == 0 && idleState != NULL){
   idleState->setLoop(true);
   idleState->setEnabled(true);

   idleState->addTime(ms/1000.0);
}
else if(walkState != NULL){
   walkState->setLoop(true);
   walkState->setEnabled(true);

   walkState->addTime(ms/1000.0);
}
instead of something like:

Code: Select all

//getting animations
AnimationState* idleAndWalkState = entity->getAnimationState("idleAndWalk");

if(idleAndWalkState != NULL){
   idleAndWalkState->setLoop(true);
   idleAndWalkState->setEnabled(true);

   if(velocity == 0){
      if(idleAndWalkState->getTimePosition() > IDLE_TIME_END){
         idleAndWalkState->setTimePosition(0);
      }
   }
   else{
      if(idleAndWalkState->getTimePosition() < WALK_TIME_START){
         idleAndWalkState->setTimePosition(WALK_TIME_START);
      }
   }

   idleAndWalkState->addTime(ms/1000.0);
}
Last edited by mpellegr on Wed Mar 13, 2013 6:27 pm, edited 1 time in total.

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7153
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 523

Re: Ogremax animation separate timelines?

Post by Kojack »

Normally in ogremax you model all the animations in a sequence (it sounds like you have that part) then mark the start and end frame number of each state and put in their names. This is done in the object properties window in the mesh animation tab:
http://www.ogremax.com/Documents/OgreMa ... ation.html
You need to use the Add button in the lower half of the dialog to create animation states for the object.

mpellegr
Halfling
Posts: 73
Joined: Thu Jan 10, 2013 4:29 pm
x 1

Re: Ogremax animation separate timelines?

Post by mpellegr »

Awesome, thanks it worked.

Post Reply