Implement node to get if controlled by FK or IK

This commit is contained in:
QuantumCoderQC 2021-05-20 18:07:46 +02:00
parent 43e145c3da
commit c53d04374d

View file

@ -0,0 +1,31 @@
package armory.logicnode;
import iron.object.Object;
import iron.object.BoneAnimation;
class GetBoneFkIkOnlyNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Bool {
#if arm_skin
var object: Object = inputs[0].get();
var boneName: String = inputs[1].get();
if (object == null) return null;
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
if (anim == null) anim = object.getParentArmature(object.name);
// Get bone in armature
var bone = anim.getBone(boneName);
//Get bone transform in world coordinates
return bone.is_IK_FK_only;
#end
}
}