use of com.jme3.scene.plugins.fbx.file.FbxElement in project jmonkeyengine by jMonkeyEngine.
the class FbxAnimCurveNode method fromElement.
@Override
public void fromElement(FbxElement element) {
super.fromElement(element);
for (FbxElement prop : element.getFbxProperties()) {
String propName = (String) prop.properties.get(0);
String propType = (String) prop.properties.get(1);
if (propType.equals("Number")) {
float propValue = ((Double) prop.properties.get(4)).floatValue();
propertyToDefaultMap.put(propName, propValue);
}
}
}
use of com.jme3.scene.plugins.fbx.file.FbxElement in project jmonkeyengine by jMonkeyEngine.
the class FbxMaterialProperties method setPropertyFromElement.
public void setPropertyFromElement(FbxElement propertyElement) {
String name = (String) propertyElement.properties.get(0);
FBXMaterialProperty prop = propertyMetaMap.get(name);
if (prop == null) {
logger.log(Level.WARNING, "Unknown FBX material property ''{0}''", name);
return;
}
// It is either a color, alpha, or factor.
// Textures can only be set via setPropertyTexture.
// If it is an alias, get the real name of the property.
String realName = prop.name;
switch(prop.type) {
case Alpha:
case Factor:
case Texture2DOrFactor:
case Texture2DOrAlpha:
double value = (Double) propertyElement.properties.get(4);
propertyValueMap.put(realName, (float) value);
break;
case Color:
case Texture2DOrColor:
double x = (Double) propertyElement.properties.get(4);
double y = (Double) propertyElement.properties.get(5);
double z = (Double) propertyElement.properties.get(6);
ColorRGBA color = new ColorRGBA((float) x, (float) y, (float) z, 1f);
propertyValueMap.put(realName, color);
break;
default:
logger.log(Level.WARNING, "FBX material property ''{0}'' requires a texture.", name);
break;
}
}
Aggregations