Material name added.

Reading material's name from blender added.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8945 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 13 years ago
parent 5ed66f47e7
commit f232b11318
  1. 1
      engine/src/blender/com/jme3/scene/plugins/blender/materials/MaterialHelper.java
  2. 18
      engine/src/core/com/jme3/material/Material.java

@ -276,6 +276,7 @@ public class MaterialHelper extends AbstractBlenderHelper {
result.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
}
result.setName(materialContext.getName());
blenderContext.setMaterialContext(result, materialContext);
blenderContext.addLoadedFeatures(structure.getOldMemoryAddress(), structure.getName(), structure, result);
return result;

@ -85,6 +85,7 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
additiveLight.setDepthWrite(false);
}
private AssetKey key;
private String name;
private MaterialDef def;
private ListMap<String, MatParam> paramValues = new ListMap<String, MatParam>();
private Technique technique;
@ -132,6 +133,23 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
public String getAssetName() {
return key != null ? key.getName() : null;
}
/**
* @return the name of the material (not the same as the asset name), the returned value can be null
*/
public String getName() {
return name;
}
/**
* This method sets the name of the material.
* The name is not the same as the asset name.
* It can be null and there is no guarantee of its uniqness.
* @param name the name of the material
*/
public void setName(String name) {
this.name = name;
}
public void setKey(AssetKey key) {
this.key = key;

Loading…
Cancel
Save