Skip to content

Commit cbc70b4

Browse files
deltakoshDavid Catuhe
andauthored
Fix shader emission for NME (#17010)
Co-authored-by: David Catuhe <[email protected]>
1 parent d8b651b commit cbc70b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/dev/core/src/Materials/Node/nodeMaterial.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,8 @@ export class NodeMaterial extends PushMaterial {
10381038

10391039
this._buildIsInProgress = false;
10401040
if (noError) {
1041-
this.onBuildObservable.notifyObservers(this);
10421041
this._buildWasSuccessful = true;
1042+
this.onBuildObservable.notifyObservers(this);
10431043
}
10441044

10451045
// Wipe defines

packages/tools/nodeEditor/src/components/propertyTab/propertyTabComponent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ export class PropertyTabComponent extends React.Component<IPropertyTabComponentP
586586
label="Export shaders"
587587
onClick={() => {
588588
this.props.globalState.nodeMaterial.build();
589-
StringTools.DownloadAsFile(this.props.globalState.hostDocument, this.props.globalState.nodeMaterial.compiledShaders, "shaders.txt");
589+
this.props.globalState.nodeMaterial.onBuildObservable.addOnce(() => {
590+
StringTools.DownloadAsFile(this.props.globalState.hostDocument, this.props.globalState.nodeMaterial.compiledShaders, "shaders.txt");
591+
});
590592
}}
591593
/>
592594
{this.props.globalState.customSave && (

0 commit comments

Comments
 (0)