Topic: need help with skinnedmesh

Ok so basically in my game i have a skeleton i exported via b3d, now i need to swap out clothing and or body parts from this mesh. Simply attaching a scenenode to a bone node won't suffice as i need all the weights from the mesh to be applied to the base skeleton.

I have been struggling with this for a few days, but something i am having trouble figuring out is why i cannot append any vertices to a SSkinnedMeshBuffer, seems to work fine with a an SMeshBuffer.

e.g.

Global bodyp:IAnimatedMesh = device.getSceneManager().getMesh("media\avatars\male_torso.b3d")


Global meshy2:ISkinnedMesh = smgr.creatSkinnedMesh()
Global meshy:SSkinMeshBuffer = meshy2.addMeshBuffer()

'just gonna try with the first meshbuffer.. since this mesh only has one
Global bodymeshbuff:IMeshBuffer = bodyp.getMeshBuffer(0)


Global bodyverts:S3DVertex[] = bodymeshbuff.getVertices()
Global bodyindices:Short[] = bodymeshbuff.getIndices()

DebugLog "Vertices to add: "+bodyverts.length+" Indices to add: "+bodyindices.length

meshy.append(bodyverts,bodyindices)
DebugLog "Meshy has: "+meshy.getVertexCount()
'meshy.appendFromOther(bodymeshbuff) <---- didnt work either

I have tried a bunch of other ways to get around this.. like trying to break attach the mesh's bones to the base skeleton's bones, but that causes irrlicht to crash. Anyone have any idea how to do this or what i am doing wrong?

Re: need help with skinnedmesh

the goal was to copy the bodypart i load in to a new SkinnedMesh, then i copy all the joints from a different mesh, then copy my bodyparts weights to this new skinnedmesh. more or less.

Re: need help with skinnedmesh

or better yet simply attach bone from meshA to bone from meshB

Re: need help with skinnedmesh

greetings smile  can you pack up a quick example (with mesh files) i can play with?

Re: need help with skinnedmesh

Re: need help with skinnedmesh

Re: need help with skinnedmesh

woohoo!

after reading some techniques done in C++ i saw that you could essentially build an entire mesh and apply bones as well as set the weights within code, which was what i was after. In blitz3d i got around this whole bit simply by passing entityparent from a bone of one mesh tot he bone of another, this way when i animated the skeleton the child meshes would animate with it. In irrlicht trying to attach a bonenode of one mesh to the bonenode of another mesh crashes the system. So instead of that i decided perhaps i could just build a new Skinned mesh made up of meshbuffers from different bodyparts and then use the skeleton of the base skeleton.b3d file i loaded. This way i can swap out parts for changing costume or features.

Re: need help with skinnedmesh

as far as appendfromother that's no big deal as long as i can get the data in there i'm happy. from what i saw apparently in you had to insert the vertices by using SSkinMeshBuffer.Vertices_Standard.pushback( vertice array blah blah in order to get the data into the buffer, so yea i am guessing the append function was not implemented yet.

9 (edited by leondrake 2010-06-26 10:25:20)

Re: need help with skinnedmesh

Re: need help with skinnedmesh

Just an Update, it doesnt seem to crash at all on my work PC, but it is still doing the same thing. I'm not sure what's going on, after looking at some code people used to push verts into SSkinmeshBuffer it should retain its shape regardless if the bones are there or not.