New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBX Importer fixes and updates #591

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
8 participants
@Eirenliel
Copy link
Contributor

Eirenliel commented Jan 2, 2017

Here is the original topic: https://hub.jmonkeyengine.org/t/fbx-importer/30309

Changes:

  • Added support of FBX 2016-17 (7.5)
  • Fixed rotation orders (reverse the order, use only for Lcl Rotation)
  • Fixed animations transformation (proper conversion from parent space to bone space, proper use of rotation order and other transforms)
  • Implemented Segment Scale Compensate property from Maya (most cases) aka InheritType
  • Implemented loading bind pose from frame 0
  • Properly load all animations from animation layers
  • Reworked units size (still no program uses it properly to test)
  • Tons of testing with animations and different models

Eirenliel added some commits Jan 2, 2017

Updated FBX SceneLoader
- Fixed rotation orders (reverse the order, use only for Lcl Rotation)
- Fixed animations transformation (proper conversion from parent space
to bone space, proper use of rotation order and other transforms)
- Implemented Segment Scale Compensate property from Maya (most cases)
aka InheritType
- Implemented loading bind pose from frame 0
- Properly load all animations from animation layers
- Reworked units size (still no program uses it properly to test)
@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jan 2, 2017

Cool!

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Jan 2, 2017

Awesome 😃

@bensku

This comment has been minimized.

Copy link

bensku commented Jan 3, 2017

Awesome!

Is FBA still needed for animations?

@empirephoenix

This comment has been minimized.

Copy link
Contributor

empirephoenix commented Jan 3, 2017

Does anyone of you uses FBX, and can validate that it does not break existing stuff badly? Since I'm not using FBX, I'm a bit carefull with directly merging it.

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jan 4, 2017

@bensku no, it's not since previous version

@bensku

This comment has been minimized.

Copy link

bensku commented Jan 4, 2017

Oh. Didn't notice that. Very good!

@bensku

This comment has been minimized.

Copy link

bensku commented Jan 5, 2017

java.lang.NullPointerException
at com.jme3.scene.plugins.fbx.mesh.FbxMesh.applyCluster(FbxMesh.java:127)
at com.jme3.scene.plugins.fbx.mesh.FbxMesh.toJmeObject(FbxMesh.java:213)
at com.jme3.scene.plugins.fbx.mesh.FbxMesh.toJmeObject(FbxMesh.java:58)
at com.jme3.scene.plugins.fbx.obj.FbxObject.getJmeObject(FbxObject.java:113)
at com.jme3.scene.plugins.fbx.node.FbxNode.toJmeObject(FbxNode.java:399)
at com.jme3.scene.plugins.fbx.node.FbxNode.toJmeObject(FbxNode.java:71)
at com.jme3.scene.plugins.fbx.obj.FbxObject.getJmeObject(FbxObject.java:113)
at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:496)
at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:503)
at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:503)
at com.jme3.scene.plugins.fbx.node.FbxNode.createScene(FbxNode.java:503)
at com.jme3.scene.plugins.fbx.FbxLoader.constructSceneGraph(FbxLoader.java:406)
at com.jme3.scene.plugins.fbx.FbxLoader.load(FbxLoader.java:126)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:373)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:416)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:420)
<redacted my application's stack trace>
at com.jme3.app.state.AppStateManager.initializePending(AppStateManager.java:251)
at com.jme3.app.state.AppStateManager.update(AppStateManager.java:281)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:236)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:193)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)

This happens when trying to load one rather complex scene exporter from Blender 2.7.8. It happens with older version too, though.

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jan 5, 2017

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jan 5, 2017

@bensku you're testing the wrong importer ;)
This patch is about com.jme3.scene.plugins.fbx.SceneLoader

@bensku

This comment has been minimized.

Copy link

bensku commented Jan 6, 2017

Oh, that explains a lot :) No wonder why it didn't work...

I guess I need to register SceneLoader to be associated with FBX manually.

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jan 6, 2017

@bensku you can just edit Desktop.cfg

