@ -27,6 +27,7 @@ import com.jme3.scene.VertexBuffer.Type;
import com.jme3.scene.VertexBuffer.Usage ;
import com.jme3.scene.VertexBuffer.Usage ;
import com.jme3.scene.plugins.blender.BlenderContext ;
import com.jme3.scene.plugins.blender.BlenderContext ;
import com.jme3.scene.plugins.blender.BlenderContext.LoadedFeatureDataType ;
import com.jme3.scene.plugins.blender.BlenderContext.LoadedFeatureDataType ;
import com.jme3.scene.plugins.blender.animations.AnimationData ;
import com.jme3.scene.plugins.blender.animations.ArmatureHelper ;
import com.jme3.scene.plugins.blender.animations.ArmatureHelper ;
import com.jme3.scene.plugins.blender.animations.BoneContext ;
import com.jme3.scene.plugins.blender.animations.BoneContext ;
import com.jme3.scene.plugins.blender.exceptions.BlenderFileException ;
import com.jme3.scene.plugins.blender.exceptions.BlenderFileException ;
@ -35,7 +36,6 @@ import com.jme3.scene.plugins.blender.file.Pointer;
import com.jme3.scene.plugins.blender.file.Structure ;
import com.jme3.scene.plugins.blender.file.Structure ;
import com.jme3.scene.plugins.blender.meshes.MeshContext ;
import com.jme3.scene.plugins.blender.meshes.MeshContext ;
import com.jme3.scene.plugins.blender.objects.ObjectHelper ;
import com.jme3.scene.plugins.blender.objects.ObjectHelper ;
import com.jme3.scene.plugins.ogre.AnimData ;
import com.jme3.util.BufferUtils ;
import com.jme3.util.BufferUtils ;
/ * *
/ * *
@ -53,7 +53,7 @@ import com.jme3.util.BufferUtils;
private Structure meshStructure ;
private Structure meshStructure ;
/** Loaded animation data. */
/** Loaded animation data. */
private AnimData animData ;
private Animation Data animation Data ;
/** Old memory address of the mesh that will have the skeleton applied. */
/** Old memory address of the mesh that will have the skeleton applied. */
private Long meshOMA ;
private Long meshOMA ;
@ -157,7 +157,7 @@ import com.jme3.util.BufferUtils;
}
}
}
}
animData = new AnimData ( skeleton , animations ) ;
animation Data = new Animation Data ( skeleton , animations ) ;
// store the animation data for each bone
// store the animation data for each bone
for ( Bone bone : bones ) {
for ( Bone bone : bones ) {
@ -165,7 +165,7 @@ import com.jme3.util.BufferUtils;
BoneContext boneContext = blenderContext . getBoneContext ( bone ) ;
BoneContext boneContext = blenderContext . getBoneContext ( bone ) ;
Long boneOma = boneContext . getBoneOma ( ) ;
Long boneOma = boneContext . getBoneOma ( ) ;
if ( boneOma ! = null ) {
if ( boneOma ! = null ) {
blenderContext . setAnimData ( boneOma , animData ) ;
blenderContext . setAnimData ( boneOma , animation Data ) ;
}
}
}
}
}
}
@ -181,7 +181,7 @@ import com.jme3.util.BufferUtils;
if ( invalid ) {
if ( invalid ) {
LOGGER . log ( Level . WARNING , "Armature modifier is invalid! Cannot be applied to: {0}" , node . getName ( ) ) ;
LOGGER . log ( Level . WARNING , "Armature modifier is invalid! Cannot be applied to: {0}" , node . getName ( ) ) ;
} // if invalid, animData will be null
} // if invalid, animData will be null
if ( animData = = null | | skeleton = = null ) {
if ( animation Data = = null | | skeleton = = null ) {
return node ;
return node ;
}
}
@ -221,8 +221,8 @@ import com.jme3.util.BufferUtils;
}
}
// applying animations
// applying animations
AnimControl control = new AnimControl ( animData . skeleton ) ;
AnimControl control = new AnimControl ( animation Data . skeleton ) ;
Array List< Animation > animList = animData . anims ;
List < Animation > animList = animation Data . anims ;
if ( animList ! = null & & animList . size ( ) > 0 ) {
if ( animList ! = null & & animList . size ( ) > 0 ) {
HashMap < String , Animation > anims = new HashMap < String , Animation > ( animList . size ( ) ) ;
HashMap < String , Animation > anims = new HashMap < String , Animation > ( animList . size ( ) ) ;
for ( int i = 0 ; i < animList . size ( ) ; + + i ) {
for ( int i = 0 ; i < animList . size ( ) ; + + i ) {
@ -232,7 +232,7 @@ import com.jme3.util.BufferUtils;
control . setAnimations ( anims ) ;
control . setAnimations ( anims ) ;
}
}
node . addControl ( control ) ;
node . addControl ( control ) ;
node . addControl ( new SkeletonControl ( animData . skeleton ) ) ;
node . addControl ( new SkeletonControl ( animation Data . skeleton ) ) ;
blenderContext . setNodeForSkeleton ( skeleton , node ) ;
blenderContext . setNodeForSkeleton ( skeleton , node ) ;