From 94451c4d35b2b5c96debea8f153f947d4b971ec9 Mon Sep 17 00:00:00 2001 From: pspeed42 Date: Sun, 19 Apr 2020 17:53:24 -0400 Subject: [PATCH] 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. --- .../jme3test/blender/TestBlenderLoader.java | 0 .../light/TestTangentGenBadModels.java | 0 .../jme3test/model/anim/TestBlenderAnim.java | 0 .../model/anim/TestBlenderObjectAnim.java | 0 .../resources/Blender/2.4x/BaseMesh_249.blend | Bin .../resources/Blender/2.4x/BaseScene.blend | Bin .../Blender/2.4x/MountainValley_Track.blend | Bin .../Blender/2.4x/ObjectAnimation.blend | Bin .../Blender/2.4x/SimpleAnimation.blend | Bin .../main/resources/Blender/2.4x/Sinbad.blend | Bin ...dCrate_lighter - (Inverted Normal Map).png | Bin .../2.4x/WoodCrate_lighter - Height Map.png | Bin .../Blender/2.4x/WoodCrate_lighter.png | Bin .../resources/Blender/2.4x/animtest.blend | Bin .../resources/Blender/2.4x/constraints.blend | Bin .../main/resources/Blender/2.4x/curves.blend | Bin .../resources/Blender/2.4x/kerrigan.blend | Bin .../Blender/2.4x/kerrigan_diffuse.png | Bin .../resources/Blender/2.4x/materials.blend | Bin .../resources/Blender/2.4x/modifiers.blend | Bin .../main/resources/Blender/2.4x/nurbs.blend | Bin .../resources/Blender/2.4x/particles.blend | Bin .../resources/Blender/2.4x/positions.blend | Bin .../resources/Blender/2.4x/sinbad_body.tga | Bin .../resources/Blender/2.4x/sinbad_clothes.tga | Bin .../resources/Blender/2.4x/sinbad_sword.tga | Bin .../Blender/2.4x/texturedPlaneTest.blend | Bin .../resources/Blender/2.4x/textures.blend | Bin .../Blender/2.4x/textures/Concrete_Wall.PNG | Bin .../Blender/2.4x/textures/Grass_256.png | Bin .../2.4x/textures/SandDesert_StartTower.png | Bin .../Blender/2.4x/textures/SkyBox-Mountain.png | Bin .../Blender/2.4x/textures/Tar_Cracked.png | Bin .../Blender/2.4x/textures/WarningStrip.png | Bin .../resources/Blender/2.5x/BaseMesh_256.blend | Bin .../resources/Blender/2.5x/textures.blend | Bin .../src/main/resources/Blender/test.conf | Bin .../Models/HoverTank/tankFinalExport.blend | Bin .../resources/Models/TangentBugs/test.blend | Bin .../com/jme3/export/SavableClassUtil.java | 34 ++++++++++-------- .../main/resources/com/jme3/asset/General.cfg | 1 - 41 files changed, 19 insertions(+), 16 deletions(-) rename {jme3-examples => jme3-blender/examples}/src/main/java/jme3test/blender/TestBlenderLoader.java (100%) rename {jme3-examples => jme3-blender/examples}/src/main/java/jme3test/light/TestTangentGenBadModels.java (100%) rename {jme3-examples => jme3-blender/examples}/src/main/java/jme3test/model/anim/TestBlenderAnim.java (100%) rename {jme3-examples => jme3-blender/examples}/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/BaseMesh_249.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/BaseScene.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/MountainValley_Track.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/ObjectAnimation.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/SimpleAnimation.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/Sinbad.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/WoodCrate_lighter - (Inverted Normal Map).png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/WoodCrate_lighter - Height Map.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/WoodCrate_lighter.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/animtest.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/constraints.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/curves.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/kerrigan.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/kerrigan_diffuse.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/materials.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/modifiers.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/nurbs.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/particles.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/positions.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/sinbad_body.tga (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/sinbad_clothes.tga (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/sinbad_sword.tga (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/texturedPlaneTest.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/Concrete_Wall.PNG (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/Grass_256.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/SandDesert_StartTower.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/SkyBox-Mountain.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/Tar_Cracked.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.4x/textures/WarningStrip.png (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.5x/BaseMesh_256.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/2.5x/textures.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Blender/test.conf (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Models/HoverTank/tankFinalExport.blend (100%) rename {jme3-testdata => jme3-blender/testdata}/src/main/resources/Models/TangentBugs/test.blend (100%) 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