Fix duplicate shape key import when the FBX connections are duplicated #104954
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104954
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Mysteryem/blender-addons:fbx_fix_duplicate_shapekey_connections"
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?
Rarely, FBX files with duplicate ShapeKey-related connections are
encountered. The FBX IO addon would add a ShapeKey for each duplicate,
however external software appears to ignore the duplicates, or
overwrite the existing duplicates such that the same effect as ignoring
new duplicates is achieved.
This patch modifies the FBX importer to skip all duplicate ShapeKey-
related connections when finding the ShapeKeys to add to each Mesh.
While it is unclear if they are ever encountered, importing multi-user
Shapes/BlendShapeChannels/etc. as single-users remains supported, e.g.
a Mesh with a BlendShape with two different BlendShapeChannels that both
have the same Shape will still import that Shape as two separate
ShapeKeys.
The code needed for iterating through each type of connection was
duplicated and was getting rather large with the newly added code, so
it has been refactored into calling a generator helper function.
The outermost loop had an unnecessary line of code that would re-get
values from
fbx_table_nodes
, this has been removed.The attached .fbx is a default cube with "Move Up" and "Move Down" ShapeKeys added, but I have modified it by duplicating each of the ShapeKey-related connections once. With the old code, this would import 8 copies of each ShapeKey. With this patch, only a single ShapeKey of each is imported.
This fixes the import of hundreds of thousands of Shape Keys when importing the files in #104909 due to their excessively duplicated connections, but the import will still fail due to #84111 because the files contain extraneous FullWeights.