More drastic approach to clear the cache when updating the material definition in the shaderNode editor so that changes in shader files are properly taken into account
This commit is contained in:
parent
5917d699d6
commit
1cb9edd07a
@ -434,15 +434,13 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme
|
||||
}
|
||||
|
||||
public void notifyAddMapParam(String type, String name) {
|
||||
MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class);
|
||||
//FIXME add a way to set fixed pipeline function and default value
|
||||
MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class);
|
||||
MatParamBlock param = new MatParamBlock(type, name, null, null);
|
||||
matDef.addMatParam(param);
|
||||
}
|
||||
|
||||
public void notifyAddWorldParam(String name) {
|
||||
MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class);
|
||||
//FIXME add a way to set fixed pipeline function and default value
|
||||
MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class);
|
||||
WorldParamBlock param = new WorldParamBlock(name);
|
||||
getTechnique(matDef).addWorldParam(param);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class MaterialPreviewRenderer implements SceneListener {
|
||||
SceneApplication.getApplication().createPreview(request);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(MaterialPreviewRenderer.class.getName()).log(Level.SEVERE, "Error rendering material" + e.getMessage());
|
||||
Logger.getLogger(MaterialPreviewRenderer.class.getName()).log(Level.SEVERE, "Error rendering material{0}", e.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -126,8 +126,9 @@ public class MaterialPreviewRenderer implements SceneListener {
|
||||
|
||||
public Material reloadMaterial(Material mat, DesktopAssetManager assetManager) {
|
||||
|
||||
MaterialKey key = new MaterialKey(mat.getMaterialDef().getAssetName());
|
||||
assetManager.deleteFromCache(key);
|
||||
//MaterialKey key = new MaterialKey(mat.getMaterialDef().getAssetName());
|
||||
((ProjectAssetManager)mat.getMaterialDef().getAssetManager()).clearCache();
|
||||
//assetManager.clearCache();
|
||||
|
||||
//creating a dummy mat with the mat def of the mat to reload
|
||||
Material dummy = new Material(mat.getMaterialDef());
|
||||
|
Loading…
x
Reference in New Issue
Block a user