-
Notifications
You must be signed in to change notification settings - Fork 105
Revert remove blender #709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
neph1
wants to merge
3
commits into
jMonkeyEngine:master
Choose a base branch
from
neph1:revert-remove-blender
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- You may freely edit this file. See harness/README in the NetBeans platform --> | ||
| <!-- for some information on what you could do (e.g. targets to override). --> | ||
| <!-- If you delete this file and reopen the project it will be recreated. --> | ||
| <project name="com.jme3.gde.blender" default="netbeans" basedir="."> | ||
| <description>Builds, tests, and runs the project com.jme3.gde.blender.</description> | ||
| <import file="nbproject/build-impl.xml"/> | ||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Manifest-Version: 1.0 | ||
| OpenIDE-Module: com.jme3.gde.blender | ||
| OpenIDE-Module-Implementation-Version: 0 | ||
| OpenIDE-Module-Localizing-Bundle: com/jme3/gde/blender/Bundle.properties | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| *** GENERATED FROM project.xml - DO NOT EDIT *** | ||
| *** EDIT ../build.xml INSTEAD *** | ||
| --> | ||
| <project name="com.jme3.gde.blender-impl" basedir=".."> | ||
| <fail message="Please build using Ant 1.7.1 or higher."> | ||
| <condition> | ||
| <not> | ||
| <antversion atleast="1.7.1"/> | ||
| </not> | ||
| </condition> | ||
| </fail> | ||
| <property file="nbproject/private/suite-private.properties"/> | ||
| <property file="nbproject/suite.properties"/> | ||
| <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail> | ||
| <property file="${suite.dir}/nbproject/private/platform-private.properties"/> | ||
| <property file="${suite.dir}/nbproject/platform.properties"/> | ||
| <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
| <attribute name="name"/> | ||
| <attribute name="value"/> | ||
| <sequential> | ||
| <property name="@{name}" value="${@{value}}"/> | ||
| </sequential> | ||
| </macrodef> | ||
| <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
| <attribute name="property"/> | ||
| <attribute name="value"/> | ||
| <sequential> | ||
| <property name="@{property}" value="@{value}"/> | ||
| </sequential> | ||
| </macrodef> | ||
| <property file="${user.properties.file}"/> | ||
| <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
| <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
| <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
| <fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness)."> | ||
| <condition> | ||
| <not> | ||
| <contains string="${cluster.path.evaluated}" substring="platform"/> | ||
| </not> | ||
| </condition> | ||
| </fail> | ||
| <import file="${harness.dir}/build.xml"/> | ||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| build.xml.data.CRC32=46157a9c | ||
| build.xml.script.CRC32=0f77a514 | ||
| build.xml.stylesheet.CRC32=15ca8a54@2.79 | ||
| # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
| # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
| nbproject/build-impl.xml.data.CRC32=46157a9c | ||
| nbproject/build-impl.xml.script.CRC32=5c5042d6 | ||
| nbproject/build-impl.xml.stylesheet.CRC32=49aa68b0@2.79 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #Thu, 25 Aug 2011 20:26:50 +0200 | ||
| javac.source=21 | ||
| javac.compilerargs=-Xlint -Xlint\:-serial | ||
| license.file=../license-jme.txt | ||
| nbm.homepage=https://www.jmonkeyengine.org | ||
| nbm.module.author=Kaelthas | ||
| nbm.needs.restart=true | ||
| spec.version.base=3.5.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://www.netbeans.org/ns/project/1"> | ||
| <type>org.netbeans.modules.apisupport.project</type> | ||
| <configuration> | ||
| <data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> | ||
| <code-name-base>com.jme3.gde.blender</code-name-base> | ||
| <suite-component/> | ||
| <module-dependencies> | ||
| <dependency> | ||
| <code-name-base>com.jme3.gde.core</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>3.6.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>com.jme3.gde.core.baselibs</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>3.6.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>com.jme3.gde.core.libraries</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>3.6.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.netbeans.api.progress</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>1.46.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.netbeans.api.progress.nb</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>1.46.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.netbeans.api.templates</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>1.6.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.netbeans.modules.projectapi</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>1.60.2</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.netbeans.modules.websvc.jaxws21api</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <release-version>1</release-version> | ||
| <specification-version>1.34.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.awt</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>7.62.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.dialogs</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>7.38.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.filesystems</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>9.7.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.filesystems.nb</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>9.7.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.loaders</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>7.57.2</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.modules</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>7.43.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.nodes</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>7.39.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.util</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>8.39.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.util.lookup</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>8.25.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.util.ui</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>9.4.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| <dependency> | ||
| <code-name-base>org.openide.windows</code-name-base> | ||
| <build-prerequisite/> | ||
| <compile-dependency/> | ||
| <run-dependency> | ||
| <specification-version>6.71.1</specification-version> | ||
| </run-dependency> | ||
| </dependency> | ||
| </module-dependencies> | ||
| <public-packages> | ||
| <package>com.jme3.gde.blender</package> | ||
| </public-packages> | ||
| </data> | ||
| </configuration> | ||
| </project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| suite.dir=${basedir}/.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| OpenIDE-Module-Display-Category=jMonkeyEngine | ||
| OpenIDE-Module-Long-Description=\ | ||
| This plugin adds support for GLTF's .gltf .glb and .bin files | ||
| OpenIDE-Module-Name=GLTF Support | ||
| OpenIDE-Module-Short-Description=Adds support for GLTF's .gltf .glb and .bin files |
105 changes: 105 additions & 0 deletions
105
jme3-blender/src/com/jme3/gde/blender/GLTFDataObject.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| /* | ||
| * Copyright (c) 2009-2020 jMonkeyEngine | ||
| * All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions are | ||
| * met: | ||
| * | ||
| * * Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * | ||
| * * Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in the | ||
| * documentation and/or other materials provided with the distribution. | ||
| * | ||
| * * Neither the name of 'jMonkeyEngine' nor the names of its contributors | ||
| * may be used to endorse or promote products derived from this software | ||
| * without specific prior written permission. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
| * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
| * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
| package com.jme3.gde.blender; | ||
|
|
||
| import com.jme3.asset.ModelKey; | ||
| import com.jme3.gde.core.assets.SpatialAssetDataObject; | ||
| import com.jme3.scene.plugins.gltf.GltfModelKey; | ||
| import java.io.IOException; | ||
| import org.openide.awt.ActionID; | ||
| import org.openide.awt.ActionReference; | ||
| import org.openide.awt.ActionReferences; | ||
| import org.openide.filesystems.FileObject; | ||
| import org.openide.filesystems.MIMEResolver; | ||
| import org.openide.loaders.DataObject; | ||
| import org.openide.loaders.DataObjectExistsException; | ||
| import org.openide.loaders.MultiFileLoader; | ||
| import org.openide.util.NbBundle.Messages; | ||
|
|
||
| @Messages({ | ||
| "LBL_GLTF_LOADER=GLTF Files" | ||
| }) | ||
| @MIMEResolver.ExtensionRegistration( | ||
| displayName="#LBL_GLTF_LOADER", | ||
| mimeType="model/gltf+json", | ||
| //mimeType="model/gltf-binary", | ||
| // glb has another mimeType but for us, this is irrelevant. The Actions are the same | ||
| extension={ "gltf", "glb" } | ||
| ) | ||
| @DataObject.Registration( | ||
| mimeType = "model/gltf+json", | ||
| iconBase = "com/jme3/gde/blender/glTF.svg", | ||
| displayName="#LBL_GLTF_LOADER", | ||
| position=300 | ||
| ) | ||
| @ActionReferences(value = { | ||
| @ActionReference(id = | ||
| @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.ConvertModel"), path = "Loaders/model/gltf+json/Actions", position = 10), | ||
| @ActionReference(id = | ||
| @ActionID(category = "jMonkeyPlatform", id = "com.jme3.gde.core.assets.actions.OpenModel"), path = "Loaders/model/gltf+json/Actions", position = 20), | ||
| @ActionReference(id = | ||
| @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), path = "Loaders/model/gltf+json/Actions", position = 200, separatorBefore = 100), | ||
| @ActionReference(id = | ||
| @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), path = "Loaders/model/gltf+json/Actions", position = 300, separatorAfter = 400), | ||
| @ActionReference(id = | ||
| @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), path = "Loaders/model/gltf+json/Actions", position = 500), | ||
| @ActionReference(id = | ||
| @ActionID(category = "System", id = "org.openide.actions.RenameAction"), path = "Loaders/model/gltf+json/Actions", position = 600, separatorAfter = 700), | ||
| @ActionReference(id = | ||
| @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), path = "Loaders/model/gltf+json/Actions", position = 800, separatorAfter = 900), | ||
| @ActionReference(id = | ||
| @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), path = "Loaders/model/gltf+json/Actions", position = 1000, separatorAfter = 1100), | ||
| @ActionReference(id = | ||
| @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), path = "Loaders/model/gltf+json/Actions", position = 1200), | ||
| @ActionReference(id = | ||
| @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/model/gltf+json/Actions", position = 1300) | ||
| }) | ||
|
|
||
| /** | ||
| * 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 { | ||
| super(pf, loader); | ||
| } | ||
|
|
||
| @Override | ||
| public synchronized ModelKey getAssetKey() { | ||
| GltfModelKey gltf = new GltfModelKey(super.getAssetKey().getName()); | ||
| gltf.setExtrasLoader(GltfExtrasLoader.INSTANCE); | ||
| return gltf; | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential
NullPointerExceptionifsuper.getAssetKey()returnsnull. It is safer to perform a null check before accessing its properties.