Conditional compilation for shape key node

This commit is contained in:
QuantumCoderQC 2021-11-02 15:59:40 +01:00
parent 83a60e7462
commit 1cec287891

View file

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