Jump to content

Importing models with animation


Mebaru
 Share

Recommended Posts

The material needs to use the animated model shader, since vertex skinning is all done on the GPU. Make that change to the material and it will work. In the future, I would like the editor to "guess" this when models are imported.

http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/material-editor-r8

 

Hardware skinning on the GPU pretty much eliminates the entire cost of performing animation, so you can have more characters onscreen at once with little performance penalty.

 

 

Link to comment
Share on other sites

The material needs to use the animated model shader, since vertex skinning is all done on the GPU. Make that change to the material and it will work.

 

Thank you for your reply. Not sure what you mean though. Where I should do this? Sorry for being retarded, I am only learning 3d workflow :)

 

Once more, I have rigged animated model in .fbx format. I can open it in Modo and animation is there. In Leadwerks I import the model and engine creates .mdl file from it. I double click it and model editor opens. I can see all bones. Animation sequence has correct number of frames but animation intact is missing. I tried other models obtained from different sources and everytime I import them animation sequence is blank. I can email the model if that helps.

Link to comment
Share on other sites

I'm in the same boat. From some very helpful tutorials and posts from this community I've figured out how to export from Blender (although I may be off on some settings), import to Leadwerks (3.1 Indie), fix normals, and work with textures. I can see my model on stage and in the editor, but this animation thing just isn't flying.

 

I've got a few questions in particular:

1) Can I use my Rigify animation/rig or not?

2) Do I select the armature object to export?

3) Does bone naming affect anything?

4) I've seen something about unchecking Default Take and Optimize Keyframes in the exporter settings and did that, but could someone post a shot of exporter settings that work for them?

5) Do I need to do something on the Leadwerks model editor end to make animations work there?

 

Thanks in advance. Loving the tool and the active community so far!

Link to comment
Share on other sites

1) Can I use my Rigify animation/rig or not?

Hmm, i doubt that's a good idea. I know from experience that rigify has a lot of unnecessary bones (for the widgets, etc...) upon export. Even when i got rid of these widgets, there were tons of other bones/attachments when i exported the rigged character. I must admit though, that i'm not a blender expert, so i'm sure there are ways to get rid of all these things, and only have the necessary bones exported.

 

I personnaly think that creating your rig from scratch is easier/better. Not saying that rigify is a bad option, though. wink.png

 

2) Do I select the armature object to export?

Haven't tried using a rigged character in blender and import in LE yet, but i'm pretty sure you need to select the mesh and armature to be exported.

 

3) Does bone naming affect anything?

No, i don't think so.

 

4) I've seen something about unchecking Default Take and Optimize Keyframes in the exporter settings and did that, but could someone post a shot of exporter settings that work for them?

No idea on that matter. Sorry. wink.png

 

5) Do I need to do something on the Leadwerks model editor end to make animations work there?

Haven't tried it myself yet, but soon i will, because i'm working on some free 3D character models (rigged) to upload for LE. tongue.png

 

ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3

Link to comment
Share on other sites

We should provide a FBX Wiki really for new comers and non 3D artists.

 

I personnaly think that creating your rig from scratch is easier/better. Not saying that rigify is a bad option, though.

I agree, but if rigify simply create normal Blender bones only it will work.

FBX export from Blender to LE3 won't work with special animation features and tools that are not simple bone system.

 

2) Do I select the armature object to export?

In object mode , just select your character (not the armature) and choose export object to FBX

 

3) Does bone naming affect anything?

Like ChrisV said : NO smile.png

 

4) I've seen something about unchecking Default Take and Optimize Keyframes in the exporter settings and did that, but could someone post a shot of exporter settings that work for them?

 

Check my old post for export settings :

http://www.leadwerks.com/werkspace/topic/7723-fbx-animation-range/

I found that settings on BLender are needed or you won't export the whole lenght track containing all animations.

blender_FBX_animations_export.jpg

5) Do I need to do something on the Leadwerks model editor end to make animations work there?

 

Here is how i do with succesfully imported FBX characters :

1 ) In Blender , i have all animations in one track, and import the model in FBX ot Leadwerks 3.

2) after import in LE3 model editor : keep sequence 0 untouched because it is the base containing all animations and you'll extract each time your sequences from that one.

