Browse Source

Fixes #233 Support .glb files

MeFisto94 5 years ago
parent
commit
d9248de204
1 changed files with 11 additions and 5 deletions
  1. 11 5
      jme3-blender/src/com/jme3/gde/blender/GLTFDataObject.java

+ 11 - 5
jme3-blender/src/com/jme3/gde/blender/GLTFDataObject.java

@@ -1,5 +1,5 @@
 /*
 /*
- *  Copyright (c) 2009-2017 jMonkeyEngine
+ *  Copyright (c) 2009-2020 jMonkeyEngine
  *  All rights reserved.
  *  All rights reserved.
  * 
  * 
  *  Redistribution and use in source and binary forms, with or without
  *  Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,6 @@ import org.openide.loaders.DataObject;
 import org.openide.loaders.DataObjectExistsException;
 import org.openide.loaders.DataObjectExistsException;
 import org.openide.loaders.MultiFileLoader;
 import org.openide.loaders.MultiFileLoader;
 import org.openide.util.NbBundle.Messages;
 import org.openide.util.NbBundle.Messages;
-import com.jme3.asset.ModelKey;
 
 
 @Messages({
 @Messages({
     "LBL_GLTF_LOADER=GLTF Files"
     "LBL_GLTF_LOADER=GLTF Files"
@@ -50,8 +49,9 @@ import com.jme3.asset.ModelKey;
 @MIMEResolver.ExtensionRegistration(
 @MIMEResolver.ExtensionRegistration(
     displayName="#LBL_GLTF_LOADER",
     displayName="#LBL_GLTF_LOADER",
     mimeType="model/gltf+json",
     mimeType="model/gltf+json",
-    //mimeType="model/gltf.binary",
-    extension={ "gltf"}
+    //mimeType="model/gltf-binary",
+    // glb has another mimeType but for us, this is irrelevant. The Actions are the same
+    extension={ "gltf", "glb" }
 )
 )
 @DataObject.Registration(
 @DataObject.Registration(
     mimeType = "model/gltf+json", 
     mimeType = "model/gltf+json", 
@@ -82,8 +82,14 @@ import com.jme3.asset.ModelKey;
     @ActionReference(id =
     @ActionReference(id =
     @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/model/gltf+json/Actions", position = 1300)
     @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/model/gltf+json/Actions", position = 1300)
 })
 })
-public class GLTFDataObject extends SpatialAssetDataObject {
 
 
+/**
+ * This class enables the SDK to open and convert <code>.gltf</code> and 
+ * <code>glb</code> files.
+ * 
+ * @author MeFisto94
+ */
+public class GLTFDataObject extends SpatialAssetDataObject {
     public GLTFDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
     public GLTFDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
         super(pf, loader);
         super(pf, loader);
     }
     }