Material function color and name

This commit is contained in:
barsdeveloper
2023-05-22 22:49:59 +02:00
parent 5dfa8aff1b
commit 4b7bce2211
4 changed files with 31 additions and 3 deletions

View File

@@ -149,6 +149,7 @@ export default class Configuration {
materialExpressionLogarithm: "/Script/InterchangeImport.MaterialExpressionLogarithm",
materialExpressionLogarithm10: "/Script/Engine.MaterialExpressionLogarithm10",
materialExpressionLogarithm2: "/Script/Engine.MaterialExpressionLogarithm2",
materialExpressionMaterialFunctionCall: "/Script/Engine.MaterialExpressionMaterialFunctionCall",
materialExpressionSquareRoot: "/Script/Engine.MaterialExpressionSquareRoot",
materialExpressionTextureCoordinate: "/Script/Engine.MaterialExpressionTextureCoordinate",
materialExpressionTextureSample: "/Script/Engine.MaterialExpressionTextureSample",

View File

@@ -97,6 +97,9 @@ export default class ObjectEntity extends IEntity {
InputKey: {
type: SymbolEntity,
},
MaterialFunction: {
type: ObjectReferenceEntity,
},
bOverrideFunction: {
type: Boolean,
},
@@ -319,6 +322,7 @@ export default class ObjectEntity extends IEntity {
/** @type {ObjectReferenceEntity?} */ this.Enum
/** @type {String[]?} */ this.EnumEntries
/** @type {SymbolEntity?} */ this.InputKey
/** @type {ObjectReferenceEntity?} */ this.MaterialFunction
/** @type {Boolean?} */ this.bOverrideFunction
/** @type {Boolean?} */ this.bInternalEvent
/** @type {Boolean?} */ this.bConsumeInput
@@ -618,12 +622,19 @@ export default class ObjectEntity extends IEntity {
if (input.length > 0) {
return input.map(v => Utility.printExponential(v)).reduce((acc, cur) => acc + "," + cur)
}
break
case Configuration.paths.materialExpressionLogarithm:
return "Ln"
case Configuration.paths.materialExpressionLogarithm10:
return "Log10"
case Configuration.paths.materialExpressionLogarithm2:
return "Log2"
case Configuration.paths.materialExpressionMaterialFunctionCall:
const materialFunction = this.getMaterialSubobject()?.MaterialFunction
if (materialFunction) {
return materialFunction.getName()
}
break
case Configuration.paths.materialExpressionSquareRoot:
return "Sqrt"
case Configuration.paths.spawnActorFromClass:
@@ -805,6 +816,8 @@ export default class ObjectEntity extends IEntity {
case Configuration.paths.materialExpressionConstant3Vector:
case Configuration.paths.materialExpressionConstant4Vector:
return Configuration.nodeColors.yellow
case Configuration.paths.materialExpressionMaterialFunctionCall:
return Configuration.nodeColors.blue
case Configuration.paths.materialExpressionTextureSample:
return Configuration.nodeColors.darkBlue
case Configuration.paths.materialExpressionTextureCoordinate: