|
@@ -541,22 +541,24 @@ export class InputBlock extends NodeMaterialBlock {
|
|
}
|
|
}
|
|
|
|
|
|
protected _dumpPropertiesCode() {
|
|
protected _dumpPropertiesCode() {
|
|
|
|
+ let variableName = this._codeVariableName;
|
|
|
|
+
|
|
if (this.isAttribute) {
|
|
if (this.isAttribute) {
|
|
- return `${this._codeVariableName}.setAsAttribute("${this.name}");\r\n`;
|
|
|
|
|
|
+ return `${variableName}.setAsAttribute("${this.name}");\r\n`;
|
|
}
|
|
}
|
|
if (this.isSystemValue) {
|
|
if (this.isSystemValue) {
|
|
- return `${this._codeVariableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue!]});\r\n`;
|
|
|
|
|
|
+ return `${variableName}.setAsSystemValue(BABYLON.NodeMaterialSystemValues.${NodeMaterialSystemValues[this._systemValue!]});\r\n`;
|
|
}
|
|
}
|
|
if (this.isUniform) {
|
|
if (this.isUniform) {
|
|
let valueString = "";
|
|
let valueString = "";
|
|
switch (this.type) {
|
|
switch (this.type) {
|
|
case NodeMaterialBlockConnectionPointTypes.Float:
|
|
case NodeMaterialBlockConnectionPointTypes.Float:
|
|
- let returnValue = `${this._codeVariableName}.value = ${this.value};\r\n`;
|
|
|
|
|
|
+ let returnValue = `${variableName}.value = ${this.value};\r\n`;
|
|
|
|
|
|
- returnValue += `${this._codeVariableName}.min = ${this.min};\r\n`;
|
|
|
|
- returnValue += `${this._codeVariableName}.max = ${this.max};\r\n`;
|
|
|
|
- returnValue += `${this._codeVariableName}.matrixMode = ${this.matrixMode};\r\n`;
|
|
|
|
- returnValue += `${this._codeVariableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]};\r\n`;
|
|
|
|
|
|
+ returnValue += `${variableName}.min = ${this.min};\r\n`;
|
|
|
|
+ returnValue += `${variableName}.max = ${this.max};\r\n`;
|
|
|
|
+ returnValue += `${variableName}.matrixMode = ${this.matrixMode};\r\n`;
|
|
|
|
+ returnValue += `${variableName}.animationType = BABYLON.AnimatedInputBlockTypes.${AnimatedInputBlockTypes[this.animationType]};\r\n`;
|
|
|
|
|
|
return returnValue;
|
|
return returnValue;
|
|
case NodeMaterialBlockConnectionPointTypes.Vector2:
|
|
case NodeMaterialBlockConnectionPointTypes.Vector2:
|
|
@@ -575,9 +577,9 @@ export class InputBlock extends NodeMaterialBlock {
|
|
valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;
|
|
valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- let finalOutput = `${this._codeVariableName}.value = ${valueString};\r\n`;
|
|
|
|
- finalOutput += `${this._codeVariableName}.isConstant = ${this.isConstant ? "true" : "false"};\r\n`;
|
|
|
|
- finalOutput += `${this._codeVariableName}.visibleInInspector = ${this.visibleInInspector ? "true" : "false"};\r\n`;
|
|
|
|
|
|
+ let finalOutput = `${variableName}.value = ${valueString};\r\n`;
|
|
|
|
+ finalOutput += `${variableName}.isConstant = ${this.isConstant ? "true" : "false"};\r\n`;
|
|
|
|
+ finalOutput += `${variableName}.visibleInInspector = ${this.visibleInInspector ? "true" : "false"};\r\n`;
|
|
|
|
|
|
return finalOutput;
|
|
return finalOutput;
|
|
}
|
|
}
|