Moving all of the blender-related stuff under the jme3-blender subdirectory

to make it easier to move to its own repository and keep all of the history.
master
pspeed42 5 years ago
parent 7212f9b2b2
commit 94451c4d35
  1. 0
      jme3-blender/examples/src/main/java/jme3test/blender/TestBlenderLoader.java
  2. 0
      jme3-blender/examples/src/main/java/jme3test/light/TestTangentGenBadModels.java
  3. 0
      jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java
  4. 0
      jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java
  5. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseMesh_249.blend
  6. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseScene.blend
  7. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/MountainValley_Track.blend
  8. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/ObjectAnimation.blend
  9. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/SimpleAnimation.blend
  10. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/Sinbad.blend
  11. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png
  12. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png
  13. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter.png
  14. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/animtest.blend
  15. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/constraints.blend
  16. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/curves.blend
  17. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan.blend
  18. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan_diffuse.png
  19. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/materials.blend
  20. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/modifiers.blend
  21. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/nurbs.blend
  22. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/particles.blend
  23. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/positions.blend
  24. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_body.tga
  25. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_clothes.tga
  26. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_sword.tga
  27. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/texturedPlaneTest.blend
  28. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures.blend
  29. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG
  30. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Grass_256.png
  31. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png
  32. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png
  33. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png
  34. 0
      jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/WarningStrip.png
  35. 0
      jme3-blender/testdata/src/main/resources/Blender/2.5x/BaseMesh_256.blend
  36. 0
      jme3-blender/testdata/src/main/resources/Blender/2.5x/textures.blend
  37. 0
      jme3-blender/testdata/src/main/resources/Blender/test.conf
  38. 0
      jme3-blender/testdata/src/main/resources/Models/HoverTank/tankFinalExport.blend
  39. 0
      jme3-blender/testdata/src/main/resources/Models/TangentBugs/test.blend
  40. 34
      jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java
  41. 1
      jme3-core/src/main/resources/com/jme3/asset/General.cfg