@Nehon Nehon force-pushed the jMonkeyEngine:master branch from 1354127 to f270985 Jan 14, 2017

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Feb 2, 2017

Are you going to merge it? :)

@Nehon

This comment has been minimized.

Copy link
Contributor

Nehon commented Feb 2, 2017

@shadowislord Could you review this?

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Feb 2, 2017

Yesterday I grabbed a few fbx model, I want to test this new fbx loader.
A bit hard to copy paste the code from here to my fork, so will appreciate you if you can merge this commit into a temporary branch (like NewFBXLoader) so I can build from it locally.
Thanks

@empirephoenix

This comment has been minimized.

Copy link
Contributor

empirephoenix commented Feb 2, 2017

You can just clone https://github.com/Heatherglade/jmonkeyengine (see the line with the link above the all checks passed)

@Nehon

This comment has been minimized.

Copy link
Contributor

Nehon commented Feb 2, 2017

A pull request is essentially a branch, you just have to pull it
https://help.github.com/articles/checking-out-pull-requests-locally/

@empirephoenix

This comment has been minimized.

Copy link
Contributor

empirephoenix commented Feb 24, 2017

So nay news on testing this?

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Apr 4, 2017

Sorry for late reply
Finally I found some time to test new fbx loader.
I tested an animated fbx model which exported from blender. (fbx binary 7400 version) but the animation was broken. (the animation was stretched on arms and legs).
I do not use Maya, so I could not test it.
@Eirenliel have you tried an fbx model exported from blender ?

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Apr 4, 2017

@Ali-RS we are not working with Blender, we are working with Maya. I also do know that some stuff Blender imports from FBX wrong, but not necessary this case.

We recently made another giant update for FBX importer, i will share it a bit later, so this pull request can be just closed. Also can you send the file you are talking about for us to test in the new version?

@empirephoenix

This comment has been minimized.

Copy link
Contributor

empirephoenix commented Apr 4, 2017

Ok, closed as per request, 👍 for next request :)

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Apr 6, 2017

Also can you send the file you are talking about for us to test in the new version?

Yes, you can get it here :
https://drive.google.com/open?id=0B35eWZpi0dBoZmtwNjdRUGp6Skk

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Apr 6, 2017

Also, what bone rotation mode does your fbx loader support ?
Quaternion(WXYZ) or XYZ Euler or ... ?

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Apr 6, 2017

@Ali-RS i've never seen quaternion rotation in real files, so i don't think it supports it now. I will check the provided file.

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Apr 7, 2017

Okay.
Can you please test these two fbx files also : https://drive.google.com/open?id=0B35eWZpi0dBoVTZ1MlVBTTZpaUE

I have followed this tutorial for exporting them from blender : http://digitalrune.github.io/DigitalRune-Documentation/html/6f749972-9cb2-4274-b283-c327ba45e379.htm
in one of them i enabled !EXPERIMENTAL! Apply Transform when exporting and in the other one not.
I am getting diffrent result for each one in jme.
I hope they play fine in your code :)
Thanks so much

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Apr 7, 2017

@Ali-RS all of this files have problems when importing. We will see why when we have time, thanks :)

@Ali-RS

This comment has been minimized.

Copy link
Contributor

Ali-RS commented Apr 7, 2017

Thank you.

@deltasquad451

This comment has been minimized.

Copy link

deltasquad451 commented May 8, 2017

@Eirenliel I seem to be getting an issue with the animations not playing properly, I have a model created in MayaLT with a walk animation.
Here it is in MayaLT:
mayawalk_2017_05_08_14 37 18

When I import the model with Jmonkey I get the following:
jmonkey_2017_05_08_14 37 22

Here is the model in question:
https://drive.google.com/file/d/0B24ekh4abl8CTEhYeVFmZDZfTWM/view?usp=sharing

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented May 9, 2017

@deltasquad451 thank you, we will test it. We are working on fixing importer for our game on a daily basis, but it's an active development, so i don't know when we will be ready and have time to try to move it to JME, but it will happen any time soon :)

