render_color_index API is lost after GN mdifier #108343

Open
opened 2023-05-27 07:42:14 +02:00 by Julien Duroure · 10 comments
Member

System Information
Operating system: Mint
Graphics card: Nvidia

Blender Version
Broken: 3.6 beta
Worked: ?

Short description of error
render_color_index API is lost after GN mdifier

Exact steps for others to reproduce the error
Open the attached file and run the script
When we get the evaluated mesh, you can see that for meshes without modifiers or with "simple" modifiers, we still can access the render_color_index value.
For GN modifier, this value is lost, return -1

It not happen is GN tree has only input -> output, but when you modify the tree, like in my example, value is -1

**System Information** Operating system: Mint Graphics card: Nvidia **Blender Version** Broken: 3.6 beta Worked: ? **Short description of error** render_color_index API is lost after GN mdifier **Exact steps for others to reproduce the error** Open the attached file and run the script When we get the evaluated mesh, you can see that for meshes without modifiers or with "simple" modifiers, we still can access the render_color_index value. For GN modifier, this value is lost, return -1 It not happen is GN tree has only input -> output, but when you modify the tree, like in my example, value is -1
Julien Duroure added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-05-27 07:42:15 +02:00

Interpolation single mesh value -> #106578
Active data layer -> #98366
Rendered data layers -> #106563

@Baardaap What do you think, can something be done here?
I'm not sure it's possible to interpolate discrete indices...

Interpolation single mesh value -> https://projects.blender.org/blender/blender/issues/106578 Active data layer -> https://projects.blender.org/blender/blender/issues/98366 Rendered data layers -> https://projects.blender.org/blender/blender/issues/106563 @Baardaap What do you think, can something be done here? I'm not sure it's possible to interpolate discrete indices...

At a first glance I guess this is the same problem as:
#106563

I don't have much time to really look into it this weekend though. Do you think it's the same?
edit: I now see that's one of the cases you listed.

I have an experimental patch:
#107066

However that patch is a bit in limbo as we're not sure it's the right way to go about it. I'll update the patch to current master tonight, so at least you can test it...

At a first glance I guess this is the same problem as: https://projects.blender.org/blender/blender/issues/106563 I don't have much time to really look into it this weekend though. Do you think it's the same? edit: I now see that's one of the cases you listed. I have an experimental patch: https://projects.blender.org/blender/blender/pulls/107066 However that patch is a bit in limbo as we're not sure it's the right way to go about it. I'll update the patch to current master tonight, so at least you can test it...

For me here is the problem:

  • Mesh with active color (Index 10, Name aabbbv).
  • And another mesh with active color (Index 4, Name hii).

How can we get the correct result of joining here? What might be expected?
Clearing this data seems to be the only way...

For me here is the problem: - Mesh with active color (Index 10, Name aabbbv). - And another mesh with active color (Index 4, Name hii). How can we get the correct result of joining here? What might be expected? Clearing this data seems to be the only way...
Author
Member

What might be expected?

My expectation was to get the index of the original mesh, whatever the value of other joined meshes.
But I know this is maybe not the right/good/best solution.

> What might be expected? My expectation was to get the index of the original mesh, whatever the value of other joined meshes. But I know this is maybe not the right/good/best solution.

Not everyone wants to just ignore all the actions in the nodes and get the data from the original mesh.
If we can input data from another object (Object Info node), it should also input data from another mesh. But joining such meshes...

Not everyone wants to just ignore all the actions in the nodes and get the data from the original mesh. If we can input data from another object (`Object Info` node), it should also input data from another mesh. But joining such meshes...

It should ate least be predictable what happens. To me 'pick the first one' would be ok. Combined with an explicit 'set active color index' node or something like that.

I think (considering the amount of bugreports) that just erasing / not copying anything is too bad of a regression. @mod_moder : most people needing this don't merge multiple meshes. And it not working there because you optionally could merge meshes is annoying an imo unnecessary. It's quite surprising to people that a mesh only has one vertex color defined and it isn't used.

Before v3.5 having a vertex color but not having an active one was an invalid state.

But maybe it would be a better plan to just always use the first vertex color available if the active one is -1... though that turns out not to be that much simpler code-wise than passing on the info like I did in my patch.

It should ate least be predictable what happens. To me 'pick the first one' would be ok. Combined with an explicit 'set active color index' node or something like that. I think (considering the amount of bugreports) that just erasing / not copying anything is too bad of a regression. @mod_moder : most people needing this *don't* merge multiple meshes. And it not working there because you *optionally could* merge meshes is annoying an imo unnecessary. It's quite surprising to people that a mesh *only has one vertex color defined* and it isn't used. Before v3.5 having a vertex color but not having an active one was an invalid state. But maybe it would be a better plan to just always use the first vertex color available if the active one is -1... though that turns out not to be that much simpler code-wise than passing on the info like I did in my patch.

I'll try to find the time to get my brain back into the space of that patch and see what's missing from it and how it could be done differently...

I'll try to find the time to get my brain back into the space of that patch and see what's missing from it and how it could be done differently...

Looking into this it is related, but a slightly different code path, which this patch does not solve.

the patch solves propagating the active/render color index across instancing, while this would need the same but across joining .

I'm a bit stuck on how to proceed. I have the feeling we first need a plan how to handle active/render color indices across GN I think it's a rather large regression that you just plain loose them, imo there are 3 ways to proceed (for both cases):

  1. Pick the first active index set on join/realize (this is what the patch does for realize)
  2. When there is a vertex color but no index is set, always consider the first vertex color the active/render one. (which is about as complicated to do as (1) while being slightly less flexible/predictable.
  3. Create a node to get/set the active color index so the user can handle it in the node tree.

I'd love @HooglyBoogly and @JacquesLucke 's opinion on this...

Looking into this it is related, but a slightly different code path, which this patch does not solve. the patch solves propagating the active/render color index across instancing, while this would need the same but across *joining* . I'm a bit stuck on how to proceed. I have the feeling we first need a plan how to handle active/render color indices across GN I think it's a rather large regression that you just plain loose them, imo there are 3 ways to proceed (for both cases): 1) Pick the first active index set on join/realize (this is what the patch does for realize) 2) When there is a vertex color but no index is set, always consider the first vertex color the active/render one. (which is about as complicated to do as (1) while being slightly less flexible/predictable. 3) Create a node to get/set the active color index so the user can handle it in the node tree. I'd love @HooglyBoogly and @JacquesLucke 's opinion on this...

I think this one fixes it now:

Need to do some more testing tomorrow.

#107066

I think this one fixes it now: Need to do some more testing tomorrow. https://projects.blender.org/blender/blender/pulls/107066
Member

AFAICS Active color attribute is only cleared when primitive nodes are included in node tree.
(i.e. cylinder in example file)

In any other case render_color_index has active color attribute after GN applied.

Check with different node tree in uploaded file

AFAICS Active color attribute is only cleared when primitive nodes are included in node tree. (i.e. cylinder in example file) In any other case `render_color_index` has active color attribute after GN applied. Check with different node tree in uploaded 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#108343
No description provided.