Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot create Groups if there are links going in or out of the new Group. #199

Open
josephbburg opened this issue Jan 10, 2022 · 5 comments

Comments

@josephbburg
Copy link

Describe the bug
Creating Node Groups doesn't work in Blender 3.0.0+

To Reproduce
Create a few Sorcar nodes and connect them together in a sensible way.
(I used a Bool node and an If-Else node and some other node.)
Try and create a group with some links going in or out.
Notice how the node groups cannot create links for sockets created by Sorcar,
but it seems socket classes from the bpy.types built-ins work just fine.
Try a few different kinds of links.

Expected behavior
The node group is created and linked.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Manjaro GNU/Linux
  • Blender Version 3.0
  • Sorcar Version master branch hash: 650cb65

Additional context
Terminal output:

Error: Python: Traceback (most recent call last):
  File "/home/joseph/.config/blender/3.0/scripts/addons/Sorcar-master/operators/ScGroupNodes.py", line 97, in execute
    node_tree.links.new(group_node.outputs[i], link.to_node.inputs[link.to_socket.name])
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1


Error: Python: Traceback (most recent call last):
  File "/home/joseph/.config/blender/3.0/scripts/addons/Sorc
[sorcar_bug.blend.zip](https://github.com/aachman98/Sorcar/files/7841231/sorcar_bug.blend.zip)
ar-master/operators/ScGroupNodes.py", line 94, in execute
    node_tree.links.new(link.from_node.outputs[link.from_socket.name], group_node.inputs[i])
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1


Error: Python: Traceback (most recent call last):
  File "/home/joseph/.config/blender/3.0/scripts/addons/Sorcar-master/operators/ScGroupNodes.py", line 94, in execute
    node_tree.links.new(link.from_node.outputs[link.from_socket.name], group_node.inputs[i])
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1

File Attached.

My guess is that the Blender devs added a well-meaning poll function to the builtin Group node... but it breaks Sorcar, and since my addon is using your wonderful Create Group operator as a template, mine is broken, too!
Anyhow I think the solution is to create your own custom NodeGroupIn or Out nodes, or find a way to overwrite the builtin nodes poll() method.

I don't use Sorcar myself, but since I am borrowing your code, I wanted to pass this on. I'll try to keep you updated with my own solution to the problem.

@josephbburg
Copy link
Author

sorcar_bug.blend.zip
Oops, here is the .blend file.

@josephbburg
Copy link
Author

Investigating the bug here

@josephbburg
Copy link
Author

Bug report:
https://developer.blender.org/T94827
I will look into making a workaround now

@josephbburg
Copy link
Author

Fixed on Blender's side by https://developer.blender.org/D13817

@josephbburg
Copy link
Author

The fix has been accepted.
https://developer.blender.org/rB85df7036f76b87102466079cc46c2bbfb9b17d9c
Please note that 2.93.7 and 3.0 will still have this bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant