I have a rigged character. I can retreive the bones nodes, and if I manually apply a rotation to those bones, I see the character switching to its new pose.
Now, if I try to set a constraint to this same bone, it just doesn't move at all. I have tried inverse kinematic constraints, and the simple billboard constraint, but no way.
Here is the code to get the bone :
SCNNode *man = [scene.rootNode childNodeWithName:@"Man" recursively:YES] ;
SCNNode *bodyOfMan = [man childNodeWithName:@"Body" recursively:YES] ;
SCNNode *bodyRealSkeleton = bodyOfMan.skinner.skeleton ;
SCNNode *headBone = [bodyRealSkeleton childNodeWithName:@"mixamorig_Head" recursively:YES] ;
If I do this :
headBone.rotation = SCNVector4Make(0,1,0,45) ;
I get this result, showing that the head rotates properly
If I do this instead :
SCNBillboardConstraint *constraint3 = [SCNBillboardConstraint billboardConstraint] ;
headBone.constraints = @[constraint3] ;
The head remains straight forward, when it should be following the camera.
The billboard constraints works very well if I just add it to a "Box" node, but I couldn't find any way to make it work to my rigged mesh bones... And I couldn't find any way to make the SCNIKConstraint work, at all.