- Select sequence 0 : choose extract seuquence to create a new sequence 1 named it idle or whatever , than specify frame start, frame end.

ok12.jpg

- Again select sequence 0 , than do same steps and choose others frame start and frame end.

- repeat same step as many sequences you have to extract

( At the end you can delete the base sequence 0 or keep it.)

 

-------------------

 

Here is the example of character using special animation control tools that fail to import caus it is not bones only ( failed for me at least).

rig.jpg

 

Here is a character using simple normal bones and that is ok when importing in LE3 :

Preview360px1.jpg

 

(For rigify, it is to test if i can find some rigify rigged character somwhere)

Stop toying and make games

Link to comment
Share on other sites

Didn't want the day to go by without at least saying thanks for the great feedback. It helps me feel more confident in the final steps, and some things to avoid. I know the Blender animation piece pretty well, but the export end is completely new to me. Still missing something, so I'm digging the Blender file to see if I can eliminate something there. If nothing comes of it I'll post an example file. Thanks again.

Link to comment
Share on other sites

To set the animation shader...in the material editor, there is a tab called "Shader". There are two shaders you can set there. For the regular shader choose the file "Shaders\Model\Animated\diffuse+normal+specular.shader". For the shadow shader (this gets used to render shadowmaps) choose "Shaders\Model\Shadow\shadow+animation.shader".

 

See the crawler character's material to see what it uses.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Just thought I'd chip in to say I've successfully imported and used a Rigify armature in Leadwerks 3.1. When you export to FBX, pick your model and your armature then in the export options select "Only Deform Bones" and "Export Selection". Now, if you're familiar with the rig, you'd expect this to just export the bones with the DEF prefix as these are the ones that do the actual deforming. For some reason, though, you get the ORG and MCH bones as well. Not sure if there's a way to strip those out too.

 

It's not the most opitimised solution for game animations but it works and the rig itself is ludicrously easy to animate with. The only issue I have at the moment is that when I set up and apply my body material the fingers of the mesh suddenly look like they've been run over by a bus, like the vertex positions have been scrambled out of shape. They're still noticeably fingers, they just look a little mangled.

Link to comment
Share on other sites

The only issue I have at the moment is that when I set up and apply my body material the fingers of the mesh suddenly look like they've been run over by a bus, like the vertex positions have been scrambled out of shape. They're still noticeably fingers, they just look a little mangled.

 

Check the bone rotation of the fingers

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Check the bone rotation of the fingers

 

Just checked this over and I can't see anything amiss. It seems to look just fine in Blender. I even specifically set the finger bone rotations so that the axis line up properly with the fingers: the Z axis points in the direction the fingers curl when they make a fist.

 

I'm wondering if the "preserve volume" checkbox makes a difference. Going to give that a quick check.

 

EDIT: Nope! Not that either. Stripping out shape keys and a few mask modifiers I was testing with don't change the mangled look either. How odd.

Link to comment
Share on other sites

 

@interference :T

Thanks for the tip i didn't know from rigify was possible even if i don't use it.

Some export problem or polygon topolgy on your model.

You can post your mesh without textures if you want us to take a look.

 

I've done some more testing and spotted something else I hadn't noticed before, as the first character I was testing with had boots on: imported characters' legs go REALLY weird from the knees downward. Like this: http://i.imgur.com/0I4skOL.png

 

I think for now I'll give it up until I've done more research. For now, it almost works but not quite: the way Rigify organises bones just doesn't sit well with Leadwerks without modification and I just have no idea what those modifications would be.

Link to comment
Share on other sites

Yep, Rigify is different from simple bones, and i htink not compatible with simple bones system, even with others engines the import will fail as what is imported for most 3D engines is bones and not a special animation system and features.

 

In Blender you have some mirror bones feature and rigging is not so complicated.

You can find some auto rigging tools for Blender

 

Mirror

Stop toying and make games

Link to comment
Share on other sites

Indeed: that I understand fairly well, it's just Rigify has some fancy foot roll, IK / FK switching, and hip movement stuff built in that would have been nice to be able to use outside of Blender.

 

It's certainly worth bringing up for when Josh reaches the 'Integration with blender' goal

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...