Crash after initialization custom node group tree #76591

Closed
opened 2020-05-09 19:59:52 +02:00 by Sergey · 20 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.34

Blender Version
Broken: version: 2.83 (sub 13), branch: master, commit date: 2020-04-21 17:59, hash: 13e3a1c532

Short description of error
I'm experimenting with creating custom node tree groups in custom node tree and I faced with this crash.

Exact steps for others to reproduce the error

  • run first script (left in file)
  • run second script (right)
  • open custom node tree editor
  • select Tree
  • crash
    untitled5.blend
**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.34 **Blender Version** Broken: version: 2.83 (sub 13), branch: master, commit date: 2020-04-21 17:59, hash: `13e3a1c532` **Short description of error** I'm experimenting with creating custom node tree groups in custom node tree and I faced with this crash. **Exact steps for others to reproduce the error** - run first script (left in file) - run second script (right) - open `custom node tree` editor - select `Tree` - crash [untitled5.blend](https://archive.blender.org/developer/F8523462/untitled5.blend)
Author

Added subscriber: @randum

Added subscriber: @randum
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

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

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

BLI_assert failed: source/blender/blenloader/intern/writefile.c:1008, write_node_socket_default_value(), at '0'
get this while running script 2, so it seems you're doing somehtng wrong, which later gives a problem ?
file on diffusion

`BLI_assert failed: source/blender/blenloader/intern/writefile.c:1008, write_node_socket_default_value(), at '0'` get this while running script 2, so it seems you're doing somehtng wrong, which later gives a problem ? [file on diffusion](https://developer.blender.org/diffusion/B/browse/master/source/blender/blenloader/intern/writefile.c$970)
Author

I'm definitely doing something wrong. There is no any guide about how to create custom node group in custom tree. So I'm experimenting and I'm trying find the way.

What information do you need?

I'm definitely doing something wrong. There is no any guide about how to create custom node group in custom tree. So I'm experimenting and I'm trying find the way. What information do you need?
Member

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Although there is likely to be an error in the script, it should not crash but rather display an error message.
I think it is a bug, but I will wait for a second opinion.

Although there is likely to be an error in the script, it should not crash but rather display an error message. I think it is a bug, but I will wait for a second opinion.
Member

Added subscriber: @Calra

Added subscriber: @Calra
Member

@randum Yes it crashes, I can't fully point out why, imo you are not in the right context, but here is a short description of what you might be doing "wrong".

  • created 2 custom editors, apart from Custom node tree, there is Test Group Tree just below the custom one.
  • trying to link nodes from 2 different editors, one is Tree from Custom node tree and the other one is TreeGroup from the other panel Test Group tree does it work with normal nodes ?, I am not that proficient.

And it won't crash if you are in Test Group tree and have selected Tree Group and the input socket is created in the right under Nodes section

@randum Yes it crashes, I can't fully point out why, imo you are not in the right context, but here is a short description of what you might be doing "wrong". * created 2 custom editors, apart from `Custom node tree`, there is `Test Group Tree` just below the custom one. * trying to link nodes from 2 different editors, one is `Tree` from `Custom node tree` and the other one is `TreeGroup` from the other panel `Test Group tree` does it work with normal nodes ?, I am not that proficient. And it **won't** crash if you are in `Test Group tree` and have selected `Tree Group` and the input socket is created in the right under `Nodes` section
Author

@Calra What I'm actually doing is reproduce group nodes in coustome tree editor. For this I have use two different node trees. One normal for tree editor and another for group node. Also I'm using special node which is dedicated for creating node groups. It has node_tree attribute for nested tree unlike of other normal nodes. Also I'm adding special sockets for nested node tree. Nested node tree can have sockets. So:

  • I can change pool method for group tree so it will always return False and it will crash anyway.
  • I'm not linking any nodes at all.

It looks like that the problem is in NodeSocketInterface. Everything work until i'm adding the socket ot nested node tree what is cause the crash.

@Calra What I'm actually doing is reproduce group nodes in coustome tree editor. For this I have use two different node trees. One normal for tree editor and another for group node. Also I'm using special node which is dedicated for creating node groups. It has `node_tree` attribute for nested tree unlike of other normal nodes. Also I'm adding special sockets for nested node tree. Nested node tree can have sockets. So: - I can change `pool` method for group tree so it will always return False and it will crash anyway. - I'm not linking any nodes at all. It looks like that the problem is in `NodeSocketInterface`. Everything work until i'm adding the socket ot nested node tree what is cause the crash.

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

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

Added subscribers: @ideasman42, @JacquesLucke

Added subscribers: @ideasman42, @JacquesLucke
Member

This might solve one of the issues:

diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 3237f33835e..f3cc40215f3 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2306,6 +2306,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain),
 
   /* setup dummy socket & socket type to store static properties in */
   memset(&dummyst, 0, sizeof(bNodeSocketType));
