Merge pull request #20 from Dutch77/feature/has-all-connected-inputs-value
has all connected inputs value
This commit is contained in:
@@ -43,6 +43,9 @@ export default class Node<I extends Variables, O extends Variables> {
|
|||||||
const startTag =`graphfx-update-start:${this.uid}`;
|
const startTag =`graphfx-update-start:${this.uid}`;
|
||||||
const endTag = `graphfx-update-end:${this.uid}`
|
const endTag = `graphfx-update-end:${this.uid}`
|
||||||
this.__scheduledUpdate = false;
|
this.__scheduledUpdate = false;
|
||||||
|
if (!this.hasAllConnectedInputsValue()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
performance.mark(startTag)
|
performance.mark(startTag)
|
||||||
await this._update();
|
await this._update();
|
||||||
performance.mark(endTag)
|
performance.mark(endTag)
|
||||||
@@ -89,6 +92,15 @@ export default class Node<I extends Variables, O extends Variables> {
|
|||||||
return this.__out;
|
return this.__out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasAllConnectedInputsValue() {
|
||||||
|
for(const inputName of Object.keys(this.in.variables)) {
|
||||||
|
if (this.in[inputName].output && !this.in[inputName].value) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create json serializable object
|
* Create json serializable object
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user