Crash when creating Geometry Nodes group input with Python #100770

Closed
opened 2022-09-02 12:00:09 +02:00 by Fredrik · 16 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.72

Blender Version
Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: e05e1e3691
Worked: -

Short description of error
Blender crashes when attempting to create a new group input for geometry nodes as shown in the script.

Exact steps for others to reproduce the error

  • Add a geometry node modifier and node group (e.g. press New in the Geometry Node Editor)
  • Run the script below
import bpy
nodes = bpy.data.node_groups
node = nodes["Geometry Nodes"]
group = node.nodes["Group Output"]
group.inputs.new(name="Output",type="Color")
**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.72 **Blender Version** Broken: version: 3.2.0, branch: master, commit date: 2022-06-08 10:22, hash: `e05e1e3691` Worked: - **Short description of error** Blender crashes when attempting to create a new group input for geometry nodes as shown in the script. **Exact steps for others to reproduce the error** - Add a geometry node modifier and node group (e.g. press *New* in the Geometry Node Editor) - Run the script below ``` import bpy nodes = bpy.data.node_groups node = nodes["Geometry Nodes"] group = node.nodes["Group Output"] group.inputs.new(name="Output",type="Color") ```
Author

Added subscriber: @lahjon

Added subscriber: @lahjon

#101590 was marked as duplicate of this issue

#101590 was marked as duplicate of this issue
Fredrik changed title from Blender crashes when tunning this code to Blender crashes when running this code 2022-09-02 12:00:21 +02:00
Robert Guetzkow changed title from Blender crashes when running this code to Crash when creating Geometry Nodes group input with Python 2022-09-02 12:23:01 +02:00

Added subscriber: @rjg

Added subscriber: @rjg

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

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

This triggers BLI_assert(index < this->size()); in current master.

_BLI_assert_abort() Line 47	C
blender::Vector<blender::nodes::OutputFieldDependency,4,blender::GuardedAllocator>::operator[](__int64 index) Line 299	C++
blender::bke::node_field_inferencing::determine_group_output_states(const bNodeTree & tree, blender::nodes::FieldInferencingInterface & new_inferencing_interface, const blender::Span<blender::bke::node_field_inferencing::SocketFieldState> field_state_by_socket_id) Line 521	C++
blender::bke::node_field_inferencing::update_field_inferencing(const bNodeTree & tree) Line 577	C++
blender::bke::NodeTreeMainUpdater::update_tree(bNodeTree & ntree) Line 992	C++
blender::bke::NodeTreeMainUpdater::update_rooted(blender::Span<bNodeTree *> root_ntrees) Line 833	C++
BKE_ntree_update_main_tree(Main * bmain, bNodeTree * ntree, NodeTreeUpdateExtraParams * params) Line 1705	C++
ED_node_tree_propagate_change(const bContext * C, Main * bmain, bNodeTree * root_ntree) Line 455	C++
rna_Node_inputs_new(ID * id, bNode * node, Main * bmain, ReportList * reports, const unsigned char * type, const unsigned char * name, const unsigned char * identifier) Line 2460	C
NodeInputs_new_call(bContext * C, ReportList * reports, PointerRNA * _ptr, ParameterList * _parms) Line 57360	C
RNA_function_call(bContext * C, ReportList * reports, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 6149	C
pyrna_func_call(BPy_FunctionRNA * self, _object * args, _object * kw) Line 6406	C
[External Code]	
python_script_exec(bContext * C, const unsigned char * filepath, Text * text, ReportList * reports, const bool do_jump) Line 137	C
BPY_run_text(bContext * C, Text * text, ReportList * reports, const bool do_jump) Line 235	C
text_run_script(bContext * C, ReportList * reports) Line 775	C
text_run_script_exec(bContext * C, wmOperator * op) Line 814	C
wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1446	C++
wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1640	C++
WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, wmOperatorCallContext context, PointerRNA * properties, const wmEvent * event) Line 1689	C++
WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 1882	C++
ui_apply_but_funcs_after(bContext * C) Line 1022	C
ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 11440	C
wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 777	C++
wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3208	C++
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3325	C++
wm_event_do_handlers(bContext * C) Line 3916	C++
WM_main(bContext * C) Line 643	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 550	C
[External Code]
This triggers `BLI_assert(index < this->size());` in current master. ```lines=10 _BLI_assert_abort() Line 47 C blender::Vector<blender::nodes::OutputFieldDependency,4,blender::GuardedAllocator>::operator[](__int64 index) Line 299 C++ blender::bke::node_field_inferencing::determine_group_output_states(const bNodeTree & tree, blender::nodes::FieldInferencingInterface & new_inferencing_interface, const blender::Span<blender::bke::node_field_inferencing::SocketFieldState> field_state_by_socket_id) Line 521 C++ blender::bke::node_field_inferencing::update_field_inferencing(const bNodeTree & tree) Line 577 C++ blender::bke::NodeTreeMainUpdater::update_tree(bNodeTree & ntree) Line 992 C++ blender::bke::NodeTreeMainUpdater::update_rooted(blender::Span<bNodeTree *> root_ntrees) Line 833 C++ BKE_ntree_update_main_tree(Main * bmain, bNodeTree * ntree, NodeTreeUpdateExtraParams * params) Line 1705 C++ ED_node_tree_propagate_change(const bContext * C, Main * bmain, bNodeTree * root_ntree) Line 455 C++ rna_Node_inputs_new(ID * id, bNode * node, Main * bmain, ReportList * reports, const unsigned char * type, const unsigned char * name, const unsigned char * identifier) Line 2460 C NodeInputs_new_call(bContext * C, ReportList * reports, PointerRNA * _ptr, ParameterList * _parms) Line 57360 C RNA_function_call(bContext * C, ReportList * reports, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 6149 C pyrna_func_call(BPy_FunctionRNA * self, _object * args, _object * kw) Line 6406 C [External Code] python_script_exec(bContext * C, const unsigned char * filepath, Text * text, ReportList * reports, const bool do_jump) Line 137 C BPY_run_text(bContext * C, Text * text, ReportList * reports, const bool do_jump) Line 235 C text_run_script(bContext * C, ReportList * reports) Line 775 C text_run_script_exec(bContext * C, wmOperator * op) Line 814 C wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1446 C++ wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1640 C++ WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, wmOperatorCallContext context, PointerRNA * properties, const wmEvent * event) Line 1689 C++ WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 1882 C++ ui_apply_but_funcs_after(bContext * C) Line 1022 C ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 11440 C wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 777 C++ wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3208 C++ wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3325 C++ wm_event_do_handlers(bContext * C) Line 3916 C++ WM_main(bContext * C) Line 643 C main(int argc, const unsigned char * * UNUSED_argv_c) Line 550 C [External Code] ```

