output_node.inputs.new() crash blender #103824

Open
opened 2023-01-12 11:40:30 +01:00 by bar · 18 comments

System Information
Operating system: Linux-5.15.0-57-generic-x86_64-with-glibc2.35 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.86.01

Blender Version
Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: 55485cb379
Worked: (newest version of Blender that worked as expected)

Short description of error
input = output_node.inputs.new(type = 'RGBA',name = 'bob_sfog',identifier='bob_sfog')
crash blender

Exact steps for others to reproduce the error
Open blender
execute line by line this srcript:

scene = bpy.data.scenes[0]
scene.use_nodes = True
output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile')
output_node.inputs.clear()
input = output_node.inputs.new(type = 'RGBA',name = 'bob_sfog',identifier='bob_sfog')
**System Information** Operating system: Linux-5.15.0-57-generic-x86_64-with-glibc2.35 64 Bits Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.86.01 **Blender Version** Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: `55485cb379` Worked: (newest version of Blender that worked as expected) **Short description of error** input = output_node.inputs.new(type = 'RGBA',name = 'bob_sfog',identifier='bob_sfog') crash blender **Exact steps for others to reproduce the error** Open blender execute line by line this srcript: ``` scene = bpy.data.scenes[0] scene.use_nodes = True output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile') output_node.inputs.clear() input = output_node.inputs.new(type = 'RGBA',name = 'bob_sfog',identifier='bob_sfog') ```
Author

Added subscriber: @barakooda

Added subscriber: @barakooda
bar changed title from output_node.inputs.new crash blender to output_node.inputs.new() crash blender 2023-01-12 11:42:24 +01:00

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

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

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Think adding inputs to such node is not really expected to work, the crash is a regression though, checking...

Think adding inputs to such node is not really expected to work, the crash is a regression though, checking...
Author

Not sure what you mean.
Output node support multi inputs either outputing to multi layer exr or multi files.
The ui support it.

How will you add inputs then in proper
Python way ? (Not realying on context)

Not sure what you mean. Output node support multi inputs either outputing to multi layer exr or multi files. The ui support it. How will you add inputs then in proper Python way ? (Not realying on context)

Added subscriber: @mod_moder

Added subscriber: @mod_moder

