UILayout.template_node_view() doesn't render UI properly #99569

Open
opened 2022-07-09 14:39:45 +02:00 by Aaron Powell · 14 comments

System Information
Operating system: Affected on Windows 10 and macOS (Windows 11 not tested, works on Linux)
Graphics card: GTX 1080 x2

Blender Version
Broken: 2.93 and above
Worked: 2.92

Short description of error
When using layout.template_node_view() on a custom node network the inputs don't render properly in the UI. This happens on Windows and macOS but not on Linux. It works in 2.92 but not 2.93 and above.

UI in 2.92
image.png

UI in 2.93
image.png

This is harder to reproduce on your own, but here are some links to the specific lines in my code that are causing the issue to help give you some context. This code is VERY similar to the internal Python code for EEVEE/Cycles, so I'm not sure why it's working for those renderers and not for mine.

This is a customized panel_node_draw() function, where template_node_view() is actually called.
b11f577103/ui/utils.py (L35)

This is the panel UI code where panel_node_draw() is called.
b11f577103/ui/material.py (L101)

Exact steps for others to reproduce the error

  • Open attached .blend file
  • Run script
  • Note the panel Node UI Bug Panel in {nav Properties > Render panel}
    image.png
    uilayout_bug_example.blend

**System Information** Operating system: Affected on Windows 10 and macOS (Windows 11 not tested, works on Linux) Graphics card: GTX 1080 x2 **Blender Version** Broken: 2.93 and above Worked: 2.92 **Short description of error** When using `layout.template_node_view()` on a custom node network the inputs don't render properly in the UI. This happens on Windows and macOS but not on Linux. It works in 2.92 but not 2.93 and above. UI in 2.92 ![image.png](https://archive.blender.org/developer/F13279176/image.png) UI in 2.93 ![image.png](https://archive.blender.org/developer/F13279157/image.png) This is harder to reproduce on your own, but here are some links to the specific lines in my code that are causing the issue to help give you some context. This code is VERY similar to the internal Python code for EEVEE/Cycles, so I'm not sure why it's working for those renderers and not for mine. This is a customized `panel_node_draw()` function, where `template_node_view()` is actually called. https://github.com/lunadigital/btoa/blob/b11f577103f9e841d25de96bf865c31f771bd00c/ui/utils.py#L35 This is the panel UI code where `panel_node_draw()` is called. https://github.com/lunadigital/btoa/blob/b11f577103f9e841d25de96bf865c31f771bd00c/ui/material.py#L101 **Exact steps for others to reproduce the error** - Open attached .blend file - Run script - Note the panel `Node UI Bug Panel` in {nav Properties > Render panel} ![image.png](https://archive.blender.org/developer/F13286105/image.png) [uilayout_bug_example.blend](https://archive.blender.org/developer/F13286032/uilayout_bug_example.blend) ---
Author

Added subscriber: @lunadigital

Added subscriber: @lunadigital

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Thanks for the report, but in order for us to forward the report to the developers, we require clear steps to reproduce the problem and, in this case, a simple script (containing only the necessary lines).

While this is a real issue, the real cause of it doesn't seem so clear, and due to the large flow of reports, we require the bug reporter to narrow down the problem.

So can you provide the steps and a small code snippet showing the problem?

A guideline for making a good bug report can be found at https://wiki.blender.org/wiki/Process/Bug_Reports

Thanks for the report, but in order for us to forward the report to the developers, we require clear steps to reproduce the problem and, in this case, a simple script (containing only the necessary lines). While this is a real issue, the real cause of it doesn't seem so clear, and due to the large flow of reports, we require the bug reporter to narrow down the problem. So can you provide the steps and a small code snippet showing the problem? A guideline for making a good bug report can be found at https://wiki.blender.org/wiki/Process/Bug_Reports
Author