Added subscriber: @mod_moder

Added subscriber: @mod_moder

This comment was removed by @mod_moder

*This comment was removed by @mod_moder*
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Obviously we should avoid the crash here, but this is not high priority to me because this is not how new inputs/outputs to a node group should be added. Instead group inputs/outputs should be added directly on the node tree (node_tree.inputs.new). The corresponding sockets on the nodes should be created automatically.

Obviously we should avoid the crash here, but this is not high priority to me because this is not how new inputs/outputs to a node group should be added. Instead group inputs/outputs should be added directly on the node tree (`node_tree.inputs.new`). The corresponding sockets on the nodes should be created automatically.

Added subscribers: @Khemadeva, @mano-wii

Added subscribers: @Khemadeva, @mano-wii
Member

Has anyone been successful in creating the input socket by calling node_group.inputs.new?
I tried executing the following from console:

C.object.modifiers[0].node_group.inputs.new('VALUE', 'test')

This gives:

RuntimeError: Error: Unable to create socket

Has anyone been successful in creating the input socket by calling `node_group.inputs.new`? I tried executing the following from console: ``` C.object.modifiers[0].node_group.inputs.new('VALUE', 'test') ``` This gives: > RuntimeError: Error: Unable to create socket

Added subscriber: @spiraloid-3

Added subscriber: @spiraloid-3

found this by bumper car. the syntax changed.

NodeSocketInterfaceFloat is now NodeSocketFloat

bpy.context.selected_objects- [x].data.materials- [x].node_tree.nodes['Group'].inputs.new(type="NodeSocketFloat", name="muffin")

works.

found this by bumper car. the syntax changed. NodeSocketInterfaceFloat is now NodeSocketFloat bpy.context.selected_objects- [x].data.materials- [x].node_tree.nodes['Group'].inputs.new(type="NodeSocketFloat", name="muffin") works.

This issue was referenced by 52bd198153

This issue was referenced by 52bd198153ede3c7131df895bb08e4828aab1e9b
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:46 +01:00
Member

This crash has been fixed by 52bd198153. To add group inputs one now has to use node_tree.inputs.new.

This crash has been fixed by 52bd198153ede3c7131df895bb08e4828aab1e9b. To add group inputs one now has to use `node_tree.inputs.new`.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-02-28 14:27:20 +01:00
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
9 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#100770
No description provided.