OBJ/USD import: imported object has no active material, material has 2 users #100737

Closed
opened 2022-08-31 20:45:39 +02:00 by Scurest · 9 comments
Contributor

Blender Version
Broken: 3.3.0 and 3.4.0
Worked: never?

Short description of error
Using the new importer, import an OBJ with a material. Check the Shader Editor. Nothing shows up even when the object is active. You have to click a material slot to get anything to show up. The object also has no active material (ob.active_material in Python). This seems to affect both USD and OBJ since 3.3 (probably started with D15145).

iss1.png

After you click a slot, you also notice the material has two users. Seems to affect all the importers written in C++ (Collada, USD, Alembic, OBJ), and seemingly has been an issue since "forever".

iss2.png

Neither issue exists in the Python importer.

**Blender Version** Broken: 3.3.0 and 3.4.0 Worked: never? **Short description of error** Using the new importer, import an OBJ with a material. Check the Shader Editor. Nothing shows up even when the object is active. You have to click a material slot to get anything to show up. The object also has no active material (`ob.active_material` in Python). This seems to affect both USD and OBJ since 3.3 (probably started with [D15145](https://archive.blender.org/developer/D15145)). ![iss1.png](https://archive.blender.org/developer/F13442004/iss1.png) After you click a slot, you also notice the material has two users. Seems to affect all the importers written in C++ (Collada, USD, Alembic, OBJ), and seemingly has been an issue since "forever". ![iss2.png](https://archive.blender.org/developer/F13442018/iss2.png) Neither issue exists in the Python importer.
Author
Contributor

Added subscriber: @scurest

Added subscriber: @scurest

Added subscribers: @aras_p, @mano-wii

Added subscribers: @aras_p, @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm the lack of active material and the strange 2 users (when only 1 was expected).
These were the files I used (exporting a Cube with material):
untitled.mtl
untitled.obj

@aras_p, is this something to worry about? (especially with the proximity of the D15777: obj: remove Python based obj importer/exporter addon (for 3.6+)).


(I also saw this other patch, I don't know if it has anything to do with the problem D15827: Fix invalid memory handling in C++ OBJ MTL Importer.).

I can confirm the lack of active material and the strange 2 users (when only 1 was expected). These were the files I used (exporting a Cube with material): [untitled.mtl](https://archive.blender.org/developer/F13442201/untitled.mtl) [untitled.obj](https://archive.blender.org/developer/F13442200/untitled.obj) @aras_p, is this something to worry about? (especially with the proximity of the [D15777: obj: remove Python based obj importer/exporter addon (for 3.6+)](https://archive.blender.org/developer/D15777)). --- (I also saw this other patch, I don't know if it has anything to do with the problem [D15827: Fix invalid memory handling in C++ OBJ MTL Importer.](https://archive.blender.org/developer/D15827)).

Added subscriber: @deadpin

Added subscriber: @deadpin

USD has this issue as well; and it doesn't seem new. The importers must be forgetting a hidden step somewhere. The active_material_index is set to 0 but something in the system doesn't believe it's set.

USD has this issue as well; and it doesn't seem new. The importers must be forgetting a hidden step somewhere. The `active_material_index` is set to 0 but something in the system doesn't believe it's set.
Aras Pranckevicius self-assigned this 2022-09-01 05:52:42 +02:00

I'll investigate both OBJ and USD.

I'll investigate both OBJ and USD.
Aras Pranckevicius changed title from OBJ import: imported object has no active material, material has 2 users? to OBJ/USD import: imported object has no active material, material has 2 users 2022-09-01 07:36:40 +02:00

This issue was referenced by f366d197db

This issue was referenced by f366d197db24cf611866a8d847b4022a6a46504e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:40:02 +01:00
Bastien Montagne removed this from the Pipeline, Assets & IO project 2023-02-10 12:49:18 +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
5 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#100737
No description provided.