Hello all,
I’ve a question regarding Blender, animations via keyframes and rigged meshes:
In Gmax, I’m using the keyframed parts of a default NWN1-character (eg. a_ba.mdl or a_fa.mdl) as bones to which I rig a mesh (skinmesh). The advantage of this approach is, that if I move the animation bar / press “play” (in Gmax), it’ll show the animation by moving the rigged skinmesh, thus showing nicely, where certain weighted verts don’t behave so well.
Well, since things are moving towards NWN1 EE and Gmax/NW(g)max does not import/export the new models and (A)symmetric already updated the NWN1-importer/exporter for Blender (THANKS Symmetric!), I thought to check this out in Blender.
Using Blender 2.79b and the latest Neverblender 2.10, I imported a rigged character, which has keyframed bones. It imported nicely. The keyframes show up, when selecting the rootdummy and the “bones” play the animation, BUT the rigged skinmesh does NOT (in Blender).
I checked the weighting on the skinmesh and it looks like, that the weighting has been imported correctly. It just seems, that the skinmesh is not “connected” to the moving “bones” ( = the non rendering NWN1 keyframed model).
Question:
Is there a way to make Blender show the keyframed animations on a rigged (skin-) mesh (without baking it - so one could do a quick check on certain poses)? That would be great and another argument for CCers to switch from (G)Max to Blender for the EE-models.
Blender does not support using meshes as (pseudo)bones. If you want a skin(mesh) to deform with the animations you’ll need to use actual bones/ armatures
Creating an armature by hand to match the meshes is basically impossible (let alone re-creating the animations), so Neverblender offers a tool to create an armature from mdl pseudobones. It’s available in the object properties, where the minimap tool is located too.
It’s a bit complicated to use: You’ll need to select the Aurora Rootdummy and select “Selection” in the tool options, so the whole mdl is used. All animations will be copied onto the armature too.
Once you have an armature you’ll need to add an Armature Modifier to the skinmesh. Select the new armature as object in the modifier’s properties and you should be good to go. By default the modifier is set up to use vertex weights for deformation, which is what we want.
This tool is what I’m currently working on. It’s basically the last step to finally have complete support for mdls (apart from emitters). I’m planning to:
Automate the whole process further (auto apply modifiers, better default settings, etc)
Implement the way back: Armature => Meshes/Pseudo Bones (needed to create stuff from scratch)
All right! This is heading into my wanted direction! Thanks alot, Symmetric!
Looking forward to your new implementations, too! It’ll be a good reason to completely switch over to Blender, which is an awesome program (once you find your way around and you’re able to copy over your workflow from [G]max to Blender)!
OK, I’ll gave this a quick try but I messed up. I think, it’s too late here… Will give it another try tomorrow or so and report back.
OK, got that bone-converting done! Yesterday I made the mistake to actually select the object “rootdummy” and not the Aurora base… I’m very impressed with that piece of code! It worked like a charm! The animations were nicely copied onto the bones and the movement of the armature and the NWN model match 100%. Good job!!!
Remark: My test model is the Alvin model of the Witcher 1 and the NWN1 model ist that of the boy kid (c_ykid_m). The rigging has already been done within Gmax. For this, I adjusted - on keyframe 0 - the positions of the bodyparts of the NWN1 model, so they fit the mesh, which is to be rigged. This works very nicely in Gmax and I don’t have to ‘bend’ the ‘skin mesh’.
It imported into Blender just fine (with the altered position of the NWN model parts).
As you can see in the screen, the skin mesh is already weighted and the weights have been properly imported into Blender.
Now I added the Armature Modifier to the skinmesh and asigned the armature and… The armes move up (in a bit strange way) and the legs move appart (a bit).
Remark: When now ‘playing’ the animation, the ‘skinmesh’ is moved according to the bone movement, but with those raised arms.
I also tested this with the Gerald model, where I used a slightly different approach (in Gmax): I bend the future skinmesh to fit the keyframe position 0 of the NWN1 model, which holds the animations (a_ba).
When going through that proccess, the deforming of the rigged mesh is not as heavy - the legs move a bit appart, but because of this, the animation looks not good anymore.
Hmm, hard to say without looking at it directly. If you send it to me I’ll take a look.
It might be one of the following things:
I think the skinmesh must be a child of the armature. I forgot about that part, sorry. It has been a while since I tested that. The default parent to object is enough (there are some automatic weighting options when parenting to armatures, don’t use those, it’ll overwrite your own weights)
I see that there is an animation for the skinmesh itself. That might interfere with the animation from the armature.
Another issue might be the names of the vertex groups. Everything is case sensitive in blender while mdl is not. Maybe they have the wrong case.
Thanks. I thought so, that it’s difficult to judge things from a screenshot. I’ll check out your thoughts and if I am stuck, I’ll PM you, so I can get the model to you.
OK, I did a few more tests (but in the end, I still have the same issue…):
You’re right. It has to be parented. Question for the future: Does the armature has to be parented to the Aurora base for the animations to work? I mean, the’re still part of the original NWN1 model and a skinmesh might draw on them. In this case, your created amrmature would only be used during the rigging.
Yes. I missed that one. I removed it, but that didn’t help it.
Unless I’m too blind, the names of the vertex groups are OK.
So now regarding my further tests:
I testwise imported a different OBJ-model, removed all NWN1-stuff from the scene, so that there is only the armature, which was created of the NWN1 Aurora base and the new mesh to be rigged. I parented the mesh and choose, that it creates empty vertex groups, so I have all the bones to be weighed ready. I then rigged the left arm and leg. This is the result:
The same thing!
The Armature Modifier is set to “Vertex Groups”. (“Bone Envelopes” looks even worse!)
It almost seems, that, when painting weights, the weight-position of the armature bones is in a different position (in 3D space), than the visualized bones… I have no idea, if this could be, because this is “new Blender country” for me.
I’ll get a PM to you Symmetric.
BTW: Does anybody know the maximum number of bones per vert for the original NWN1?
I only found this regarding NWN1-EE:
Quote: At least foe EE: “Hmmm. In talking with Jason, the limit is 128 bones / skinmesh. I think you might be running into the 4 bones / vertex limit instead.”
So, for EE it seems to be 4. Does this also count for the original NWN1?
For NWN2 the maximum is 3 bones per vert, if my info is correct. So NWN1 EE can handle more bones per vert than NWN2?
this info ain’t entirely correct. only cinematic head skins are limited that way. every vertex of the default skin mesh can be influenced by up to 4 bones too, with a maximum of 54 bones per body part.
ps: congrats for successfully making the switch from gmax to blender. it’s really for the best
@ Semper: Always glad to hear from you! The one, who was a big help, when I started to try to do a rig back then! When was that…? OMG! So again: Thanks for your teachings and support back then and nowadays!
Well, then I made a mistake in my NWN2-Gmax-rigging tutorial. Thanks for the clarification! I’ll copy that over to the download page.
Blender: Well, ATM I’m a hybrid! Tile work I still do in Gmax - mainly because of the workflow and some things, which I haven’t figured out in Blender.
yeah, that’s something i too did learn only a few weaks ago while looking through obsidian’s exporting guide. it came up while freshlook was developing his mdb/fbx converter for nwn2. in fact, there’s the not so slight possibility that i am responsible for the error you made
Quote Semper: “in fact, there’s the not so slight possibility that i am responsible for the error you made ”
Well, that may be! I could check all my notes, mails and PMs from back then… Nooo! I won’t!
OK, I made some tests using the “With Automatic Weights”-option, when parenting a skinmesh to an Armature and I have to admit, that I’m impressed with the nice (rough) basic rig Blender was creating. OK, the mesh was a bit simpler (like the one shown in post #7), but still!
Anyways, that automated rig had vertices with 4 bones assigned and it showed up nicely IG! So, 4 seems also to be OK for non EE NWN1.
After some research I found, that Blender sets the max. of 4 bones per vert by default, because it seems to be the value for many games. But you can also lower the limit:
P.S. And that Freshlook-tool is such a great contribution for NWN2!
And I have to retract my statement:
Quote “After some research I found, that Blender sets the max. of 4 bones per vert by default, because it seems to be the value for many games.”
I did some more tests with other meshes and the Automatic Weight funktion might assign more than 4 bones:
I konw, there are bones assigned, which are not needed, but still: Blender does this!
Fortunately has this weight tool called “Limit Total”, so it’s possible to cut things down to 4 bones per vert.
… but it got bigger than I planed! Well, meanwhile I reached page 46, which is the part on the export procedure. So, it seems, that I might be coming to an end…
59 downloads of the tutorial so far! THANK YOU for checking it out!
So, did it work out for you = those, who tried the tutorial? That would be very intresting for me!
And an update:
I finally found the time to add some info on the page regarding the contents of the tutorial.
I exchanged the a_fa / a_ba templates (= now version 2): They now have dummy daggers and shields (all = small, large and tower), which make it much more easy to position the item nodes after rigging (see page 42/43 of the manual).