FBX import/export: Fix Camera rotation #104500
No reviewers
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104500
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Inho-Lee/blender-addons:main"
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?
FBX-Blender axis correction should not be applied
for cameras' Position, UpVector and InterestPosition
Fixes #45176
Am missing a bit of context/explanation about why this fix would be the proper solution here? Would also be good to know if this was successfully tested at least against the major game engines (Unity, Unreal...)?
Another question is, does this survive camera animation?
Camera fixes have a notorious history of 'fixing one issue with one third party software, creating another issue with another third party tool' ;)
@Mysteryem may know better though here?
@ -57,6 +57,7 @@ FBX_KTIME = 46186158000 # This is the number of "ktimes" in one second (yep, pr
MAT_CONVERT_LIGHT = Matrix.Rotation(math.pi / 2.0, 4, 'X') # Blender is -Z, FBX is -Y.
MAT_CONVERT_CAMERA = Matrix.Rotation(math.pi / 2.0, 4, 'Y') # Blender is -Z, FBX is +X.
Would rename this to
MAT_CONVERT_CAMERA_IMPORT
@ -57,6 +57,7 @@ FBX_KTIME = 46186158000 # This is the number of "ktimes" in one second (yep, pr
MAT_CONVERT_LIGHT = Matrix.Rotation(math.pi / 2.0, 4, 'X') # Blender is -Z, FBX is -Y.
MAT_CONVERT_CAMERA = Matrix.Rotation(math.pi / 2.0, 4, 'Y') # Blender is -Z, FBX is +X.
MAT_CONVERT_CAMERA_INVERSE = Matrix.Rotation(-math.pi / 2.0, 4, 'Y')
Would rename this to
MAT_CONVERT_CAMERA_EXPORT
I'm not sure MAT_CONVERT_CAMERA_EXPORT is a proper name here. MAT_CONVERT_CAMERA is need for export operations too. However this inverse matrix is required in order to property calculate special properties UpVector, InterestPosition.
Originally I tested FBX cameras in QtQuick3D. At the first time, I exported a blender scene into a FBX format and read it through libassimp.
Recently I found a bug in libassimp which assumed the camera properties as default values and fixed it.(
cdfdd75a66
) This patch is related with it.I tested it with FBXSDK while exporting blender scenes having a camera to FBXs.
Do you have any example fbx files for more tests?
I didn't consider any import cases.
Issue #45176 is about Import, so it would not be correct to say that this fixes that issue in your description.
d995d8c634
to29b8d4967e
29b8d4967e
tof30518faf8
FBX export: Fix Camera rotationto FBX import/export: Fix Camera rotationI tested import feature and the fbx files in Issue #45176
With the import patch, importing an FBX exported by Blender (default settings for both import and export) (both with and without the export patches in this PR) results in the camera being inverted for me.
For example, Blender's default startup scene exported as FBX and re-imported:
The export patch changes the
"Up"
,"To"
,"UpVector"
and"InterestPosition"
properties, but as far as I can tell, the FBX importer doesn't read any of those properties in the first place.Oh Thanks. Now I could understand fully. I'll upload the patch in this weekend.
Since this PR was originally only affecting exports, I've tried to find and fix the import issue with #104561
Checkout
From your project repository, check out a new branch and test the changes.