Author Topic: Morpher Issue?  (Read 1315 times)

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Morpher Issue?
« on: September 24, 2014, 08:42:30 am »
Raft, please check this (http://www.jpct.net/forum2/index.php/topic,4127.0.html) thread out. I went with the path of greater resistance but indeed greater results (Egon's second option). But in doing so, I think that I may have exposed a bug in bones.

The model has been re-rigged and exported as a two-part model (submesh0 for everything opaque and submesh1 for the furry parts). It looks phenomenal. But it had three morph targets in Max. Of those, I only used one (which is properly listed in OgreMax both for the fur and for the body--same names all around (fur has an "Idle" for Skin, body has an Idle for Skin, etc.)) in my idle animation. I'm fairly certain that as I execute the following code, only AnimatedGroup.get(0)'s morph is being used.
Code: [Select]
model.animateSkin(frame, currentAnimation);
model.applyAnimation();
if (poseClipSequence != null)
     model.animatePose(frame, currentPoseAnimation);//IT'S NOT NULL, AND THE MODEL IS BLINKING, BUT I DON'T THINK THAT THE FUR'S animatePose() IS BEING CALLED
model.applySkeletonPose();
model.applyAnimation();

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Morpher Issue?
« Reply #1 on: September 24, 2014, 12:59:15 pm »
looking at the AnimationBlendSample, the correct order of calls should be:

Code: [Select]
animatedGroup.animatePose(..)
animatedGroup.animatePose(..)
..
animatedGroup.animateSkin(..)

animatedGroup.applyAnimation()

does that help you?

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Morpher Issue?
« Reply #2 on: September 24, 2014, 05:10:24 pm »
No, I think that I got around that by calling applyAnimation() between animateSkin() and animatePose(). My problem is that only sub object 0's pose seems to be getting animated.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Morpher Issue?
« Reply #3 on: September 24, 2014, 05:48:17 pm »
not really. you cannot workaround it. pose animation will clear skin animation of relevant polygons if applied after skin animation

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Morpher Issue?
« Reply #4 on: September 24, 2014, 06:29:08 pm »
But it's not. The character is moving just fine. I'll flip the order, but I don't think that will solve the morpher thing, do you?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Morpher Issue?
« Reply #5 on: September 24, 2014, 06:40:48 pm »
not sure but possible. i correct my self. pose animation does not clear skin animation but its direction is effected by it. for example if there is a pose anim making nose taller and you rotate the head 90 degrees by skin animation, nose will distorted to side instead of to front.

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Morpher Issue?
« Reply #6 on: September 24, 2014, 07:45:53 pm »
Oh, that makes more sense. Thanks. I'll post my result soon.

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Morpher Issue?
« Reply #7 on: September 24, 2014, 08:02:57 pm »
I tried several combinations of the following code, but the only way in which he blinks is with the above (and following) code:
Code: [Select]
model.animateSkin(animationPosition, currentAnimation);
// model.applyAnimation();//ACTUALLY THIS ONE IS NOT NEEDED
if (poseClipSequence != null)
     model.animatePose(animationPosition, currentPoseAnimation);
model.applySkeletonPose();
model.applyAnimation();

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Morpher Issue?
« Reply #8 on: September 24, 2014, 08:09:59 pm »
well thats not the way. i'm not sure whats going on there. please have a look at AnimationBlendSample. you can also try your model there