USDA import crashes Blender during material assignment to geometry subsets #125184

Closed
opened 2024-07-21 18:55:29 +02:00 by Geoff Gerber · 3 comments

System Information
Operating system: Windows 11
Graphics card: NVidia 3060

Blender Version
Broken: 4.1, 4.3 alpha (through debugger as well)
Worked: unknown

When importing some .usda files, Blender crashes

Exact steps for others to reproduce the error

  • Using the USD Import function, import the provided .usda file.
  • Blender crashes to desktop. When run through the debugger, it's failing on line 766 of the usd_reader_mesh.cc file.

I've run the file through usdchecker and it seems valid. I can inspect it in usdview as well.

Note: You may have to import it more than once. This bug does seem intermittent, and I'm not sure what would cause that. The material bindings seem to all properly reference the proper material prim.

**System Information** Operating system: Windows 11 Graphics card: NVidia 3060 **Blender Version** Broken: 4.1, 4.3 alpha (through debugger as well) Worked: unknown **When importing some .usda files, Blender crashes** **Exact steps for others to reproduce the error** - Using the USD Import function, import the provided .usda file. - Blender crashes to desktop. When run through the debugger, it's failing on line 766 of the usd_reader_mesh.cc file. I've run the file through usdchecker and it seems valid. I can inspect it in usdview as well. Note: You may have to import it more than once. This bug does seem intermittent, and I'm not sure what would cause that. The material bindings seem to all properly reference the proper material prim.
Geoff Gerber added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2024-07-21 18:55:29 +02:00

I'll confirm the crash - the issue is that the USD file is setting per-point materials whereas we only support per-face; so we're using the wrong indices to assign the materials and corrupting memory.

That said the story is a bit more complicated:

  • This USD file uses "vertex" for the elementType of the geometry subset. This is incorrect. USD says that only the following tokens are permitted: "[face, point, edge, tetrahedron]". This needs to be reported to whatever software created this file (CgfConverter) and rectified as soon as possible so broken files don't proliferate further. @Geoffrey-Gerber can you do this?

  • The usage of per-point subsets was only added in USD 24.03 earlier this year, so not much software can use it (my version of Houdini doesn't and still only says that face is supported). It is strange that CgfConverter is choosing to do this at all when dealing with materials; I wonder why.

CC @makowalski for awareness

I'll confirm the crash - the issue is that the USD file is setting per-point materials whereas we only support per-face; so we're using the wrong indices to assign the materials and corrupting memory. That said the story is a bit more complicated: - This USD file uses "vertex" for the `elementType` of the geometry subset. This is incorrect. USD says that only the following tokens are permitted: "[face, point, edge, tetrahedron]". This needs to be reported to whatever software created this file (`CgfConverter`) and rectified as soon as possible so broken files don't proliferate further. @Geoffrey-Gerber can you do this? - The usage of per-point subsets was only added in USD 24.03 earlier this year, so not much software can use it (my version of Houdini doesn't and still only says that face is supported). It is strange that `CgfConverter` is choosing to do this at all when dealing with materials; I wonder why. CC @makowalski for awareness
Author

I'm the author of CgfConverter, so I'll make sure to get it fixed up so it doesn't generate broken files. Fortunately this is just in a feature branch so nobody else should be creating these.

I really appreciate you looking at this so quickly! Since this appears to be a CgfConverter bug, this issue can probably be closed if there are no other Blender side concerns.

I think I'll also reach out to the USD team and see if they feel like verifying indices in usdchecker.

I'm the author of CgfConverter, so I'll make sure to get it fixed up so it doesn't generate broken files. Fortunately this is just in a feature branch so nobody else should be creating these. I really appreciate you looking at this so quickly! Since this appears to be a CgfConverter bug, this issue can probably be closed if there are no other Blender side concerns. I think I'll also reach out to the USD team and see if they feel like verifying indices in `usdchecker`.

I'm the author of CgfConverter, so I'll make sure to get it fixed up so it doesn't generate broken files. Fortunately this is just in a feature branch so nobody else should be creating these.

Ah, great, lol :)

I really appreciate you looking at this so quickly! Since this appears to be a CgfConverter bug, this issue can probably be closed if there are no other Blender side concerns.

I think I'll also reach out to the USD team and see if they feel like verifying indices in usdchecker.

We'll still want to fix the crash on our side so I'll leave this open. But additional validation upstream would certainly be good, not only for the indices but also for the allowed token names for elementType etc. Their docs also, very weakly, seem to nudge in the direction that material subsets are expected to be used for "face". If you can get them to commit to saying if materials are allowed or not for the other element types that would be good too: https://openusd.org/release/api/class_usd_shade_material_binding_a_p_i.html#a32d3590228a297a335855c150c4dea64

> I'm the author of CgfConverter, so I'll make sure to get it fixed up so it doesn't generate broken files. Fortunately this is just in a feature branch so nobody else should be creating these. > Ah, great, lol :) > I really appreciate you looking at this so quickly! Since this appears to be a CgfConverter bug, this issue can probably be closed if there are no other Blender side concerns. > > I think I'll also reach out to the USD team and see if they feel like verifying indices in `usdchecker`. We'll still want to fix the crash on our side so I'll leave this open. But additional validation upstream would certainly be good, not only for the indices but also for the allowed token names for `elementType` etc. Their docs also, very weakly, seem to nudge in the direction that material subsets are expected to be used for "face". If you can get them to commit to saying if materials are allowed or not for the other element types that would be good too: https://openusd.org/release/api/class_usd_shade_material_binding_a_p_i.html#a32d3590228a297a335855c150c4dea64
Bart van der Braak added
Type
Bug
and removed
Type
Report
labels 2024-08-14 12:55:35 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-08-24 06:55:08 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#125184
No description provided.