diff --git a/jme3-examples/src/main/java/jme3test/blender/TestBlenderLoader.java b/jme3-blender/examples/src/main/java/jme3test/blender/TestBlenderLoader.java similarity index 100% rename from jme3-examples/src/main/java/jme3test/blender/TestBlenderLoader.java rename to jme3-blender/examples/src/main/java/jme3test/blender/TestBlenderLoader.java diff --git a/jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java b/jme3-blender/examples/src/main/java/jme3test/light/TestTangentGenBadModels.java similarity index 100% rename from jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java rename to jme3-blender/examples/src/main/java/jme3test/light/TestTangentGenBadModels.java diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java b/jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java similarity index 100% rename from jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java rename to jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java b/jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java similarity index 100% rename from jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java rename to jme3-blender/examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/BaseMesh_249.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseMesh_249.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/BaseMesh_249.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseMesh_249.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/BaseScene.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseScene.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/BaseScene.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/BaseScene.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/MountainValley_Track.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/MountainValley_Track.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/MountainValley_Track.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/MountainValley_Track.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/ObjectAnimation.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/ObjectAnimation.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/ObjectAnimation.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/ObjectAnimation.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/SimpleAnimation.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/SimpleAnimation.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/SimpleAnimation.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/SimpleAnimation.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/Sinbad.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/Sinbad.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/Sinbad.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/Sinbad.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/WoodCrate_lighter.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/animtest.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/animtest.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/animtest.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/animtest.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/constraints.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/constraints.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/constraints.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/constraints.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/curves.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/curves.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/curves.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/curves.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/kerrigan.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/kerrigan.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/kerrigan_diffuse.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan_diffuse.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/kerrigan_diffuse.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/kerrigan_diffuse.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/materials.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/materials.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/materials.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/materials.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/modifiers.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/modifiers.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/modifiers.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/modifiers.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/nurbs.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/nurbs.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/nurbs.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/nurbs.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/particles.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/particles.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/particles.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/particles.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/positions.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/positions.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/positions.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/positions.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/sinbad_body.tga b/jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_body.tga similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/sinbad_body.tga rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_body.tga diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/sinbad_clothes.tga b/jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_clothes.tga similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/sinbad_clothes.tga rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_clothes.tga diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/sinbad_sword.tga b/jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_sword.tga similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/sinbad_sword.tga rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/sinbad_sword.tga diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/texturedPlaneTest.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/texturedPlaneTest.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/texturedPlaneTest.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/texturedPlaneTest.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures.blend b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/Grass_256.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Grass_256.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/Grass_256.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Grass_256.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png diff --git a/jme3-testdata/src/main/resources/Blender/2.4x/textures/WarningStrip.png b/jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/WarningStrip.png similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.4x/textures/WarningStrip.png rename to jme3-blender/testdata/src/main/resources/Blender/2.4x/textures/WarningStrip.png diff --git a/jme3-testdata/src/main/resources/Blender/2.5x/BaseMesh_256.blend b/jme3-blender/testdata/src/main/resources/Blender/2.5x/BaseMesh_256.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.5x/BaseMesh_256.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.5x/BaseMesh_256.blend diff --git a/jme3-testdata/src/main/resources/Blender/2.5x/textures.blend b/jme3-blender/testdata/src/main/resources/Blender/2.5x/textures.blend similarity index 100% rename from jme3-testdata/src/main/resources/Blender/2.5x/textures.blend rename to jme3-blender/testdata/src/main/resources/Blender/2.5x/textures.blend diff --git a/jme3-testdata/src/main/resources/Blender/test.conf b/jme3-blender/testdata/src/main/resources/Blender/test.conf similarity index 100% rename from jme3-testdata/src/main/resources/Blender/test.conf rename to jme3-blender/testdata/src/main/resources/Blender/test.conf diff --git a/jme3-testdata/src/main/resources/Models/HoverTank/tankFinalExport.blend b/jme3-blender/testdata/src/main/resources/Models/HoverTank/tankFinalExport.blend similarity index 100% rename from jme3-testdata/src/main/resources/Models/HoverTank/tankFinalExport.blend rename to jme3-blender/testdata/src/main/resources/Models/HoverTank/tankFinalExport.blend diff --git a/jme3-testdata/src/main/resources/Models/TangentBugs/test.blend b/jme3-blender/testdata/src/main/resources/Models/TangentBugs/test.blend similarity index 100% rename from jme3-testdata/src/main/resources/Models/TangentBugs/test.blend rename to jme3-blender/testdata/src/main/resources/Models/TangentBugs/test.blend diff --git a/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java b/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java index 5861ab894..5ad64889d 100644 --- a/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java +++ b/jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java @@ -58,11 +58,11 @@ import java.util.logging.Logger; public class SavableClassUtil { private final static HashMap CLASS_REMAPPINGS = new HashMap<>(); - + private static void addRemapping(String oldClass, Class newClass){ CLASS_REMAPPINGS.put(oldClass, newClass.getName()); } - + static { addRemapping("com.jme3.effect.EmitterSphereShape", EmitterSphereShape.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.animation.BoneAnimation", 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); } - + private static String remapClass(String className) throws ClassNotFoundException { String result = CLASS_REMAPPINGS.get(className); if (result == null) { @@ -84,7 +88,7 @@ public class SavableClassUtil { return result; } } - + public static boolean isImplementingSavable(Class clazz){ boolean result = Savable.class.isAssignableFrom(clazz); return result; @@ -98,21 +102,21 @@ public class SavableClassUtil { versionList.add(getSavableVersion(superclass)); superclass = superclass.getSuperclass(); } while (superclass != null && SavableClassUtil.isImplementingSavable(superclass)); - + int[] versions = new int[versionList.size()]; for (int i = 0; i < versionList.size(); i++){ versions[i] = versionList.get(i); } return versions; } - + @SuppressWarnings("unchecked") public static int getSavableVersion(Class clazz) throws IOException{ try { Field field = clazz.getField("SAVABLE_VERSION"); Class declaringClass = (Class) field.getDeclaringClass(); if (declaringClass == clazz){ - return field.getInt(null); + return field.getInt(null); }else{ 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 } } - + public static int getSavedSavableVersion(Object savable, Class desiredClass, int[] versions, int formatVersion){ Class thisClass = savable.getClass(); int count = 0; - + while (thisClass != desiredClass) { thisClass = thisClass.getSuperclass(); if (thisClass != null && SavableClassUtil.isImplementingSavable(thisClass)){ @@ -141,26 +145,26 @@ public class SavableClassUtil { } if (thisClass == null){ - throw new IllegalArgumentException(savable.getClass().getName() + - " does not extend " + + throw new IllegalArgumentException(savable.getClass().getName() + + " does not extend " + desiredClass.getName() + "!"); }else if (count >= versions.length){ if (formatVersion <= 1){ return 0; // for buggy versions of j3o }else{ - throw new IllegalArgumentException(savable.getClass().getName() + + throw new IllegalArgumentException(savable.getClass().getName() + " cannot access version of " + - desiredClass.getName() + + desiredClass.getName() + " because it doesn't implement Savable"); } } return versions[count]; } - + /** * 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 - * class is instantiated directly. + * class is instantiated directly. * @param className the class name to create. * @return the Savable instance of the class. * @throws InstantiationException thrown if the class does not have an empty constructor. diff --git a/jme3-core/src/main/resources/com/jme3/asset/General.cfg b/jme3-core/src/main/resources/com/jme3/asset/General.cfg index 2b3b25d93..89fb8e67f 100644 --- a/jme3-core/src/main/resources/com/jme3/asset/General.cfg +++ b/jme3-core/src/main/resources/com/jme3/asset/General.cfg @@ -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.MaterialLoader : material 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.scene.plugins.fbx.FbxLoader : fbx LOADER com.jme3.scene.plugins.gltf.GltfLoader : gltf