This issue was covered in another meeting report. You can't just create a socket. Node must have a method to do this, or you're just breaking it (#103150 (Runtime error on trying to create new input/output to node groups via python)).

This issue was covered in another meeting report. You can't just create a socket. Node must have a method to do this, or you're just breaking it (#103150 (Runtime error on trying to create new input/output to node groups via python)).
Member

Hard to bisect (since in a lite build it would still crash, even if it created the socket, shortly after), in an case, behavior changed between b9123b806f (good) and e2e4c1daaa (bad)

In any case, the "proper" way to do it would probably be to use these two (instead of node.inputs.new() / node.inputs.clear()):

bpy.ops.node.output_file_add_socket()
bpy.ops.node.output_file_remove_active_socket()
Hard to bisect (since in a lite build it would still crash, even if it created the socket, shortly after), in an case, behavior changed between b9123b806f (good) and e2e4c1daaa (bad) In any case, the "proper" way to do it would probably be to use these two (instead of `node.inputs.new()` / `node.inputs.clear()`): ``` bpy.ops.node.output_file_add_socket() bpy.ops.node.output_file_remove_active_socket() ```
Member

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

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

Hold on, you dont even need to use the operator, this is exposed in the API like this

import bpy

scene = bpy.data.scenes[0]
scene.use_nodes = True
output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile')

output_node.file_slots.clear()
output_node.file_slots.new("bob_sfog")

@barakooda : does this work for you?

Hold on, you dont even need to use the operator, this is exposed in the API like this ``` import bpy scene = bpy.data.scenes[0] scene.use_nodes = True output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile') output_node.file_slots.clear() output_node.file_slots.new("bob_sfog") ``` @barakooda : does this work for you?

I think crash needs to be investigated as a problem in itself.

I think crash needs to be investigated as a problem in itself.
Author

In #103824#1480326, @lichtwerk wrote:
Hold on, you dont even need to use the operator, this is exposed in the API like this

import bpy

scene = bpy.data.scenes[0]
scene.use_nodes = True
output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile')

output_node.file_slots.clear()
output_node.file_slots.new("bob_sfog")

@barakooda : does this work for you?

Hi philip,
Thank you for the update,

Sorry but i dont see how using the
"ops" is a proper pythonic way.

Programing wise, we prefer to use objects, manipulate data directly and not thru context manager.

For some cases the "ops" is source of all evil when you have a large code base.
The performance hit in some cases can be huge.

Please, hear our pain 💔,
Keep up the great work !

Thank you !

> In #103824#1480326, @lichtwerk wrote: > Hold on, you dont even need to use the operator, this is exposed in the API like this > > > ``` > import bpy > > scene = bpy.data.scenes[0] > scene.use_nodes = True > output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile') > > output_node.file_slots.clear() > output_node.file_slots.new("bob_sfog") > ``` > > @barakooda : does this work for you? Hi philip, Thank you for the update, Sorry but i dont see how using the "ops" is a proper pythonic way. Programing wise, we prefer to use objects, manipulate data directly and not thru context manager. For some cases the "ops" is source of all evil when you have a large code base. The performance hit in some cases can be huge. Please, hear our pain 💔, Keep up the great work ! Thank you !
Author

In #103824#1480326, @lichtwerk wrote:
Hold on, you dont even need to use the operator, this is exposed in the API like this

import bpy

scene = bpy.data.scenes[0]
scene.use_nodes = True
output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile')

output_node.file_slots.clear()
output_node.file_slots.new("bob_sfog")

@barakooda : does this work for you?

Will check next week.
Thank you.

> In #103824#1480326, @lichtwerk wrote: > Hold on, you dont even need to use the operator, this is exposed in the API like this > > > ``` > import bpy > > scene = bpy.data.scenes[0] > scene.use_nodes = True > output_node = scene.node_tree.nodes.new(type='CompositorNodeOutputFile') > > output_node.file_slots.clear() > output_node.file_slots.new("bob_sfog") > ``` > > @barakooda : does this work for you? Will check next week. Thank you.
Author

Thanks @lichtwerk
Its works.

Off topic of this thread.
for the multi channel EXR file case it will be good to add this inputs types:
UINT32 : 1 channel,2 channel,rgb,rgba
HALF-FLOAT :1 channel,2 channel,rgb,rgba
FLOAT : 1 channel,2 channel,rgb,rgba

Then,
I think we it will be good start to utilize the EXR container as it meant to be used.

will link this comment in relevant thread.

Thanks again.

Thanks @lichtwerk Its works. Off topic of this thread. for the multi channel EXR file case it will be good to add this inputs types: UINT32 : 1 channel,2 channel,rgb,rgba HALF-FLOAT :1 channel,2 channel,rgb,rgba FLOAT : 1 channel,2 channel,rgb,rgba Then, I think we it will be good start to utilize the EXR container as it meant to be used. will link this comment in relevant thread. Thanks again.
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:43:14 +01:00
Member

@lichtwerk , think this should not crash even though API is used incorrectly.
Should we track this crash report considering it's a regression?

@lichtwerk , think this should not crash even though API is used incorrectly. Should we track this crash report considering it's a regression?
Member

Should we track this crash report considering it's a regression?

I would think so, yes.

> Should we track this crash report considering it's a regression? I would think so, yes.
Philipp Oeser added
Status
Confirmed
and removed
Status
Needs Information from User
labels 2023-02-17 11:00:05 +01:00
Member

OK, seems #108728 is the way to go

OK, seems #108728 is the way to go
Member

since dynamic declarations seemed a bit more involved, I still made a PR that gets rid of the crash, see !118807

since dynamic declarations seemed a bit more involved, I still made a PR that gets rid of the crash, see !118807
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
4 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#103824
No description provided.