Hi there, having a issue with attaching my weapon to the hand. I am getting a "No mesh, or mesh not of skinned mesh type" error in log, kind of stumped on it, any help will be appreciated. This is my code and I have narrowed it down to the offender ( I will comment), I have also tried 3 different models to see if it was a problem there and google searches.
You need to make sure your hand model has bones in it and has a bone named "Left_Hand"; being of type .obj (which doesn't support animations) I don't think it contains any bones, it's just a simple model.
irr::scene::IBoneSceneNode* handZ = boneS->getJointNode("Left_Hand"); //this line here seems to be the problem
if (handZ)
{
handZ->addChild(weP);
handZ->setPosition(core::vector3df(-12.f,2.f,42.f));
}
else
{
printf("ERROR! bones->getJointNode("LeftHand") failed to find node \n");
}
in addition, you can set a breakpoint at this line and then follow the program through the code to see what bones actually exist.
Notice though that OBJ models don't have bones, so you can't use them as skinned meshes, BUT as any other node, you can attach children nodes to them, so you can attach the weapon model to the hand model, i.e. you can attach weP to boneS directly (boneS->addChildNode(weP); or the like)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Thanks guys, sorted now. The models I think I was using didn't have bones. My reference was with a blender file that did have bones but the .obj file I was using in game didn't.