Jump to content
  • 0
Phodex Games

Distorted model pos/rot/scale after import to Leadwerks

Question

Hi,

I have this annoying problem for pretty a while. I currently was trying to figure out the error, but I am no master at Blender so maybe its my mistake, maybe you have to take care on something in Leadwerks?

Look thats the problem:

1.  That is how I set it up in Blender:

Blender.PNG.3de43af8d4318128c0509029a0ede15f.PNG

2. Now I export the hands model and the sword model (in the fbx model format) seperatly and import them into Leadwerks. After I put them into the engine, adjust their scale and zero their position and rotation it looks like this:

Leadwerks.PNG.38e566e26b7155d3171a05d483b4200a.PNG

And yes I did apply the rotation, location and scale in blender. Why the heck doen't this work? I get some trouble with my animations with that, because I put the sword to an bone handling the weapon position within the animation. There is this "Forward" and "Up" setting when exporting the fbx, maybe you need to take care on that? I dont know, I would be very very glad if you could help me because that makes me freak out :o

NOTE: I adjusted the scale of the sword, because it had completely diffrent dimensions, like 100 times bigger, thats why it looks diffrent scale wise. However the biggest problem is that its rotation is wrong.

Share this post


Link to post

12 answers to this question

Recommended Posts

  • 0
1 hour ago, Genebris said:

Use Leadwerks exporter.

If it just would be that easy... I tried the exporter of course, but with it, I cannot export the models seperatly somehow. If I select the sword and export with "Export only selected objects" ticked, Blender says "Couln't find any exportable objects." :(

Just tried again. The exporter works even worse. Look what happens after export inside blender

 

BEFORE:

:5972637bd5ccf_BeforeExporter.PNG.2d6e346b106ed126f89be1e31eb23d59.PNG:

AFTER USE OF EXPORTER:

59726389ea556_AfterExporter.PNG.bbb92a52ba66037a6b00c162ec770f6b.PNG

And no the model doesn't appear like in the first picture, nor does it like in the second picture, after I imported it into Leadwerks.

Really annoying if you try to make some precise first person animations!

 

Share this post


Link to post
  • 0

The exporter does not let you export seperate objects within an amature. You need to completely seperate the object that the exporter plugin recognize it as seperate object. Okey see the changes I made above! Here is the blend file.

Sword Test.blend

Share this post


Link to post
  • 0

Don't you want your knife as separate object? I deleted empty animation from it and it exports correctly. Also, to export arms you only need to select armature in Blender.

Share this post


Link to post
  • 0

Okey after playing around a bit and deleting all animations & armature it worked. Could you tell me how you deleted those animations? I always struggle a bit when deleting animations in blender I dont really know how to do it ^^. Still I dont really know what the animations have to do with that distorted rotation, isnt this a thing which should not be? Well what ever, thank you a lit for you help and time. At least I know now where the mistake was :)

Share this post


Link to post
  • 0

Hi. I think you forgot to reset the transformations of your model BEFORE exporting.

All the "root" items of a model need to have their rotation and scale reset before exporting.

Have you done this?:

 

 

Share this post


Link to post
  • 0
On 21.7.2017 at 2:47 PM, Phodex Games said:

And yes I did apply the rotation, location and scale in blender.

See that in my first post. But I know of found the problem. Had to do with the animations attached to the objects. Something went wrong there, still I dont know what exactly.

Share this post


Link to post
  • 0

You can animate the scale of your bones in the animations. Can you check your animation track and see if there are keys in the scale channel?

I've seen that it's better that you have your reference pose with skinning untouched at the first frame. If you tweak the first frame, you could have a bad reference frame and get bogus values coming in, but that depend on how the importer will treat the data...

As another note, if you had reset the transformations AFTER doing the skinning and animations could get problematic...

Share this post


Link to post
  • 0
3 hours ago, Christian Clavet said:

You can animate the scale of your bones in the animations. Can you check your animation track and see if there are keys in the scale channel?
 

No scaling in animations is not applied in LE unfortunately (although will you can in your modeling program). Only rotate and transform are applied. I've submitted a request for this a while back.

Share this post


Link to post
  • 0

Thanks for the info. I was not aware of this. So the scale distortion would probably come from the first reference frame. If you can do a test, remove all skinning and animation on the model, reset it again and do a test export to see if it maintain the scale. Then if it's ok, continue from there: Apply skinning (don't touch the first frame), the export before making any animation. If it still maintain, continue with the animation. (Keep a safe copy of the skinned model, and reuse it for each animation or animations)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...