Conditional compilation for shape key node

This commit is contained in:
QuantumCoderQC 2021-11-02 15:59:40 +01:00
parent 83a60e7462
commit 1cec287891
1 changed files with 6 additions and 4 deletions

View File

@ -9,15 +9,17 @@ class SetObjectShapeKeyNode extends LogicNode {
}
override function run(from: Int) {
#if arm_morph_target
var object: Dynamic = inputs[1].get();
var shapeKey: String = inputs[2].get();
var value: Dynamic = inputs[3].get();
if (object == null) return;
var sk = cast(object, MeshObject).morphTarget;
if(sk == null) return;
assert(Error, object != null, "Object should not be null");
var morph = cast(object, MeshObject).morphTarget;
sk.setMorphValue(shapeKey, value);
assert(Error, morph != null, "Object does not have shape keys");
morph.setMorphValue(shapeKey, value);
#end
runOutput(0);
}
}