Texture node editor header is not in sync with edited texture when used with node materials #39868
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#39868
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
Win 7/64, AMD HD 6850
Blender Version
since 2.63
Short description of error
see title
Exact steps for others to reproduce the error
Open TxtNodeEditor.blend (including UI).
Description of the scene: The default cube/mesh has two materials:
Steps:
Select Texture.001 and Texture.002 alternatively: The Texture nodes editor correctly switches between the two node textures. This is labeld in the bottom left of the window. In addition, in the header, the combobox shows the currently selected texture. If you select the 3rd texture slot which is still empty, the header correctly shows no current texture.
So far, so good. Now, what does not work in opposite:
In the properties window, switch to the texture panel: It has two textures assigned. As you see at the top of the window: "Cube -> Material.002 -> Material.003", so we should be working with the texture slots of Material.003 now. Problem: This does not work identically to working with the texture slots of Material.001 as we did above regarding the header of the texture nodes window: It does not display and manage the texture of the currently selected texture slot of Material.003. Instead it is (probably) managing the textures of the superordinated Material.002. In any case the header is not in sync with the content of the correctly displayed nodes in the window.
Changed status to: 'Open'
Added subscriber: @willi-2
Pictures say more than words...:
The marked combo is what I'm talking about. I expect Texture.003 to be selected there like it is shown and labeled in the window, and selecting a different texture in that combo should assign it to the selected texture slot of Material.003
Added subscriber: @mont29
Added subscriber: @LukasTonne
This is because of the convoluted nesting of materials and textures in nodes vs. plain stacks ...
What is displayed in the header is the texture's material's "active_texture" property. In the case of a "classic" stack-based material this is the texture slot (which works fine). But for node materials it instead uses the active node and then if that is a texture node displays that node's texture reference ... So without having a texture node selected in the material nodes it won't show a texture in the header either, and will never use the stack ...
I'm not yet sure how to properly disentangle this mess, it's a creepy web of legacy design issues.
Added subscriber: @Sergey
Consider this a TODO then?
Have been looking into this and found a lot of bad stuff under the surface ...
The Material.active_texture property, which is displayed in the texture nodes header, has inconsistent behavior:
*#
get
checks if nodes are used, then looks up the active node and its texture pointer, otherwise returns the stack texture slot (correct)*#
set
checks if nodes are used, but if it cannot find an active texture node it will fall back to setting the active texture stack slot! This is not transparent and confusing to users.*#
editable
does the same asset
: if nodes are used and no active texture node is found, it will return true anyway, assuming a texture slot will be set instead. This means that the tex node header button does not get grayed out, which would at least indicate there is something missing (no active tex node).What's more: The function for looking up the active texture node (
nodeGetActiveID
) only returns a node if the texture is actually non-NULL (https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/node.c$2352). What this means is that active_texture can never work properly for setting a texture node's texture pointer for the first time!It all goes totally nuts if you consider nesting of materials inside material nodes, mixing stack- and node-based materials/textures etc. I don't even dare think about what impossible cases could come up here ...
@LukasTonne, do you need some help here?
@Sergey i was going to unify the get/set/editable behavior, such that if use_nodes is true, it would never even look at the stack slots (so that a material is either nodes or stack, not some weird mixture). However this could easily break some cases, this stuff is used in so many places.
And then i found out about the
nodeGetActiveID
and realized this couldn't even work the way i expected it to ...So atm i'm thinking "never ever touch this, it will break more than it could fix". If you have a clear idea of how this should work, be my guest and give it a shot.
Changed status from 'Open' to: 'Archived'
Closing as archived, this area of the code is too encrusted with old hacks and fragile use cases to justify breaking it for a non-showstopper ...