K.Wagrez Posted February 17 Posted February 17 (edited) Hello everyone, Unigine 2.19.1 here. I've read the documentation but from what I can gather, we need to make some specific code in order to use IK for our characters ? I have this pretty usual configuration: My character has an idle and a walk animation (it's skinned mesh). How could I attach the luggage to him so as to have his hand on the luggage while the rest of his body (apart from the elbow) is animated ? In the editor. Or do I have to code something ? A world expression could work ? Thanks in advance Edited February 17 by K.Wagrez
silent Posted February 18 Posted February 18 Hi Kevin, I don't think that WorldExpression would be enough, though. There is currently no UI for the animations and IK. You can check C++ samples with animations (https://github.com/unigine-engine/cpp-api-samples/tree/main/source/animation) and develop your own solution and UI (maybe even Editor Plugin) for that. Luggage object itself should follow the character in some way. When the character is standing still, the bag should remain close by. When the character starts moving, the bag should tilt and move along the ground plane behind them. This behavior is handled by a separate logic system. After that, we want to create the impression that the character is pulling the bag with their hand. For this, we simply use IK to attach the character’s palm to a specified target point on the bag’s handle. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
K.Wagrez Posted February 23 Author Posted February 23 Okay well, I went with some C++ components included in my plugin. My IK is working fine, however I'm trying to find the methods that would allow me to manually control bone rotations for the fingers: I've tried using setLayerBoneRotation on every finger bone, this way: // fingers skinned->setLayer(0, true, 1.0f); for (int i=0; i<fingers.size(); i++) { int bone_id = skinned->findBone(fingers[i]); if (bone_id != -1) { skinned->setLayerBoneFrameUses(0, bone_id, ObjectMeshSkinned::ANIM_FRAME_USES_NONE); skinned->setLayerBoneRotation(0, bone_id, Unigine::Math::quat(0.5,0.0,0.0,0.5)); m_finger_bone_ids.push_back(bone_id); } else Unigine::Log::warning("Could not find bone"); } But the fingers keep on using the animation data to move and no offset is visible. I see no other methods that seem to do what I'm looking to do. I just want to block the animation from affecting the fingers, and control their rotation myself. By the way I checked, those are the correct bones.
silent Posted February 24 Posted February 24 Hi Kevin, Could you please check if you have enabled layer masks on this animation layer via setLayerFrameUsesEnabled? If enabling masks does not change the behavior, we would need to review a small test sample using your content, as the issue may be related either to the content itself or to the code. Thank you! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts