FBX: Camera and Lights issues #41374
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#41374
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
linux 64
Blender Version
2.71 daily build from here https://builder.blender.org/download/
Short description of error
Camera is imported incorrectly in houdini:
Explanation: http://i.imgur.com/TmBmcG5.png
Export options: http://i.imgur.com/xWNwasP.png
Here is the file: https://dl.dropboxusercontent.com/u/26887202/blender/test_fbx.zip
I talked to Mont29 - he said to make the report.
EDITED:
The same issue is with lights. All lights have difference of 90 degree.
Exact steps for others to reproduce the error
Export to fbx, open in houdini.
Changed status to: 'Open'
Added subscriber: @PaulGeraskin
#45329 was marked as duplicate of this issue
blender/blender#43153 was marked as duplicate of this issue
FBX: Camera issuesto FBX: Camera and Lights issuesTrick here is to determine whether it’s Houdini that does not handle correctly cam/lamp orientations on import, or our correction factor that’s bad…
Added subscriber: @jrestemeier
@Jens, maybe you have to get a simple file with spot+cam exported from maya or max?
@PaulGeraskin, could you please try this file from maya? blender_fbx_impor_camera.zip
Imports fine (well oriented) in Blender, afaik.
Added subscriber: @mont29
@mont29 it's difficult to say if rotation values are ok.
http://i.imgur.com/YRzqjmw.png
Could you use 35, 45, 90 degrees to test?
But base orientation is correct.
This comment was removed by @PaulGeraskin
Another screen from your fbx in the houdini http://i.imgur.com/6YTP39C.png
So it looks correct (the same) in both houdini and blender?
(Not my file btw, comes from #41372).
I'm possibly can be wrong. But possibly rotation is a bit different.
http://i.imgur.com/USTNSvO.png
Can you install houdini? Free version at least.
camera_and_lights.mb Some lights and a camera, modelled in Maya 2015
camera_and_lights.fbx Exported to FBX, from Maya 2015, default settings
The spotlight is off by 180 degree... something I'll have to fix right away in the importer. :)
Fix for spotlight exported from Maya: D729: FBX exporter/importer
Sorry, I'm a bit busy with other issues. Could make a similar test file in houdini?
BTW, a picture:
@jrestemeier Your fbx file looks like this http://i.imgur.com/PEWIwaP.png
I cannot export fbx from houdini as i have non-commercial version yet. But i'll as some people to help me.
Committed Jens' patch as
8da39736e2
.Would consider the issue fixed from our side, if inconsistencies remain in Houdini, then assumes it’s their call. Thanks everybody! :)
Changed status from 'Open' to: 'Resolved'
Changed status from 'Resolved' to: 'Open'
@mont29 you did not fix camera.
@mont29 @jrestemeier
It seems i found the way to import camera and lights with proper rotations.
Here is the result of my scene at the post http://i.imgur.com/8eHscPN.png
I just did default matrices for camera and lights.
https://developer.blender.org/diffusion/BA/browse/master/io_scene_fbx/fbx_utils.py;8da39736e2f4f11d44a84f30c07f008a8ec5316e$73
Here Lines 73 and 74 i changed like this:
MAT_CONVERT_LAMP = Matrix()
MAT_CONVERT_CAMERA = Matrix()
And everything imports perfectly in houdini! Yahoo!
Guys, can we do some checkboxes or parameters to exoport default matrices for lights and cameras?
And Here is rotations with such default matrices http://i.imgur.com/ZaGj35A.png
The only issue - "2.50448e-06" value instaed of "0" in houdini. Is it buggy?
2.50448e-06 is very small, probably the result of rounding error. It's normally not a problem.
The exporter doesn't set the "orthographic" flag on the camera. It should be easy enough to add. I'll do that if nobody else has already done that.
I don't have Max installed (or any experience using it) so I can't check, but I assume all Autodesk applications follow the same conventions when writing lights or cameras. So it should really be an issue for Houdini to fix their importer.
@jrestemeier I get you about rounding error. But possibly the rounding could be fixed somehow? Anyway thanks for answering.
If you add Orthographic camera - you will be my savior. :)
@jrestemeier @mont29
About Matrix rotations:
I get fully the issue. The issue with Rotations is DEFAULT ORIENTATION of lamps and cameras.
Here is my explanation: http://i.imgur.com/9WwRw6U.png Here you can see that blender's camera and light have Top Orientation. Houdini has Front Default Orientation for cameras and lights. Other 3d Packages like Max, Maya, Lightwave, Modo, Unity, Unreal. Cryengine etc. can have different Default Orientations.
I can even assume that Camera Default Orientation and Light Default Orientation can be different too. For example, Light can have Top Def Orientation and Camera can have Front default orientation.
So, to solve the issue with default orientation i propose to add such parameters for blender's exporter/importer: http://i.imgur.com/pBM5do7.png
Default Orientation for Camera and for Light can be Top (as in blender). But a 3dartist can choose orientation for a package he exports it.
Thanks.
The default orientation is specified in the FBX SDK ( http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/ ) , for example for lights: "By default, a FbxLight points along a node's negative Y axis." or for a camera "By default, a FbxCamera points in the direction of the node's positive X axis." The expectation is that any 3d package convert from and to this orientation automatically. For example Maya camera and lights point towards negative Z, but it converts when reading or writing FBX.
Ok, @jrestemeier
Then how do you explain that blender FBX imports incorrrectly in Modo7?
http://i.imgur.com/rlmXYzc.png - I just imported the FBX with your latest changes:
MAT_CONVERT_LAMP = Matrix() # Blender is -Z, FBX is -Y.
MAT_CONVERT_CAMERA = Matrix() # Blender is -Z, FBX is -X.
And here is the test with default matrices:
http://i.imgur.com/Iu6YcYK.png
MAT_CONVERT_LAMP = Matrix()
MAT_CONVERT_CAMERA = Matrix()
Cameras are wrong and Lights are ok.
Default Orientation in Modo:
http://i.imgur.com/oXzqbd2.png
Front
I think we need orientations:
http://i.imgur.com/pBM5do7.png
As 2 3d packages cannot load lights and cameras correctly exported from blender.
And here is your Maya-FBX imported into Modo http://i.imgur.com/QECK90K.png
Camera is ok, But Lights are wrong.
I 100% think that orientations for the exporter are needed.
@jrestemeier I’ll handle the ortho stuff (just a flag and perhaps the scale to handle, I thought it was already implemented :/ ).
Regarding orientation corrections, I wonder if we should not use pre/post rotations of FBX for those? Unless they are the ones messing things up (currently, we completely ignore those advanced transform stuff during export, and use a 'function' to apply them in import, that comes from another free lib from comment in code:
@PaulGeraskin we won't add such correction factors in UI for now. In first place, because we do not want to support other apps’ bugs! We have more than enough to handle our own! And this would make UI a complete mess.
@mont29
you will save lives of thousands 3d artists. This is really important.
Yes, you have FBX specs. But reality is different.
@mont29 : That is possible. I am using a system like that for the importer to fix the bone orientations and I can try that out in the exporter when I make bone orientation work in there. Though the transform stack is specified in the SDK, so there shouldn't be any variation in there. It may be simpler to use local transforms so that matrix decomposition can be used like it is now.
I think the pre/post rotations were introduced so that nodes map 1:1 to Maya transforms.
My suspicion is that the Maya importer detects that the FBX was written by Blender and compensates for the orientation of an earlier version.
I don't mind adding custom orientation for lights and cameras, though I have to wrap up my existing stuff first.
That would be great. I hope @mont29 will allow this. :)
@mont29 won't allow this, again, either this is a bug in our current handling of cam/lamps orientations, or this is a bug in Houdini. Unfortunately, I have the bad feeling issue is on our side… :/
@jrestemeier yes, please do not split yourself, one of that kind of issue at a time is more than enough for one man I believe! But honestly, I would be ten thousand times surprised if Maya made any special case for Blender - from their POV, we do not even exist, since we do not use their official-only-way-to-handle-FBX-files, aka FBX SDK!
@mont29, I just tried the files in Unity and got a similar result, i.e. the Blender orientation is 180 degree off from the Maya direction. Both are off 90 degree from the correct direction, but then again Unity doesn't make any attempt to import lights or cameras in the first place.
So I guess we have a bug, or we hit some odd compatibility/workaround code path in the FBX SDK.
@jrestemeier And how it will be in Unreal 3/4?
I'm on linux. Cannot test it.
Just added ortho support for cameras…
But there are still some very odd things with houdini and FBX, tbh I stopped using it as test tool, I suspect they do not handle things correctly really on their side either…
@mont29 thanks a lot!
The only thing is left - camera and lights rotation.
i hope you guys find the right way to fix rotations.
As maya fbx is imported correctly into houdini.
@mont29 @jrestemeier about rounding error - it seems it's Houdini's issue. I reported them.
Modo and unity has no rounding issue http://i.imgur.com/eEtc1IT.png
Added subscriber: @JulianEisel
@mont29, shouldn't fbx reports be #addons only?
Yep, addons and import/export. ;)
Added subscriber: @GeneFerrol
Same problem with export to Cinema 4D, Camera is importert mirror-inverted and aims into the opposite direction.
Setting to low, because this implies an app I have no access to…
Can you guys please check this issue is still relevant with latest build from our buildbot?
Ok, i tested in Unity and Houdini.
In Unity: Lights are ok. But Camera looks at x axis. http://imgur.com/LmdhXV3
in Houdini: lights and camera look at x axis. http://i.imgur.com/RYj1jcA.png
The file: test_fbx.blend
Sigh Ok, thanks for checking. :)
Added subscriber: @Cancer-2
Added subscriber: @AlexDoso
I can confirm that FBX Binary exports the camera switched in the opposite direction. This can be fixed prior to exporting by rotate the camera on it's own Y normal transformation orientation by 180 degrees. This is useless if there is camera animation.
FBX ASCII works okay.
Added potential fix as
2f6c86c461
.Can you please test it (either by direct download of latest FBX addon, or simply by testing tomorrow's builds from our buildbot)?
Changed status from 'Open' to: 'Resolved'
Ok, so according to @AlexDoso on
2f6c86c461
, lamp/camera are OK with Maya now.I’ll assume this is enough proof and will close this for now, thanks everybody.
wait a minute.
Changed status from 'Resolved' to: 'Open'
I tried in Houdini. And resuts a not good.
I tried to switch on/off animation but results are always not good.
Here is the fbx file. The fbx was exported without animation.
test_fbx_2.fbx
test_fbx_2.blend
Also, Maya 2015 did not open the file at all.
I reopen the bug for a while, Ok?
Here is maya 2016. Lights and cameras are imported incorrectly too. Directions are inverted. @mont29 I suggest you install the software for better testing.
@PaulGeraskin You are sure you used latest version available?
I cannot understand how @AlexDoso and you can get different results with the same software…
PS: Sure, I’ll gladly install Maya… if someone pays me the (insane) price of a license (there is no 'trial' version for linux, afaik).
@mont29 I have just downloaded the buildbot https://builder.blender.org/download/
And tested it.
You are the man. Crack it on cgpersia.
Or install free 30 days trial version to VMWare windows.
You can reinstall VMWARE when 3o days will be finished.
You are the developer. You need this software.
Also Houdini is free to install.
works with 3ds Max 2014 too. See picture below. The picture above wasn't from Maya, but from a software I use at work, very similar to 3ds max.
by the way, Max and Maya are free to download and use (but no for comercial use), and can be downloaded from autodesk website that gives a licence of 3 years for the software, from here: http://www.autodesk.com/education/free-software/3ds-max
@AlexDoso I dunno know how you did it. But all default maya and max importers imports the fbx with incorrect matrix.
Here is max 2015.
Show your importing settings.
just downloaded today's version for windows 64: https://builder.blender.org/download/blender-2.75-f4f7348-win64.zip and made that simple scene in Blender
just be sure that you have this version:
binary.blend
binary.fbx
It seems The last linux version was made at saturday. "Sat Jul 11 02:43:22 2015"
i'll download win version now.
Ok, I updated the windows version. And it seems it works ok now.
Sorry for misunderstanding... I was 100% sure that linux was updated.
The only issue i found i scale is 100x about. It seems i need to make scale 0.01 during exporting from blender.
Changed status from 'Open' to: 'Resolved'