Blender 2.70 crashes upon renaming node's socket #40282

Closed
opened 2014-05-20 18:13:17 +02:00 by Mi Los · 12 comments

System Information
Operating system and graphics card

Blender Version
2.70

Short description of error
As soon as I rename "Mix Shader" node's input socket name from "Shader" to anything else via script Blender crashes like 1 second after successful renaming (so yea, it is clearly very easily possible jut like here that was actually my inspiration http://www.blenderdiplom.com/en/tutorials/all-tutorials/551-using-python-to-quickly-setup-nodes.html)

Exact steps for others to reproduce the error
. My code is:

mat = bpy.data.materials["m1"].node_tree.nodes
for i in mat:
    if i.type == "MIX_SHADER":
        i.inputs[1].name = "A"
        i.inputs[2].name = "B"

**System Information** Operating system and graphics card **Blender Version** 2.70 **Short description of error** As soon as I rename "Mix Shader" node's input socket name from "Shader" to anything else via script Blender crashes like 1 second after successful renaming (so yea, it is clearly very easily possible jut like here that was actually my inspiration http://www.blenderdiplom.com/en/tutorials/all-tutorials/551-using-python-to-quickly-setup-nodes.html) **Exact steps for others to reproduce the error** . My code is: # ``` mat = bpy.data.materials["m1"].node_tree.nodes for i in mat: if i.type == "MIX_SHADER": i.inputs[1].name = "A" i.inputs[2].name = "B" ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @bublible

Added subscriber: @bublible

Added subscriber: @mont29

Added subscriber: @mont29

Please always provide a simple .blend file allowing to easily reproduce the issue.

Also, you can use the 'code' formatting (<> button in phab editor header), especially useful with languages like python, where formatting is crucial! ;)

Please always provide a simple .blend file allowing to easily reproduce the issue. Also, you can use the 'code' formatting (<> button in phab editor header), especially useful with languages like python, where formatting is crucial! ;)

Also, you mention 2.70, is it the official release? if so, can you check with a recent build from our buildbot?

Also, you mention 2.70, is it the official release? if so, can you check with a recent build from [our buildbot](http://builder.blender.org/download)?
Member

Added subscribers: @LukasTonne, @ThomasDinges, @brecht, @GregZaal

Added subscribers: @LukasTonne, @ThomasDinges, @brecht, @GregZaal
Member

@LukasTonne I don't know if it was ever meant to be possible, but I think it'd be quite useful to be able to rename sockets from the properties region.

rename_sockets.PNG

Would hopefully just involve changing the labels to properties (and fixing this bug of course)

I can confirm it crashes cycles shader nodes, but not in the compositor nor Blender Render material nodes. Perhaps this should be assigned to @brecht or @ThomasDinges ?

@LukasTonne I don't know if it was ever meant to be possible, but I think it'd be quite useful to be able to rename sockets from the properties region. ![rename_sockets.PNG](https://archive.blender.org/developer/F89555/rename_sockets.PNG) Would hopefully just involve changing the labels to properties (and fixing this bug of course) I can confirm it crashes cycles shader nodes, but not in the compositor nor Blender Render material nodes. Perhaps this should be assigned to @brecht or @ThomasDinges ?
Member

Well, cycles relies very much on socket names to map values and connections to the internal shaders. If you rename a socket, cycles won't be able to find a matching socket for a shader parameter, which should never happen.

This is tricky to solve: In principle, renaming sockets should not be allowed for the builtin C nodes (compositor, shader, texture nodes). However, it has to be allowed for pynodes, so making the name property read-only in general wouldn't work.

For the nodes i have defined an intermediate type "internal node", which redefines some core properties to be read-only. However, for node sockets this would become a messy limitation, due to the fact that the standard socket types can also be used for pynodes. So i'd rather not prohibit renaming in the API and rather make sure cycles handles such errors gracefully.

Renaming sockets would still not be possible (just disable the shader instead of crashing), but that's just the way cycles works.

Well, cycles relies very much on socket names to map values and connections to the internal shaders. If you rename a socket, cycles won't be able to find a matching socket for a shader parameter, which should never happen. This is tricky to solve: In principle, renaming sockets should not be allowed for the *builtin C nodes* (compositor, shader, texture nodes). However, it has to be allowed for pynodes, so making the name property read-only in general wouldn't work. For the nodes i have defined an intermediate type "internal node", which redefines some core properties to be read-only. However, for node sockets this would become a messy limitation, due to the fact that the standard socket types can also be used for pynodes. So i'd rather not prohibit renaming in the API and rather make sure cycles handles such errors gracefully. Renaming sockets would still not be possible (just disable the shader instead of crashing), but that's just the way cycles works.
Sergey Sharybin self-assigned this 2014-05-28 11:39:12 +02:00

Will look into it. Guess @brecht have too much on his desk already and wouldn't mind some help :)

Will look into it. Guess @brecht have too much on his desk already and wouldn't mind some help :)

This issue was referenced by 07fa016d97

This issue was referenced by 07fa016d9777a27b79f2003fb6d9db28db349e40
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit 07fa016d97.

Closed by commit 07fa016d97.
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
6 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#40282
No description provided.