Character and weapon joints

Since i'm using physics instead of node handeling do i still have to animate weapons to the character. i'm leaning towards performance however it is kind of tasking to hand animate the weapon with the character is thier a way in which i can bind nodes together temporarily. Such as apply it to the character node or give each weapon bones and apply it to the hand bone would such work??

can anyone assist? Is their a way were i can use the joints to bond the gun to one of the hands and then use an IK to guide the second hand underneath it to make it seem as though he's holding it with both hands

It's possible!

Look at TestMaxJmeWrite.java

The Character.3ds has childs (head, body, lefthand, righthand…).

Wouldn't be a problem to add a child, which you can call weaponslot.

Afterwards you can search for this child and add the weapon to it.

if u are using md5 both loaders have utility methods for attaching two  or more skeletal objects,  look at the marine example the head is a separate model, the one problem …if u consider it a problem is that your weapon and other attachments must be md5 as well

That's a solution, but I wouldn't recommend that the attachment is md5 and CONNECTED, because the skeleton will influence  your weapon. For bodyparts, md5 is a good solution, at the moment the only solution for jME.

Yeah, md5 worked for me with Blender, use neakor's MD5Importer and after modeling both the character and the weapon on the same skeleton, separate the two meshes into two different blend files, but keep the skeleton intact.  Export to MD5 and then to attach the two back together use attachDependent().  This way you can switch between weapons during gameplay.  If you want me to elaborate more, ask.

If you want me to elaborate more, ask.


Could you please elaborate more  :D?

So I have two blend files: one contains the body (including hands) and the other contains the weapon (sword in this case).

I'm creating a separate animation (md5anim) file for the upper body for right now just holding the sword.  The model is the marine model that comes with MD5Importer.  Notice that there are HANDCONNECTION points defined.

So how do attach the weapon to the body model ... especially if the weapon model needs to be rotated and positioned correctly?  Is there a way to define a connection point on the model?  If so, where is the rotation of the model defined?

Thanks for your help!

I think you have it correct


SomethingNew said:

After modeling both the character and the weapon on the same skeleton, separate the two meshes into two different blend files, but keep the skeleton intact. 

This means that there are different meshes in each blend file, but the same skeleton.  So in one blend you would have a body mesh attached to the body skeleton with a weapon bone included.  The other blend would have the weapon mesh attached to that one weapon bone along with the body skeleton.
SomethingNew said:

Export to MD5 and then to attach the two back together use attachDependent().  This way you can switch between weapons during gameplay.

This is pretty straightforward, as long as you haven't changed the node names in code.

I was a blender noob, but if you need to copy from one .blend to another use File->Append or Link and pick the .blend file you need to copy the data from.

This may be rather confusing, but once you get it, it's rather easy.  Ask more questions if you have some.

Some questions about blender:

I created a sword but nothing exports in the MD5 exporter … do you know why?



Also, does it make sense to use a bone instead of using a vertex group to attach the sword to the model?



Here is what the md5mesh file looks like after the export.


MD5Version 10
commandline ""

numJoints 0
numMeshes 1

joints {
}

mesh {
        shader "sword.png"

        numverts 0

        numtris 0

        numweights 0
}

Conzar said:

Some questions about blender:
I created a sword but nothing exports in the MD5 exporter ... do you know why?

One guess, did you add the armature modifier to the mesh.  Basically http://wiki.blender.org/index.php/Doc:Tutorials/Animation/BSoD/Character_Animation/Upper_body_armature#Add_an_Armature_modifier_to_the_Mesh

Conzar said:

Also, does it make sense to use a bone instead of using a vertex group to attach the sword to the model?

When you create a bone in blender a vertex group is created automatically with the same same.  And I would say yeah this makes sense.

Is there a specific format for the Bones?  I tried with just an origin bone but that didn't work.



I imported the shotgun from Doom3 and here is there armature



Origin -> sgbody -> barrel
                           -> eject
                           -> flash
                           -> sgtcob