c++ obj importer has wrong materials on objects #101685
Labels
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#101685
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.48
Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash:
b292cfe5a9
Worked: (newest version of Blender that worked as expected)
Short description of error
When importing my obj file with the new c++ importer it truncates the object names and they have the wrong materials.
Exact steps for others to reproduce the error
Import obj with the new importer (attached)jmcObjTest.zip
See the materials are not assigned correctly and names are cut short with numbers appended
The old (legacy) importer imports with the correct materials but also truncates the names
Added subscriber: @mmdanggg2
Added subscriber: @mod_moder
Thanks for the report. You didn't provide textures to compare this. The matermal itself and its color looks the same to me on:
version: 3.2.0 Alpha, branch: master, commit date: 2022-02-06 00:25, hash:
48fbf0baea
3.4.0 Alpha, branch: master, commit date: 2022-10-05 20:11, hash:
51bd26d0fa
version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash:
b292cfe5a9
However, I'm not sure how you can post game textures here...
I didn't want to put the textures in there as you say because they're minecraft © but they're not neccesary to see the issue. eg: the sticky piston has the fire material on the object:
and fire has no materials at all
Not the case with legacy importer:
Changed status from 'Needs Triage' to: 'Confirmed'
I can confirm that in 3.1 using the addon it worked differently. And the fact that the materials obviously belong to the wrong objects looks incorrect. But technical implementation limitations or something else are also possible. If so, this may be a known issue, but for now it looks like it's been confirmed.
Added subscriber: @scurest
Reduced test case for the missing materials
Cubes.zip
The problem is when
usemtl
comes beforeo
. The new importer seems to reset the current material when it findso
.I think the old importer is correct. From the OBJ spec about
usemtl
This issue was referenced by
e1e9c83889
This issue was referenced by
bd2f002e71
Changed status from 'Confirmed' to: 'Resolved'
I've fixed the wrong materials issue, will try to get the fix into 3.3.x soon.
The "new c++ importer it truncates the object names" is the same behaviour with the old python importer. The maximum name length for any object in Blender is 64 characters, but some of the names in your file are longer. Additionally, in Blender the names have to be unique; if there are any duplicate names then they will get numeric suffixes assigned to make them unique.