Material ID instead of Materials in use #66709

Closed
opened 2019-07-11 15:55:19 +02:00 by Emerson Rosa · 10 comments

System Information
Operating system: Windows 10
Graphics card: GTX 1070

Blender Version
2.80 Beta, 700346d377, 2019-03-30 19:37

Short description
Missing "material slots" or "material id number" inside Blender.

Full explanation
I'll give an example to explain the bug/issue:

I have a geometry inside Unreal Engine with 10 material slots/ids:

  • 9 slots are using the same material (Ex.: Material01)
  • the remaining slot is using a different one (Ex.: Material02)

Each of the 10 slots affect a different part of the mesh which I may have to modify. When I export that mesh and import in Blender, it only shows two materials (Material01 and Material02), so I can't access the different areas of the model (from the 10 different IDs/Slots). If I import that same FBX in 3DSMax, for instance, it will show all the slots regardless of the material being the same or not.

In short: It would be nice to have a way to access that "Polygon's Material ID" information inside Blender, not just the different materials applied to a given geometry.

I've attached a FBX as an example. It has 6 different material IDs but only 2 different materials applied. In Blender it only shows both the different materials.
SM_Cube_Example.fbx

**System Information** Operating system: Windows 10 Graphics card: GTX 1070 **Blender Version** 2.80 Beta, 700346d377dd, 2019-03-30 19:37 **Short description** Missing "material slots" or "material id number" inside Blender. **Full explanation** I'll give an example to explain the bug/issue: I have a geometry inside Unreal Engine with 10 material slots/ids: - 9 slots are using the same material (Ex.: Material01) - the remaining slot is using a different one (Ex.: Material02) Each of the 10 slots affect a different part of the mesh which I may have to modify. When I export that mesh and import in Blender, it only shows two materials (Material01 and Material02), so I can't access the different areas of the model (from the 10 different IDs/Slots). If I import that same FBX in 3DSMax, for instance, it will show all the slots regardless of the material being the same or not. In short: It would be nice to have a way to access that "Polygon's Material ID" information inside Blender, not just the different materials applied to a given geometry. **I've attached a FBX as an example. It has 6 different material IDs but only 2 different materials applied. In Blender it only shows both the different materials.** [SM_Cube_Example.fbx](https://archive.blender.org/developer/F7592843/SM_Cube_Example.fbx)
Author

Added subscriber: @e1412

Added subscriber: @e1412

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

This looks like a feature request (support material IDs rather than just materials) for the FBX importer; not sure though, could be considered a bug. At least re-test it with the latest build of Blender 2.80 from https://builder.blender.org/download/.

This looks like a feature request (support material IDs rather than just materials) for the FBX importer; not sure though, could be considered a bug. At least re-test it with the latest build of Blender 2.80 from https://builder.blender.org/download/.
Author

Hey, Sybren!

Just tested with the latest version and the issue is still there. It's not just for FBX files, I tested with OBJ as well and it seems that Blender "merges" equal materials into the same ID (exporting back to Unreal from Blender (for instance), all the different Slots are gone, and just the unique material IDs remain). Using the same example above, instead of keeping 10 material slots, it comes back from Blender with just 2.

It could be indeed considered a feature request, if you think it fits better that way! How can I do that?

Hey, Sybren! Just tested with the latest version and the issue is still there. It's not just for FBX files, I tested with OBJ as well and it seems that Blender "merges" equal materials into the same ID (exporting back to Unreal from Blender (for instance), all the different Slots are gone, and just the unique material IDs remain). Using the same example above, instead of keeping 10 material slots, it comes back from Blender with just 2. It could be indeed considered a feature request, if you think it fits better that way! How can I do that?

Added subscriber: @LucasLeme

Added subscriber: @LucasLeme

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sybren A. Stüvel self-assigned this 2019-07-16 15:42:02 +02:00

@e1412 You can discuss new features at https://blender.community/c/rightclickselect. There you can discuss ideas with others, and flesh them out so that they're in such a detailed state that a developer can pick them up and work on an implementation without having too many open ends to think about.

@e1412 You can discuss new features at https://blender.community/c/rightclickselect. There you can discuss ideas with others, and flesh them out so that they're in such a detailed state that a developer can pick them up and work on an implementation without having too many open ends to think about.
Member

Added subscriber: @jesterking

Added subscriber: @jesterking
Member

@e1412 Did you test importing the FBX and OBJ files back into Unreal? Do the material indices survive the roundtrip?

From the files you linked to in https://blender.community/c/rightclickselect/4ydbbc/#5d2ed47dd3ac8b621cede009 I have a hard time seeing it could actually work, especially for the OBJ format, but also really for FBX.

@e1412 Did you test importing the FBX and OBJ files back into Unreal? Do the material indices survive the roundtrip? From the files you linked to in https://blender.community/c/rightclickselect/4ydbbc/#5d2ed47dd3ac8b621cede009 I have a hard time seeing it could actually work, especially for the OBJ format, but also really for FBX.
Author

In #66709#738239, @jesterking wrote:
@e1412 Did you test importing the FBX and OBJ files back into Unreal? Do the material indices survive the roundtrip?

From the files you linked to in https://blender.community/c/rightclickselect/4ydbbc/#5d2ed47dd3ac8b621cede009 I have a hard time seeing it could actually work, especially for the OBJ format, but also really for FBX.

Hey, Nathan! It seems it doesn't survive the roundtrip indeed. Just exporting and reimporting to Unreal and the IDs are merged. But the thing is that 3DSMax is able to get that information from the FBX somehow. If only there was a way to export from Unreal in the ASCII format to check it :T

Unreal just exports in FBX, maybe the OBJ doesn't support that "instanced" information. As I mentioned on the other link, I think it makes sense for the FBX to use this section for the IDs:

LayerElementMaterial: 0 {
Version: 101
Name: ""
MappingInformationType: "ByPolygon"
ReferenceInformationType: "IndexToDirect"
Materials: *12 {
a: 0,0,0,0,1,1,2,2,3,3,4,4
}
}

That cube has 12 triangles, so each of those numbers (from 0 to 4 - probably refering to the 5 materials applied (I said 6 by mistaken)) may be linked to the order of polygons inside the FBX. I think that's the "Material ID" location inside the file.

> In #66709#738239, @jesterking wrote: > @e1412 Did you test importing the FBX and OBJ files back into Unreal? Do the material indices survive the roundtrip? > > From the files you linked to in https://blender.community/c/rightclickselect/4ydbbc/#5d2ed47dd3ac8b621cede009 I have a hard time seeing it could actually work, especially for the OBJ format, but also really for FBX. Hey, Nathan! It seems it doesn't survive the roundtrip indeed. Just exporting and reimporting to Unreal and the IDs are merged. But the thing is that 3DSMax is able to get that information from the FBX somehow. If only there was a way to export from Unreal in the ASCII format to check it :T Unreal just exports in FBX, maybe the OBJ doesn't support that "instanced" information. As I mentioned on the other link, I think it makes sense for the FBX to use this section for the IDs: LayerElementMaterial: 0 { Version: 101 Name: "" MappingInformationType: "ByPolygon" ReferenceInformationType: "IndexToDirect" Materials: *12 { a: 0,0,0,0,1,1,2,2,3,3,4,4 } } That cube has 12 triangles, so each of those numbers (from 0 to 4 - probably refering to the 5 materials applied (I said 6 by mistaken)) may be linked to the order of polygons inside the FBX. I think that's the "Material ID" location inside the file.
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
4 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#66709
No description provided.