I managed to take the "Custom Nodes" example that comes with Blender and made an example that reproduces what I'm seeing. If you run the script in this blend file, you'll see a custom node graph and a panel in the Properties > Render panel called "Node UI Bug Panel". On Linux, it displays as expected, with the socket values to the right of the socket icon. On Windows and macOS, it remains blank like the images I shared above.uilayout_bug_example.blend

I managed to take the "Custom Nodes" example that comes with Blender and made an example that reproduces what I'm seeing. If you run the script in this blend file, you'll see a custom node graph and a panel in the Properties > Render panel called "Node UI Bug Panel". On Linux, it displays as expected, with the socket values to the right of the socket icon. On Windows and macOS, it remains blank like the images I shared above.[uilayout_bug_example.blend](https://archive.blender.org/developer/F13286032/uilayout_bug_example.blend)
Author

For what it's worth, it seems like it only happens on custom sockets. Internal Blender socket types seem to work okay.

For what it's worth, it seems like it only happens on custom sockets. Internal Blender socket types seem to work okay.

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

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

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

Thanks for simplifying. I can confirm the problem. But I can't replicate it on 2.93.
It looks like the problem was introduced sometime between 4f387e66ac, 35124acd19 in Blender 3.1 and backported to 3.0

Thanks for simplifying. I can confirm the problem. But I can't replicate it on 2.93. It looks like the problem was introduced sometime between 4f387e66ac, 35124acd19 in Blender 3.1 and backported to 3.0
Author

It's interesting you can't reproduce it on 2.93...I wonder what's going on there.

In any case, I'm glad we can start tracking it now - let me know if I can provide anything else!

It's interesting you can't reproduce it on 2.93...I wonder what's going on there. In any case, I'm glad we can start tracking it now - let me know if I can provide anything else!
Author

I don't know if this is related, but I also noticed the custom node sockets appear to have a black stroke outline in Linux, but a gray outline in Windows. At first I thought it was just how custom sockets rendered in general but now I'm wondering if this is related to the rendering issues above.

I don't know if this is related, but I also noticed the custom node sockets appear to have a black stroke outline in Linux, but a gray outline in Windows. At first I thought it was just how custom sockets rendered in general but now I'm wondering if this is related to the rendering issues above.
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:52 +01:00
Author

This is still an issue in 3.6. To be honest, custom shader graphs now feel like a second class experience because of it, which is frustrating. What can I do to push this forward? @mano-wii

This is still an issue in 3.6. To be honest, custom shader graphs now feel like a second class experience because of it, which is frustrating. What can I do to push this forward? @mano-wii
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-07-10 18:22:11 +02:00

It was fixed in 4.0 (main).
For 3.6 the fix was put on the list To Be Backported.
Blender LTS: Maintenance Task 3.6

It was fixed in 4.0 (main). For 3.6 the fix was put on the list To Be Backported. [Blender LTS: Maintenance Task 3.6](https://projects.blender.org/blender/blender/issues/109399)
Author

Sorry to resurrect a closed report, but I'm just getting around to digging into this deeper. I'm realizing that the socket draw call should probably pass an empty string for the text argument, not the socket name. Otherwise you get a duplicate label in the UI. Unless there's a way we can avoid this through Python. Thoughts?

Commit that fixes the original issue: bc486302fe

Properties panel with double label:
image

Sorry to resurrect a closed report, but I'm just getting around to digging into this deeper. I'm realizing that the socket draw call should probably pass an empty string for the `text` argument, not the socket name. Otherwise you get a duplicate label in the UI. Unless there's a way we can avoid this through Python. Thoughts? Commit that fixes the original issue: https://projects.blender.org/lichtwerk/blender/commit/bc486302fe87ff010594bf56e3084b4a99279116 Properties panel with double label: ![image](/attachments/bb8fface-bfce-4872-bd34-41fe4b73ccf2)
Blender Bot added
Status
Confirmed
and removed
Status
Resolved
labels 2024-03-12 19:06:37 +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
No Assignees
3 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#99569
No description provided.