Python code | Custom CompositorNode | enabled socket behaving differently #112086

Open
opened 2023-09-07 15:57:20 +02:00 by Samran Raafat · 10 comments

System Information
Operating system: macOS-12.6.6-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Pro 1.2

Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: c7fc78b81ecb
Worked: (newest version of Blender that worked as expected)

Short description of error

I am trying to hide input socket from CompositorNodeCustomGroup
I found set socket enabled = False , it will hide the socket from CompositorNodeCustomGroup
it working good if the socket type = NodeSocketColor
but not working if type not NodeSocketColor !

Exact steps for others to reproduce the error

open blend file
run Test.py
add TEST Node from CC in compositing

remove the Node
go to line 80 in Test.py
set E = False
run Test.py
add TEST Node from CC in compositing

**System Information** Operating system: macOS-12.6.6-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Pro 1.2 **Blender Version** Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: `c7fc78b81ecb` Worked: (newest version of Blender that worked as expected) **Short description of error** I am trying to hide input socket from CompositorNodeCustomGroup I found set socket enabled = False , it will hide the socket from CompositorNodeCustomGroup it working good if the socket type = NodeSocketColor but not working if type not NodeSocketColor ! **Exact steps for others to reproduce the error** open blend file run Test.py add TEST Node from CC in compositing remove the Node go to line 80 in Test.py set E = False run Test.py add TEST Node from CC in compositing
Samran Raafat added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-09-07 15:57:21 +02:00
Member

Can confirm.

However, using following command after creating the node does disable the socket:

bpy.context.scene.node_tree.nodes['TEST'].inputs[2].enabled=False

Unable to test 4.0 since the menu changed, the CC thing is nowhere to be found...

Can confirm. However, using following command after creating the node does disable the socket: `bpy.context.scene.node_tree.nodes['TEST'].inputs[2].enabled=False` Unable to test 4.0 since the menu changed, the `CC` thing is nowhere to be found...
YimingWu added
Module
Python API
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-09-08 05:09:38 +02:00

I think its already fixed, no?

I think its already fixed, no?
Author

However, using following command after creating the node does disable the socket:

bpy.context.scene.node_tree.nodes['TEST'].inputs[2].enabled=False

Unable to test 4.0 since the menu changed, the CC thing is nowhere to be found...

hi
I update the script for blender 4.0

in 4.0 the enabled not working at all from init()

working out by using
bpy.context.scene.node_tree.nodes['TEST'].inputs[0].enabled=False

in blend file
(No Need To add the node ) it will add by script to the composting

> However, using following command after creating the node does disable the socket: > > `bpy.context.scene.node_tree.nodes['TEST'].inputs[2].enabled=False` > > Unable to test 4.0 since the menu changed, the `CC` thing is nowhere to be found... hi I update the script for blender 4.0 in 4.0 the enabled not working at all from init() working out by using bpy.context.scene.node_tree.nodes['TEST'].inputs[0].enabled=False in blend file (No Need To add the node ) it will add by script to the composting
Member

To me it wont' work in init(), but it works just fine after the node is created 🤔

To me it wont' work in `init()`, but it works just fine after the node is created 🤔
Author

To me it wont' work in init(), but it works just fine after the node is created 🤔

yes exactly !!

> To me it wont' work in `init()`, but it works just fine after the node is created 🤔 yes exactly !!
Member

I'm having trouble reproducing the error with the file enable socket 4.blend. I get a node with no inputs and the following error message:

Python: Traceback (most recent call last):
  File "enable socket 4.blend/Test.py", line 52, in init
TypeError: NodeTreeInterface.new_socket(): error with keyword argument "in_out" -  expected a string enum, not set
Location: enable socket 4.blend/Test.py:163
I'm having trouble reproducing the error with the file `enable socket 4.blend`. I get a node with no inputs and the following error message: ```txt Python: Traceback (most recent call last): File "enable socket 4.blend/Test.py", line 52, in init TypeError: NodeTreeInterface.new_socket(): error with keyword argument "in_out" - expected a string enum, not set Location: enable socket 4.blend/Test.py:163 ```
Author

@zazizizou
new file for blender 4.0.2

@zazizizou new file for blender 4.0.2
Member

Thanks, I can now run the script, but I can't reproduce the problem. I didn't look closely into your script, but showing/hiding sockets from command line seems to work.

This is what I tried:
enable socket

Thanks, I can now run the script, but I can't reproduce the problem. I didn't look closely into your script, but showing/hiding sockets from command line seems to work. This is what I tried: ![enable socket](/attachments/87315add-c8fa-400e-a9b7-c270862a114c)
Author

@zazizizou
working in commend line but not working from init function

@zazizizou working in commend line but not working from init function
173 KiB
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-03-25 07:34:28 +01:00
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2024-03-25 07:35:43 +01:00
Iliya Katushenock added
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-03-25 07:36:24 +01:00
Author

@mod_moder
thanks
I am accidentally closed it

@mod_moder thanks I am accidentally closed it
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#112086
No description provided.