Node wrangler preview error. #104865

Closed
opened 2023-09-05 03:45:25 +02:00 by Lester-James · 14 comments

System Information
Operating system: Windows-11
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99

Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-04 23:39, hash: 9f8d062de4e6
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Node Wrangler (3, 46)
Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer

Short description of error
Went to preview a node (CTRL+SHT+LMB) and it gave me this error.

Python: Traceback (most recent call last):
File "C:\Users\Lester\Downloads\blender-4.0.0-alpha+main.9f8d062de4e6-windows.amd64-release\blender-4.0.0-alpha+main.9f8d062de4e6-windows.amd64-release\4.0\scripts\addons\node_wrangler\operators.py", line 736, in invoke
output_types = [x.nodetype for x in
TypeError: 'NoneType' object is not iterable

Exact steps for others to reproduce the error
Not sure how to reproduce it. It wasn't an issue and then now it does it every time. Re-installed blender multiple times and deleted the User preferences files just to make sure.

EDIT: Looks like pretty much all of Node Wrangler isn't working for me. Not just the preview. Same Traceback error, but with different lines referenced of course.

**System Information** Operating system: Windows-11 Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99 **Blender Version** Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-04 23:39, hash: `9f8d062de4e6` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Node Wrangler (3, 46) Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer **Short description of error** Went to preview a node (CTRL+SHT+LMB) and it gave me this error. Python: Traceback (most recent call last): File "C:\Users\Lester\Downloads\blender-4.0.0-alpha+main.9f8d062de4e6-windows.amd64-release\blender-4.0.0-alpha+main.9f8d062de4e6-windows.amd64-release\4.0\scripts\addons\node_wrangler\operators.py", line 736, in invoke output_types = [x.nodetype for x in TypeError: 'NoneType' object is not iterable **Exact steps for others to reproduce the error** Not sure how to reproduce it. It wasn't an issue and then now it does it every time. Re-installed blender multiple times and deleted the User preferences files just to make sure. EDIT: Looks like pretty much all of Node Wrangler isn't working for me. Not just the preview. Same Traceback error, but with different lines referenced of course.
Lester-James added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-09-05 03:45:25 +02:00

I has this problem

select any node and press CTRL + T, then the error message will appear

Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\blender 4.0\4.0\scripts\addons\node_wrangler\operators.py", line 1823, in execute texture_types = [x.nodetype for x in TypeError: 'NoneType' object is not iterable

I has this problem select any node and press CTRL + T, then the error message will appear ` Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\blender 4.0\4.0\scripts\addons\node_wrangler\operators.py", line 1823, in execute texture_types = [x.nodetype for x in TypeError: 'NoneType' object is not iterable `

I can reproduce the problem by creating or adding a node group.

It looks like this was the last working version, just before node panels were added:
4.0.0 Alpha, ddbe073a6d3e, main, 2023-08-29

I can reproduce the problem by creating or adding a node group. It looks like this was the last working version, just before node panels were added: 4.0.0 Alpha, ddbe073a6d3e, main, 2023-08-29
Jesse Yurkovich added
Priority
High
Status
Confirmed
and removed
Priority
Normal
Status
Needs Triage
labels 2023-09-05 20:48:58 +02:00

The Blender-provided nodeitems_utils.py python module fails to get nodes with its node_categories_iter function. This impacts downstream addons like Node Wrangler.

CC @LukasTonne

The Blender-provided `nodeitems_utils.py` python module fails to get nodes with its `node_categories_iter` function. This impacts downstream addons like Node Wrangler. CC @LukasTonne

Interestingly, the panels integration commit (blender/blender@e071288ab2) is not to blame for this. This issue appeared afterward, somewhere between blender/blender@de09bdb510 (which does not have this issue) and blender/blender@5ad7d81549 (which does).

Skimming those commits in between, it is not immediately obvious to me exactly which introduced it.

Also of note, only shader nodes are affected. Geometry nodes does not have this issue, at least in my testing (add a cube node and Ctrl+Shift+LMB).

Interestingly, the panels integration commit (blender/blender@e071288ab290) is not to blame for this. This issue appeared afterward, somewhere between blender/blender@de09bdb510a0 (which does not have this issue) and blender/blender@5ad7d81549d0 (which does). Skimming those commits in between, it is not immediately obvious to me exactly which introduced it. Also of note, only shader nodes are affected. Geometry nodes does not have this issue, at least in my testing (add a cube node and Ctrl+Shift+LMB).

Also of note, only shader nodes are affected. Geometry nodes does not have this issue, at least in my testing (add a cube node and Ctrl+Shift+LMB).

It is also broken for geometry nodes. The shortcut for geometry nodes is Alt+Shift+LMB, as Ctrl+Shift+LMB is used for the Viewer node.

Here are steps to reproduce:

  1. Enable the node wrangler add-on
  2. Open the geometry nodes editor
  3. Add a cube node
  4. Press Ctrl+G to put the cube node in a group
  5. Exit the group then press Alt+Shift+LMB on the node group
> Also of note, only shader nodes are affected. Geometry nodes does not have this issue, at least in my testing (add a cube node and Ctrl+Shift+LMB). It is also broken for geometry nodes. The shortcut for geometry nodes is `Alt+Shift+LMB`, as `Ctrl+Shift+LMB` is used for the Viewer node. Here are steps to reproduce: 1. Enable the node wrangler add-on 2. Open the geometry nodes editor 3. Add a cube node 4. Press Ctrl+G to put the cube node in a group 5. Exit the group then press Alt+Shift+LMB on the node group
Member

This issue appeared afterward, somewhere between blender/blender@de09bdb510 (which does not have this issue) and blender/blender@5ad7d81549 (which does).

Bisecting points to blender/blender@15f5dfd45d.

> This issue appeared afterward, somewhere between blender/blender@de09bdb510a0 (which does not have this issue) and blender/blender@5ad7d81549d0 (which does). Bisecting points to blender/blender@15f5dfd45d.
Member

It is also broken for geometry nodes. The shortcut for geometry nodes is Alt+Shift+LMB, as Ctrl+Shift+LMB is used for the Viewer node.

Here are steps to reproduce:

  1. Enable the node wrangler add-on
  2. Open the geometry nodes editor
  3. Add a cube node
  4. Press Ctrl+G to put the cube node in a group
  5. Exit the group then press Alt+Shift+LMB on the node group

This case does come from the API change in blender/blender@e071288ab2, when outputs was replaced with interface.

> It is also broken for geometry nodes. The shortcut for geometry nodes is `Alt+Shift+LMB`, as `Ctrl+Shift+LMB` is used for the Viewer node. > > Here are steps to reproduce: > 1. Enable the node wrangler add-on > 2. Open the geometry nodes editor > 3. Add a cube node > 4. Press Ctrl+G to put the cube node in a group > 5. Exit the group then press Alt+Shift+LMB on the node group This case does come from the API change in blender/blender@e071288ab290, when `outputs` was replaced with `interface`.
Member

Bisecting points to blender/blender@15f5dfd45d.

@HooglyBoogly ^

> Bisecting points to blender/blender@15f5dfd45d. @HooglyBoogly ^

I have the same problem

I have the same problem

I have the same problem through the latest 4.0.0 alpha build (September 11, 02:37:40 fca8df9415b1), details on the BA topic here.

I have the same problem through the latest 4.0.0 alpha build (September 11, 02:37:40 fca8df9415b1), details on **[the BA topic here](https://blenderartists.org/t/node-wrangler-vs-4-0-0-alpha/1482222)**.
Member

There is a lot of technical debt in this area. The node "categories" are being replaced by nested menus, and assets are being integrated into these features. Node wrangler has neither of those concepts. But adding equivalents that use those concepts would probably be a good opportunity to make those features part of Blender itself (for example blender/blender#111438).

However, I'm guessing people won't want to live without some of these features in the meantime, so I propose we do the minimum to keep them working while still removing the old node categories and items from Blender.

How about replacing the use of node_categories_iter from node wrangler by copying necessary information of the old shader and compositor "node items" and "node categories" to be stored in node wrangler?

Does that sound okay @pioverfour @deadpin?

There is a lot of technical debt in this area. The node "categories" are being replaced by nested menus, and assets are being integrated into these features. Node wrangler has neither of those concepts. But adding equivalents that use those concepts would probably be a good opportunity to make those features part of Blender itself (for example blender/blender#111438). However, I'm guessing people won't want to live without some of these features in the meantime, so I propose we do the minimum to keep them working while still removing the old node categories and items from Blender. How about replacing the use of `node_categories_iter` from node wrangler by copying necessary information of the old shader and compositor "node items" and "node categories" to be stored in node wrangler? Does that sound okay @pioverfour @deadpin?

NW really wants to know just 2 categories -- the list of nodes classified as "outputs" and the list of nodes classified as "textures" as its behavior slightly changes if those are selected. So from that angle, yeah, having a manually curated list of just those 2 categories would suffice.

I suppose it could be possible to inspect the inputs/outputs of the nodes and derive these 2 categores too? e.g. If a node contains a "Color" output AND it contains a "float2" (UV) input then NW could treat it as a "texture" node. If it contains no outputs it's an "Output" node?

The python API would/should be removed with a release note as well?

NW really wants to know just 2 categories -- the list of nodes classified as "outputs" and the list of nodes classified as "textures" as its behavior slightly changes if those are selected. So from that angle, yeah, having a manually curated list of just those 2 categories would suffice. I suppose it could be possible to inspect the inputs/outputs of the nodes and derive these 2 categores too? e.g. If a node contains a "Color" output AND it contains a "float2" (UV) input then NW could treat it as a "texture" node. If it contains no outputs it's an "Output" node? The python API would/should be removed with a release note as well?
Member

If a node contains a "Color" output AND it contains a "float2" input then NW could treat it as a "texture" node. If it contains no outputs it's an "Output" node?

I think it would work fine to connect to the preview, but not so well for the texture setup.
Currently, if a node is not a texture but has a color input, it adds an image node as well as the coordinates setup to the first available input. With this change it would always look for the first Vector input and risk adding a coordinates setup where it wouldn’t make sense (say, to a BSDF Normal input).

Maybe we could instead look for something that every texture node is expected to have, such as its type starting with TEX_?

Come to think of it, I’m not sure it’s useful for the preview connection to begin with, because this (look for a visible output socket):

            output_types = [x.nodetype for x in
                            get_nodes_from_category('Output', context)]
            valid = False
            if active:
                if active.rna_type.identifier not in output_types:
                    for out in active.outputs:
                        if is_visible_socket(out):
                            valid = True
                            break

could simply become this:

            valid = False
            if active:
                for out in active.outputs:
                    if is_visible_socket(out):
                        valid = True
                        break

Why would you want to check that the node is not an output, when shading output nodes don’t have output sockets to begin with?

The python API would/should be removed with a release note as well?

+1

> If a node contains a "Color" output AND it contains a "float2" input then NW could treat it as a "texture" node. If it contains no outputs it's an "Output" node? I think it would work fine to connect to the preview, but not so well for the texture setup. Currently, if a node is not a texture but has a color input, it adds an image node as well as the coordinates setup to the first available input. With this change it would always look for the first Vector input and risk adding a coordinates setup where it wouldn’t make sense (say, to a BSDF Normal input). Maybe we could instead look for something that every texture node is expected to have, such as its `type` starting with `TEX_`? Come to think of it, I’m not sure it’s useful for the preview connection to begin with, because this (look for a visible output socket): ```python output_types = [x.nodetype for x in get_nodes_from_category('Output', context)] valid = False if active: if active.rna_type.identifier not in output_types: for out in active.outputs: if is_visible_socket(out): valid = True break ``` could simply become this: ```python valid = False if active: for out in active.outputs: if is_visible_socket(out): valid = True break ``` Why would you want to check that the node is not an output, when shading output nodes don’t have output sockets to begin with? > The python API would/should be removed with a release note as well? +1

Made a bit of progress addressing the above. Recreating the texture node category (+ eliminating the Output category entirely) was easy and that fixed the texture setup operator but the preview operator is more problematic. The addon wasn't updated at all to account for the "interface" socket changes... and there's quite a bit to rebuild for that.

Made a bit of progress addressing the above. Recreating the texture node category (+ eliminating the Output category entirely) was easy and that fixed the texture setup operator but the preview operator is more problematic. The addon wasn't updated at all to account for the "interface" socket changes... and there's quite a bit to rebuild for that.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-09-14 06:23:48 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
10 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-addons#104865
No description provided.