Hi everybody,
apologies if this is a total noob question but I have already tried to come up
with an solution to this by reading up jme sources and docs/forum and until now have failed to suceed…
I am basically want to get the changed mesh after an animation has run through in part e.g.
“walking” has been performed only for 1s.
In detail I am doing the following:
- loading a blender generated model (ogre exported mesh and skeleton) into jme using asset manager
- triggering an animation on this model and letting it freeze somewhere in between, i.e.
[java]
control = model.getControl(AnimControl.class);
channel = control.createChannel();
channel.setAnim("Walking");
channel.setSpeed(0.0f); // i do not want the animation to proceed beyond the time set in the following (freeze character/object)
channel.setTime(time); // jump some time into the animation
[/java]
- trying to access the mesh modified by the skeleton represented at this time frame
i.e. using various approaches, the last one being:
[java]
SkeletonControl skc = model.getControl(SkeletonControl.class);
Skeleton sk = control.getSkeleton();
Mesh t = skc.getTargets()[0].cloneForAnim();
resetToBind(t); // borrowed from skeletoncontrol.java
Matrix4f [] skm = sk.computeSkinningMatrices();
// expecting t to be the changed mesh
softwareSkinUpdate( t, skm); // borrowed from skeletoncontrol.java
[/java]
While after executing this code the model is correctly visualized i.e. frozen at the set point in the time
the mesh is either empty or (if accessed directly e.g. model.getMesh()) unchanged.
Is it possible to access this information or am I overlooking something?
TIA for your help:).