Maniphest T93319

Geometry Nodes "Set Material Index" node may apply the wrong material.
Closed, Archived

Assigned To
None
Authored By
uzon_d (uzon_d)
Nov 23 2021, 8:05 AM
Tags
  • BF Blender
Subscribers
Jacques Lucke (JacquesLucke)
uzon_d (uzon_d)

Description

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.49

Blender Version
Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-11-20 16:50, hash: rB1b2ee3cf2077

Short description of error
Geometry Nodes "Set Material Index" node may apply the wrong material.

Affected with "Mesh Primitive" nodes when the object material links are not all different.

The "Mesh Primitive" nodes appiles :

  • "Join Geometry" with the Group Input Geometry
  • "Realize Instances"
  • "Set Material Index"

Exact steps for others to reproduce the error

  1. Create a new file.
  1. Set 5 different materials into a Cube object. Material colors are like : red, yellow, green, blue, pink.
  1. Change these material "links" not all different(red, yellow, yellow, blue, pink).
  1. Move to "Geometry Nodes" tab and create a new geometry. It's better changing the render mode to "Material Preview" or "Rendered" for visualize.
  1. Create the node setup like below.

  1. Try to change the "Materal Index" attribute of the below side of "Set Material Index" nodes.

When the index is 1, "yellow" is expected and it will be "yellow".
And when the index is 2, "yellow" is expected but it will be "blue".
And when the index is 3, "blue" is expected but it will be "pink".
And when the index is 4, "pink" is expected but it will be white that we didn't make.

If you change the material links back to (red, yellow, green, blue, pink), it will works as expected.

Blend file :

Event Timeline

uzon_d (uzon_d) created this task.Nov 23 2021, 8:05 AM
uzon_d (uzon_d) updated the task description.Nov 23 2021, 9:19 AM
uzon_d (uzon_d) updated the task description.Nov 23 2021, 9:25 AM
uzon_d (uzon_d) updated the task description.
uzon_d (uzon_d) updated the task description.Nov 23 2021, 9:29 AM
Jacques Lucke (JacquesLucke) added a subscriber: Jacques Lucke (JacquesLucke).Nov 23 2021, 12:46 PM

I recommend you just don't use Set Material Index node when you intend to join meshes afterwards. The Join Geometry and Realize Instances node is allowed to change material indices because that is required so that it can work correctly (otherwise it couldn't join meshes with different materials that use the same material indices). Better just use the Set Material node directly. Also see T93177#1255723.

Jacques Lucke (JacquesLucke) closed this task as Archived.Nov 23 2021, 12:48 PM

Thanks for the report, but this is working as intended currently.