+  dummyst.type = -1;
 
   memset(&dummysock, 0, sizeof(bNodeSocket));
   dummysock.typeinfo = &dummyst;
@@ -2629,6 +2630,7 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain),
 
   /* setup dummy socket & socket type to store static properties in */
   memset(&dummyst, 0, sizeof(bNodeSocketType));
+  dummyst.type = -1;
 
   memset(&dummysock, 0, sizeof(bNodeSocket));
   dummysock.typeinfo = &dummyst;

But I'm not even sure if we support what you want to do at all.
@ideasman42, in the current implementation, should custom node tree types be able to use node groups the same way internal tree types use them? If no, then this report is probably not a bug, but more a feature request.

@randum, do you know of any addon that adds new a new node tree type that uses normal node groups?

This might solve one of the issues: ``` diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 3237f33835e..f3cc40215f3 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2306,6 +2306,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain), /* setup dummy socket & socket type to store static properties in */ memset(&dummyst, 0, sizeof(bNodeSocketType)); + dummyst.type = -1; memset(&dummysock, 0, sizeof(bNodeSocket)); dummysock.typeinfo = &dummyst; @@ -2629,6 +2630,7 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain), /* setup dummy socket & socket type to store static properties in */ memset(&dummyst, 0, sizeof(bNodeSocketType)); + dummyst.type = -1; memset(&dummysock, 0, sizeof(bNodeSocket)); dummysock.typeinfo = &dummyst; ``` But I'm not even sure if we support what you want to do at all. @ideasman42, in the current implementation, should custom node tree types be able to use node groups the same way internal tree types use them? If no, then this report is probably not a bug, but more a feature request. @randum, do you know of any addon that adds new a new node tree type that uses normal node groups?
Author

Yes, node groups are used in Sorcar since june. There is interesting discussion here:

https://github.com/nortikin/sverchok/issues/3319

It looks like that all what should be done is to create MyGroupNode(NodeCustomGroup). Group input and group output nodes can be created from standard Blender classes in nested tree. Creating new sockets in MyGroupNode and in socket interface panel after connecting to input and output group nodes is happening automatically.

So probably I should not been trying to create custom input group node and custom node socket interface as I did in the example.

Yes, `node groups` are used in Sorcar since june. There is interesting discussion here: https://github.com/nortikin/sverchok/issues/3319 It looks like that all what should be done is to create `MyGroupNode(NodeCustomGroup)`. `Group input` and `group output` nodes can be created from standard Blender classes in nested tree. Creating new sockets in `MyGroupNode` and in socket interface panel after connecting to input and output group nodes is happening automatically. So probably I should not been trying to create custom `input group` node and custom `node socket interface` as I did in the example.
Member

In #76591#1015567, @randum wrote:
Yes, node groups are used in Sorcar since june. There is interesting discussion here:

https://github.com/nortikin/sverchok/issues/3319

It looks like that all what should be done is to create MyGroupNode(NodeCustomGroup). Group input and group output nodes can be created from standard Blender classes in nested tree. Creating new sockets in MyGroupNode and in socket interface panel after connecting to input and output group nodes is happening automatically.

So probably I should not been trying to create custom input group node and custom node socket interface as I did in the example.

When you follow their example, can you get it working? If yes, it would be nice if you could simplify the example as much as possible. It might be a good idea to add this as an example to the api docs.

> In #76591#1015567, @randum wrote: > Yes, `node groups` are used in Sorcar since june. There is interesting discussion here: > > https://github.com/nortikin/sverchok/issues/3319 > > It looks like that all what should be done is to create `MyGroupNode(NodeCustomGroup)`. `Group input` and `group output` nodes can be created from standard Blender classes in nested tree. Creating new sockets in `MyGroupNode` and in socket interface panel after connecting to input and output group nodes is happening automatically. > > So probably I should not been trying to create custom `input group` node and custom `node socket interface` as I did in the example. When you follow their example, can you get it working? If yes, it would be nice if you could simplify the example as much as possible. It might be a good idea to add this as an example to the api docs.
Author

Yes it looks working. I will try to make an example.

Yes it looks working. I will try to make an example.
Author

I have made an example. It creates new tree editor with available group node. The node has UI for creating node groups (sub trees). There is some solution in the script which is not best I guess. I left comments there.

2020-09-15_21-39-28.png

node_group.py

I have made an example. It creates new tree editor with available group node. The node has UI for creating node groups (sub trees). There is some solution in the script which is not best I guess. I left comments there. ![2020-09-15_21-39-28.png](https://archive.blender.org/developer/F8885261/2020-09-15_21-39-28.png) [node_group.py](https://archive.blender.org/developer/F8885258/node_group.py)
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2020-09-16 10:02:22 +02:00
Member

Thanks, since this is working now, I'll close this report. I created blender/documentation#80827, so that I don't forget about this topic.

Thanks, since this is working now, I'll close this report. I created blender/documentation#80827, so that I don't forget about this topic.
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
5 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#76591
No description provided.