Browse Source

Fix mode not set correctly in some circumstances

Popov72 5 năm trước cách đây
mục cha
commit
74bca18885

+ 1 - 0
dist/preview release/what's new.md

@@ -5,6 +5,7 @@
 - Added particle editor to the Inspector ([Deltakosh](https://github.com/deltakosh))
 - Added the `ShadowDepthWrapper` class to support accurate shadow generation for custom as well as node material shaders. [Doc](https://doc.babylonjs.com/babylon101/shadows#custom-shadow-map-shaders) ([Popov72](https://github.com/Popov72))
 - Added Babylon.js Texture [tools](https://www.babylonjs.com/tools/ibl) to prefilter HDR files ([Sebavan](https://github.com/sebavan/))
+- Added editing of PBR materials and Post processes in the node material editor ([Popov72](https://github.com/Popov72))
 
 ## Updates
 

+ 1 - 0
nodeEditor/src/components/propertyTab/propertyTabComponent.tsx

@@ -242,6 +242,7 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
 
         NodeMaterial.ParseFromSnippetAsync(snippedID, scene, "", material).then(() => {
             material.build();
+            this.changeMode(this.props.globalState.nodeMaterial!.mode, true, false);
             this.props.globalState.onResetRequiredObservable.notifyObservers();
         }).catch((err) => {
             alert("Unable to load your node material: " + err);

+ 1 - 0
nodeEditor/src/nodeEditor.ts

@@ -44,6 +44,7 @@ export class NodeEditor {
         
         let globalState = new GlobalState();
         globalState.nodeMaterial = options.nodeMaterial;
+        globalState.mode = options.nodeMaterial.mode;
         globalState.hostElement = hostElement;
         globalState.hostDocument = hostElement.ownerDocument!;
         globalState.customSave = options.customSave;