Skip to content

Feature/jme 3.7 stable #618

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

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jmeVersion = 3.7.0
# Version used for application and settings folder, no spaces!
jmeMainVersion = 3.7
# Version addition pre-alpha-svn, Stable, Beta
jmeVersionTag = beta1.2.2
jmeVersionTag = stable
# Increment this each time jmeVersionTag changes but jmeVersion stays the same
#jmeVersionTagID = 0

Expand Down
34 changes: 25 additions & 9 deletions jme3-blender/src/com/jme3/gde/blender/GltfExtrasLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@

package com.jme3.gde.blender;

import com.jme3.plugins.json.JsonArray;
import com.jme3.plugins.json.JsonElement;
import com.jme3.plugins.json.JsonObject;
import com.jme3.plugins.json.JsonPrimitive;
import java.lang.reflect.Array;
import java.util.*;

import org.slf4j.*;

import com.google.gson.*;

import com.jme3.scene.Spatial;
import com.jme3.scene.plugins.gltf.*;

Expand Down Expand Up @@ -77,11 +79,19 @@ public Object handleExtras( GltfLoader loader, String parentName,
log.debug("handleExtras(" + loader + ", " + parentName + ", " + parent + ", " + extras + ", " + input + ")");

// Only interested in composite objects
if( !extras.isJsonObject() ) {
JsonObject jo = null;
try {
jo = extras.getAsJsonObject();
}
catch(Exception e) {
log.warn("Skipping extras:" + extras, e);
}

if(jo == null) {
log.warn("Skipping extras:" + extras);
return input;
}
JsonObject jo = extras.getAsJsonObject();

apply(input, jo);
return input;
}
Expand Down Expand Up @@ -120,15 +130,21 @@ protected void applyToSpatial( Spatial spatial, JsonObject extras ) {
}

protected Object toAttribute( JsonElement el, boolean nested ) {
if( el.isJsonObject() ) {
try {
return toAttribute(el.getAsJsonObject(), nested);
} else if( el.isJsonArray() ) {
} catch (Exception e) {
}

try {
return toAttribute(el.getAsJsonArray(), nested);
} else if( el.isJsonPrimitive() ) {
} catch (Exception e) {
}

try {
return toAttribute(el.getAsJsonPrimitive(), nested);
} else if( el.isJsonNull() ) {
return null;
} catch (Exception e) {
}

log.warn("Unhandled extras element:" + el);
return null;
}
Expand Down
Loading