@ -58,11 +58,11 @@ import java.util.logging.Logger;
public class SavableClassUtil { public class SavableClassUtil {
private final static HashMap<String, String> CLASS_REMAPPINGS = new HashMap<>(); private final static HashMap<String, String> CLASS_REMAPPINGS = new HashMap<>();
private static void addRemapping(String oldClass, Class<? extends Savable> newClass){ private static void addRemapping(String oldClass, Class<? extends Savable> newClass){
CLASS_REMAPPINGS.put(oldClass, newClass.getName()); CLASS_REMAPPINGS.put(oldClass, newClass.getName());
} }
static { static {
addRemapping("com.jme3.effect.EmitterSphereShape", EmitterSphereShape.class); addRemapping("com.jme3.effect.EmitterSphereShape", EmitterSphereShape.class);
addRemapping("com.jme3.effect.EmitterBoxShape", EmitterBoxShape.class); addRemapping("com.jme3.effect.EmitterBoxShape", EmitterBoxShape.class);
@ -73,9 +73,13 @@ public class SavableClassUtil {
addRemapping("com.jme3.material.Material$MatParamTexture", MatParamTexture.class); addRemapping("com.jme3.material.Material$MatParamTexture", MatParamTexture.class);
addRemapping("com.jme3.animation.BoneAnimation", Animation.class); addRemapping("com.jme3.animation.BoneAnimation", Animation.class);
addRemapping("com.jme3.animation.SpatialAnimation", Animation.class); addRemapping("com.jme3.animation.SpatialAnimation", Animation.class);
// Even though we no longer include Blender loading as part of the engine,
// we leave this line in so that old j3os will still work and just not
// load that data. -pspeed:2020-04-19
addRemapping("com.jme3.scene.plugins.blender.objects.Properties", NullSavable.class); addRemapping("com.jme3.scene.plugins.blender.objects.Properties", NullSavable.class);
} }
private static String remapClass(String className) throws ClassNotFoundException { private static String remapClass(String className) throws ClassNotFoundException {
String result = CLASS_REMAPPINGS.get(className); String result = CLASS_REMAPPINGS.get(className);
if (result == null) { if (result == null) {
@ -84,7 +88,7 @@ public class SavableClassUtil {
return result; return result;
} }
} }
public static boolean isImplementingSavable(Class clazz){ public static boolean isImplementingSavable(Class clazz){
boolean result = Savable.class.isAssignableFrom(clazz); boolean result = Savable.class.isAssignableFrom(clazz);
return result; return result;
@ -98,21 +102,21 @@ public class SavableClassUtil {
versionList.add(getSavableVersion(superclass)); versionList.add(getSavableVersion(superclass));
superclass = superclass.getSuperclass(); superclass = superclass.getSuperclass();
} while (superclass != null && SavableClassUtil.isImplementingSavable(superclass)); } while (superclass != null && SavableClassUtil.isImplementingSavable(superclass));
int[] versions = new int[versionList.size()]; int[] versions = new int[versionList.size()];
for (int i = 0; i < versionList.size(); i++){ for (int i = 0; i < versionList.size(); i++){
versions[i] = versionList.get(i); versions[i] = versionList.get(i);
} }
return versions; return versions;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static int getSavableVersion(Class<? extends Savable> clazz) throws IOException{ public static int getSavableVersion(Class<? extends Savable> clazz) throws IOException{
try { try {
Field field = clazz.getField("SAVABLE_VERSION"); Field field = clazz.getField("SAVABLE_VERSION");
Class<? extends Savable> declaringClass = (Class<? extends Savable>) field.getDeclaringClass(); Class<? extends Savable> declaringClass = (Class<? extends Savable>) field.getDeclaringClass();
if (declaringClass == clazz){ if (declaringClass == clazz){
return field.getInt(null); return field.getInt(null);
}else{ }else{
return 0; // This class doesn't declare this field, e.g. version == 0 return 0; // This class doesn't declare this field, e.g. version == 0
} }
@ -126,11 +130,11 @@ public class SavableClassUtil {
return 0; // not using versions return 0; // not using versions
} }
} }
public static int getSavedSavableVersion(Object savable, Class<? extends Savable> desiredClass, int[] versions, int formatVersion){ public static int getSavedSavableVersion(Object savable, Class<? extends Savable> desiredClass, int[] versions, int formatVersion){
Class thisClass = savable.getClass(); Class thisClass = savable.getClass();
int count = 0; int count = 0;
while (thisClass != desiredClass) { while (thisClass != desiredClass) {
thisClass = thisClass.getSuperclass(); thisClass = thisClass.getSuperclass();
if (thisClass != null && SavableClassUtil.isImplementingSavable(thisClass)){ if (thisClass != null && SavableClassUtil.isImplementingSavable(thisClass)){
@ -141,26 +145,26 @@ public class SavableClassUtil {
} }
if (thisClass == null){ if (thisClass == null){
throw new IllegalArgumentException(savable.getClass().getName() + throw new IllegalArgumentException(savable.getClass().getName() +
" does not extend " + " does not extend " +
desiredClass.getName() + "!"); desiredClass.getName() + "!");
}else if (count >= versions.length){ }else if (count >= versions.length){
if (formatVersion <= 1){ if (formatVersion <= 1){
return 0; // for buggy versions of j3o return 0; // for buggy versions of j3o
}else{ }else{
throw new IllegalArgumentException(savable.getClass().getName() + throw new IllegalArgumentException(savable.getClass().getName() +
" cannot access version of " + " cannot access version of " +
desiredClass.getName() + desiredClass.getName() +
" because it doesn't implement Savable"); " because it doesn't implement Savable");
} }
} }
return versions[count]; return versions[count];
} }
/** /**
* fromName creates a new Savable from the provided class name. First registered modules * fromName creates a new Savable from the provided class name. First registered modules
* are checked to handle special cases, if the modules do not handle the class name, the * are checked to handle special cases, if the modules do not handle the class name, the
* class is instantiated directly. * class is instantiated directly.
* @param className the class name to create. * @param className the class name to create.
* @return the Savable instance of the class. * @return the Savable instance of the class.
* @throws InstantiationException thrown if the class does not have an empty constructor. * @throws InstantiationException thrown if the class does not have an empty constructor.

@ -20,7 +20,6 @@ LOADER com.jme3.scene.plugins.ogre.MeshLoader : meshxml, mesh.xml
LOADER com.jme3.scene.plugins.ogre.SkeletonLoader : skeletonxml, skeleton.xml LOADER com.jme3.scene.plugins.ogre.SkeletonLoader : skeletonxml, skeleton.xml
LOADER com.jme3.scene.plugins.ogre.MaterialLoader : material LOADER com.jme3.scene.plugins.ogre.MaterialLoader : material
LOADER com.jme3.scene.plugins.ogre.SceneLoader : scene LOADER com.jme3.scene.plugins.ogre.SceneLoader : scene
LOADER com.jme3.scene.plugins.blender.BlenderModelLoader : blend
LOADER com.jme3.shader.plugins.GLSLLoader : vert, frag, geom, tsctrl, tseval, glsl, glsllib LOADER com.jme3.shader.plugins.GLSLLoader : vert, frag, geom, tsctrl, tseval, glsl, glsllib
LOADER com.jme3.scene.plugins.fbx.FbxLoader : fbx LOADER com.jme3.scene.plugins.fbx.FbxLoader : fbx
LOADER com.jme3.scene.plugins.gltf.GltfLoader : gltf LOADER com.jme3.scene.plugins.gltf.GltfLoader : gltf

Loading…
Cancel
Save