Nodeitems_utils module deprecated in 3.4, with no obvious alternative

Hi, I’m the developer of the Node Pie addon, which takes the normal node add menu and converts it into a pie menu:

To do so, it relies on the nodeitems_utils module to get a list of all nodes in the current context:

all_nodes = list(nodeitems_utils.node_items_iter(context))

This works in 3.3, but in 3.4, it simply returns an empty list.

The reason I’m not making a bug report about this is because I seem to remember seeing something about this on blender.chat, that seemed to suggest that this is intentional, but I can’t seem to find that any more.

Is this a bug, or part of a bigger change in 3.4?

2 Likes

This should still work for shader nodes, but it won’t work for geometry nodes anymore since we’re not using the NodeItem system anymore internally. I’ll add a note about it to the release notes.

2 Likes

Ah, ok, do you know if there’s a way to get the same information for geometry nodes in 3.4?
While I understand that sometimes the system needs to be changed, this does break my add-on (and probably quite a few others) in a fairly major way…

It would be a shame to remove this functionality for good, given how useful it can be in many situations.

After looking into this again, you say in the release notes that :

And, respectfully, I think that for addon developers, this is a downgrade from the previous system. While I understand that this allows for more flexibility, and the easier addition of assets to the menu, it also removes useful functionality from the python API.

Currently, there is no easy way for my addon to work in 3.4, as I cannot find out what nodes are in what categories programmatically. The only option now is to hard code all the node items, which makes it far harder to write and maintain, as it will break with every new blender update (as well as removing the notion of backwards compatibility).
I could also attempt to parse the geo nodes menu definition file, but that’s a bad idea for obvious reasons.

I have no idea if it would work, but would it not be possible to patch this new system to interface with the old NodeItems system? Or potentially create a new system that would better fit it?
I know that that would be more work, but I believe that it’s worth it to avoid removing useful functionality from the API.

Thank you for your time anyway, you do an amazing job and it’s great to see so much time being put into improving Blender :slight_smile:

1 Like

Hi,

just noticed that with blender 3.4 builds on macOS 12.6, the NodePie Addon isn’t showing the Pie for Geometry nodes anymore, BUT all other nodes from blender !! And that’s odd !
Screen Shot 2022-10-24 at 1 12 19 pm
Screen Shot 2022-10-24 at 1 15 49 pm

In blender 3.3.1 on macOS 12.6 it is working…
Screen Shot 2022-10-24 at 1 22 18 pm

So blender 3.5 alpha is around the corner on the 26 Oct. 2022 and MacOS Ventura today on the 24 Oct.

Thanks in Advance :slight_smile:

1 Like

Ok, well just in case I’m not the only one encountering this issue, here’s a link to my hacky solution for this problem:

It parses the menu definition file that was added in 3.4, and constructs some fake NodeCategories and NodeItems that mirror the functionality of the original classes.
This is not a great solution, as it’s susceptible to break if that file is changed, but unfortunately it seems that this API will remain broken for 3.4 and as such, this is the best replacement I could come up with :frowning:

1 Like