@Pilvinen

This comment has been minimized.

Copy link

Pilvinen commented Jul 12, 2017

@Eirenliel Any news on the above with deltasquad451? This is currently a major blocker for our project and has been for quite some time. We were already considering switching to Unity because we haven't found a way to get our models working. But we really don't want to do that if there's a possibility to get things working.

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jul 12, 2017

@Pilvinen I think you can open .fbx in Blender and then save it like a .xbuf file which has good support from jME :)
https://github.com/xbuf/xbuf
.xbuf have no problems with animation on jME.

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jul 12, 2017

@Pilvinen sorry we currently can't make necessary checks and prepare commits in jME.

@Pilvinen

This comment has been minimized.

Copy link

Pilvinen commented Jul 12, 2017

@JavaSaBr Unfortunately it's not possible. Blender messes up the rig on import when importing FBX. The FBX support in Blender is horribly outdated and buggy. And on the other hand Maya LT doesn't support exporting as .xbuf AFAIK. But thanks for the tip anyway.

@Eirenliel Give me an estimate so I can make educated decision where to take my project to which I've invested considerable amount of time and money. 1 months, 2 months, 4 months, 6 months, 12 months, 24 months, never?

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jul 12, 2017

@Pilvinen do you think we have no any format which has good support for both programs?

@Pilvinen

This comment has been minimized.

Copy link

Pilvinen commented Jul 12, 2017

@JavaSaBr Unfortunately Maya LT supports only .OBJ, .FBX and .mayaLT. It's Autodesk's way of saying "screw you" to indie developers who can't afford Maya full.

.blend support is good in Jmonkey but this whole Maya <--> Blender and Jmonkey <--> Maya inoperability has really screwed us over. We've tried all kinds of magic tricks for several months and we simply don't have a way to get our rigged and animated models to Jmonkey.

Had we known this would be such an huge issue from the start we might have chosen differently, but we're now one year into development and frankly I'm at the end of my wits with this issue.

FBX in a very unfortunate closed format industry standard - but the situation is what it is. Most of the animators out there use Maya or some other Autodesk product - and you guessed it - they all export FBX. Importing to Blender is a no-go otherwise we would simply do it like that and export .blend from Blender.

I don't know what to do.

EDIT:
The only thing I want to do is to get a pipeline, any pipeline, working which would allow us to:

  1. Make 3D models with Maya LT and Blender
  2. Make animations in Maya LT
  3. Export FBX from Maya LT
  4. ???
  5. Import to Jmonkey
@JavaSaBr

This comment has been minimized.

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jul 12, 2017

@deltasquad451

This comment has been minimized.

Copy link

deltasquad451 commented Jul 12, 2017

@JavaSaBr Does the Bos FBX support animations though?

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jul 12, 2017

@deltasquad451 I don't know

@Pilvinen

This comment has been minimized.

Copy link

Pilvinen commented Jul 12, 2017

@JavaSaBr This happens with Blender. Unfortunately it's not only the mesh but as you can see the bones are all messed up too, scale and everything. It's hopeless.

@deltasquad451 did play around with BOS FBX but was unable to get it working with that either. It was some time ago so I can't remember all the details of what happened.

Growlybearproductions link I haven't seen before but it seems he only had problems with the mesh orientation and scale - and if you take a look at the screenshot I provided from my Blender FBX import adventures you can see it's hopelessly messed up and not just rotation and scale issue. The animation is there but it's... very funky.

@JavaSaBr

This comment has been minimized.

Copy link
Contributor

JavaSaBr commented Jul 15, 2017

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jul 20, 2017

@Pilvinen again all i can say is sorry, we are pretty swamped right now and if i try to give any estimate on plans, it might be wrong by any magnitude...

@Eirenliel

This comment has been minimized.

Copy link
Contributor Author

Eirenliel commented Jul 20, 2017

@Pilvinen but i tested the file you send and it does have some issues with animation. Sadly, we have no time to investigate it further :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment