When importing two USDZ objects only the material of the first is preserved #114489

Closed
opened 2023-11-04 20:46:45 +01:00 by Wouter Stomp · 5 comments

System Information
Operating system: macOS-14.0-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Max 1.2

Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-03 17:00, hash: 9b0ea21a5bbc
Worked: unknown

Short description of error
When importing two USDZ objects only the material of the first is preserved. It seems like two materials are created ('make unique' is checked for the material in the importer), but image textures are not made unique/imported when a identically named image is already in the blend file.

Exact steps for others to reproduce the error
Import one of the two attached USDZ files, then the other. For the first one the material is shown correctly while the second gets the same material as the first object (see screenshot).

**System Information** Operating system: macOS-14.0-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Max 1.2 **Blender Version** Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-11-03 17:00, hash: `9b0ea21a5bbc` Worked: unknown **Short description of error** When importing two USDZ objects only the material of the first is preserved. It seems like two materials are created ('make unique' is checked for the material in the importer), but image textures are not made unique/imported when a identically named image is already in the blend file. **Exact steps for others to reproduce the error** Import one of the two attached USDZ files, then the other. For the first one the material is shown correctly while the second gets the same material as the first object (see screenshot).
Wouter Stomp added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-11-04 20:46:46 +01:00
Member

I can confirm the behavior.

However, you can get around the problem following these steps:

  • import the first USD, using the texture as packed
  • unpack the texture
  • import the second USD, also using packed

Now the textures are individual in storage.
This however is also not ideal (since this workflow only works for two materials using equally named textures, as soon as a third USD comes in, the workflow also collapses).

Basically, handling name collisions is a bit weak (also see #100361 in regards to unpacking).

Actually, I would assume the recommended way of doing this would be the following (if you know in advance these textures are equally named):

  • import the first USD, using the texture as Copy
  • use a unique folder name in the option:
    image
  • import the second USD, using the texture as Copy again
  • use a different unique folder name in the option:
    image

Does this work for you?

I can confirm the behavior. However, you can get around the problem following these steps: - import the first USD, using the texture as `packed` - unpack the texture - import the second USD, also using `packed` Now the textures are individual in storage. This however is also not ideal (since this workflow only works for two materials using equally named textures, as soon as a third USD comes in, the workflow also collapses). Basically, handling name collisions is a bit weak (also see #100361 in regards to unpacking). Actually, I would assume the recommended way of doing this would be the following (if you know in advance these textures are equally named): - import the first USD, using the texture as `Copy` - use a unique folder name in the option: ![image](/attachments/bce8f24c-7c75-4b04-9fab-1e2cfb6a6ae1) - import the second USD, using the texture as `Copy` again - use a different unique folder name in the option: ![image](/attachments/9c0a4ee4-662c-4014-b822-8ff474df1fd5) Does this work for you?
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-11-06 11:59:57 +01:00
Author

As a workaround that works yes. However I would expect the 'make unique' option to take care of this, the tooltip says "Import each USD material as a unique Blender material"; I would expect that to include the image textures used within the material as well.

Strangely if you want to keep them packed, renaming the image textures after the first import does not work as a workaround, the second imported item will still get the renamed image textures attached.

(if you know in advance these textures are equally named)

That is a big if; in my case I was simply importing objects scanned with a 3d scanning app, I would have no idea how it names its textures before running into this bug.

As a workaround that works yes. However I would expect the 'make unique' option to take care of this, the tooltip says "Import each USD material as a unique Blender material"; I would expect that to include the image textures used within the material as well. Strangely if you want to keep them packed, renaming the image textures after the first import does not work as a workaround, the second imported item will still get the renamed image textures attached. > (if you know in advance these textures are equally named) That is a big if; in my case I was simply importing objects scanned with a 3d scanning app, I would have no idea how it names its textures before running into this bug.
Member

Strangely if you want to keep them packed, renaming the image textures after the first import does not work as a workaround, the second imported item will still get the renamed image textures attached.

It is not the ID name you give to the texture, but the packed path that is relevant here (and these are still the same)

image

image

As a workaround that works yes. However I would expect the 'make unique' option to take care of this, the tooltip says "Import each USD material as a unique Blender material"; I would expect that to include the image textures used within the material as well.

That I would consider as a request for improved behavior (not a bug), the materials after all are unique (just not the textures).
There are also situations where you would actually want the same texture to be used (think of atlas textures).
If something would need to be changed here, we would probably need an additional option (something like Texture Name Collisions)

> Strangely if you want to keep them packed, renaming the image textures after the first import does not work as a workaround, the second imported item will still get the renamed image textures attached. It is not the ID name you give to the texture, but the packed path that is relevant here (and these are still the same) ![image](/attachments/c320d9c8-1581-4281-8f4a-0466650eb819) ![image](/attachments/ae93d39c-cb90-4b91-8ce3-0f1f25013889) > As a workaround that works yes. However I would expect the 'make unique' option to take care of this, the tooltip says "Import each USD material as a unique Blender material"; I would expect that to include the image textures used within the material as well. > That I would consider as a request for improved behavior (not a bug), the materials after all are unique (just not the textures). There are also situations where you would actually want the same texture to be used (think of atlas textures). If something would need to be changed here, we would probably need an additional option (something like `Texture Name Collisions`)
Author

Thanks for all the explanations. A texture name collision option would definitely be an improvement.

Thanks for all the explanations. A texture name collision option would definitely be an improvement.
Member

Thanks for all the explanations. A texture name collision option would definitely be an improvement.

OK, see below on where to suggest improvements, will have to close this report though (due to not being a real bug)

Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors.

For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug
> Thanks for all the explanations. A texture name collision option would definitely be an improvement. OK, see below on where to suggest improvements, will have to close this report though (due to not being a real bug) ``` Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug ```
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2023-11-27 14:09:10 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
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
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#114489
No description provided.