- fix blender loader texture locating when blender model is loaded from assetmanager root

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8225 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent c5b9fef193
commit 450e40df32
  1. 3
      engine/src/blender/com/jme3/scene/plugins/blender/textures/TextureHelper.java

@ -716,7 +716,8 @@ public class TextureHelper extends AbstractBlenderHelper {
String relativePath = name.substring(2);
//augument the path with blender key path
BlenderKey blenderKey = dataRepository.getBlenderKey();
String blenderAssetFolder = blenderKey.getName().substring(0, blenderKey.getName().lastIndexOf('/'));
int idx = blenderKey.getName().lastIndexOf('/');
String blenderAssetFolder = blenderKey.getName().substring(0, idx != -1 ? idx : 0);
assetNames.add(blenderAssetFolder+'/'+relativePath);
} else {//use every path from the asset name to the root (absolute path)
String[] paths = name.split("\\/");

Loading…
Cancel
Save