|
|
@ -53,8 +53,8 @@ import com.jme3.scene.plugins.blender.meshes.TemporalMesh; |
|
|
|
modifying = useBoneEnvelopes || useVertexGroups; |
|
|
|
modifying = useBoneEnvelopes || useVertexGroups; |
|
|
|
if (modifying) {// if neither option is used the modifier will not modify anything anyway
|
|
|
|
if (modifying) {// if neither option is used the modifier will not modify anything anyway
|
|
|
|
Structure armatureObject = pArmatureObject.fetchData().get(0); |
|
|
|
Structure armatureObject = pArmatureObject.fetchData().get(0); |
|
|
|
|
|
|
|
if(blenderContext.getSkeleton(armatureObject.getOldMemoryAddress()) == null) { |
|
|
|
// load skeleton
|
|
|
|
LOGGER.fine("Creating new skeleton for armature modifier."); |
|
|
|
Structure armatureStructure = ((Pointer) armatureObject.getFieldValue("data")).fetchData().get(0); |
|
|
|
Structure armatureStructure = ((Pointer) armatureObject.getFieldValue("data")).fetchData().get(0); |
|
|
|
List<Structure> bonebase = ((Structure) armatureStructure.getFieldValue("bonebase")).evaluateListBase(); |
|
|
|
List<Structure> bonebase = ((Structure) armatureStructure.getFieldValue("bonebase")).evaluateListBase(); |
|
|
|
List<Bone> bonesList = new ArrayList<Bone>(); |
|
|
|
List<Bone> bonesList = new ArrayList<Bone>(); |
|
|
@ -65,6 +65,9 @@ import com.jme3.scene.plugins.blender.meshes.TemporalMesh; |
|
|
|
Bone[] bones = bonesList.toArray(new Bone[bonesList.size()]); |
|
|
|
Bone[] bones = bonesList.toArray(new Bone[bonesList.size()]); |
|
|
|
skeleton = new Skeleton(bones); |
|
|
|
skeleton = new Skeleton(bones); |
|
|
|
blenderContext.setSkeleton(armatureObject.getOldMemoryAddress(), skeleton); |
|
|
|
blenderContext.setSkeleton(armatureObject.getOldMemoryAddress(), skeleton); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
skeleton = blenderContext.getSkeleton(armatureObject.getOldMemoryAddress()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
modifying = false; |
|
|
|
modifying = false; |
|
|
|