Bugfix: fixed a bug that caused models to be heavily spoiled if they had armatures with identical bones' names.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10926 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
9289d03604
commit
17a0554897
@ -529,15 +529,18 @@ public class BlenderContext {
|
|||||||
/**
|
/**
|
||||||
* Returns bone by given name.
|
* Returns bone by given name.
|
||||||
*
|
*
|
||||||
|
* @param skeletonOMA the OMA of the skeleton where the bone will be searched
|
||||||
* @param name
|
* @param name
|
||||||
* the name of the bone
|
* the name of the bone
|
||||||
* @return found bone or null if none bone of a given name exists
|
* @return found bone or null if none bone of a given name exists
|
||||||
*/
|
*/
|
||||||
public BoneContext getBoneByName(String name) {
|
public BoneContext getBoneByName(Long skeletonOMA, String name) {
|
||||||
for (Entry<Long, BoneContext> entry : boneContexts.entrySet()) {
|
for (Entry<Long, BoneContext> entry : boneContexts.entrySet()) {
|
||||||
Bone bone = entry.getValue().getBone();
|
if(entry.getValue().getArmatureObjectOMA().equals(skeletonOMA)) {
|
||||||
if (bone != null && name.equals(bone.getName())) {
|
Bone bone = entry.getValue().getBone();
|
||||||
return entry.getValue();
|
if (bone != null && name.equals(bone.getName())) {
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -221,7 +221,7 @@ public class ConstraintHelper extends AbstractBlenderHelper {
|
|||||||
boolean isArmature = blenderContext.getMarkerValue(ArmatureHelper.ARMATURE_NODE_MARKER, feature) != null;
|
boolean isArmature = blenderContext.getMarkerValue(ArmatureHelper.ARMATURE_NODE_MARKER, feature) != null;
|
||||||
if (isArmature) {
|
if (isArmature) {
|
||||||
blenderContext.getSkeleton(oma).updateWorldVectors();
|
blenderContext.getSkeleton(oma).updateWorldVectors();
|
||||||
BoneContext targetBoneContext = blenderContext.getBoneByName(subtargetName);
|
BoneContext targetBoneContext = blenderContext.getBoneByName(oma, subtargetName);
|
||||||
Bone bone = targetBoneContext.getBone();
|
Bone bone = targetBoneContext.getBone();
|
||||||
|
|
||||||
if(bone.getParent() == null && (space == Space.CONSTRAINT_SPACE_LOCAL || space == Space.CONSTRAINT_SPACE_PARLOCAL)) {
|
if(bone.getParent() == null && (space == Space.CONSTRAINT_SPACE_LOCAL || space == Space.CONSTRAINT_SPACE_PARLOCAL)) {
|
||||||
@ -298,7 +298,7 @@ public class ConstraintHelper extends AbstractBlenderHelper {
|
|||||||
boolean isArmature = blenderContext.getMarkerValue(ArmatureHelper.ARMATURE_NODE_MARKER, feature) != null;
|
boolean isArmature = blenderContext.getMarkerValue(ArmatureHelper.ARMATURE_NODE_MARKER, feature) != null;
|
||||||
if (isArmature) {
|
if (isArmature) {
|
||||||
Skeleton skeleton = blenderContext.getSkeleton(oma);
|
Skeleton skeleton = blenderContext.getSkeleton(oma);
|
||||||
BoneContext targetBoneContext = blenderContext.getBoneByName(subtargetName);
|
BoneContext targetBoneContext = blenderContext.getBoneByName(oma, subtargetName);
|
||||||
Bone bone = targetBoneContext.getBone();
|
Bone bone = targetBoneContext.getBone();
|
||||||
|
|
||||||
if(bone.getParent() == null && (space == Space.CONSTRAINT_SPACE_LOCAL || space == Space.CONSTRAINT_SPACE_PARLOCAL)) {
|
if(bone.getParent() == null && (space == Space.CONSTRAINT_SPACE_LOCAL || space == Space.CONSTRAINT_SPACE_PARLOCAL)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user