Geometry Nodes Input Attribute Toggle does not work after toggled via Python #110516

Closed
opened 2023-07-27 05:50:07 +02:00 by Y.T-LAW · 11 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.67

Blender Version
Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-17 12:50, hash: 8bda729ef4dc
Worked: unknown

Short description of error
Geometry Nodes Modifier Input Attribute Toggle button does not work after toggled via Python.

Exact steps for others to reproduce the error

  1. Open Blender with factory settings.
  2. Add a Geometry Nodes Modifier to "Cube" and Press New button in Properties Panel (Modifier Tab) to assign a node group.
  3. Open Geometry Node Editor and add a input from Group tab in N-panel
    image
  4. Open Text Editor and run:
import bpy
bpy.data.objects["Cube"].modifiers.active["Input_2_use_attribute"] = True
  1. Go to Properties Panel (Modifier Tab) to press the Input Attribute Toggle button and it does not work.
    image

Am I missing an update code or is this a bug?

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.67 **Blender Version** Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-17 12:50, hash: `8bda729ef4dc` Worked: unknown **Short description of error** Geometry Nodes Modifier Input Attribute Toggle button does not work after toggled via Python. **Exact steps for others to reproduce the error** 1. Open Blender with factory settings. 2. Add a Geometry Nodes Modifier to "Cube" and Press New button in Properties Panel (Modifier Tab) to assign a node group. 3. Open Geometry Node Editor and add a input from Group tab in N-panel ![image](/attachments/2dff91c2-7331-43f1-b29b-37e8d1f313b4) 4. Open Text Editor and run: ``` import bpy bpy.data.objects["Cube"].modifiers.active["Input_2_use_attribute"] = True ``` 5. Go to Properties Panel (Modifier Tab) to press the Input Attribute Toggle button and it does not work. ![image](/attachments/380cb82c-f24f-43ed-81ef-37013cf15472) Am I missing an update code or is this a bug?
Y.T-LAW added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-07-27 05:50:08 +02:00
Member

Looks like you need to use bpy.ops.object.geometry_nodes_input_attribute_toggle(prop_path="[\"Input_2_use_attribute\"]", modifier_name="GeometryNodes") .

Directly setting that property itself seems to have messed up its internal state or something and made it unable to toggle.

@JacquesLucke @HooglyBoogly maybe want to take a look?

Looks like you need to use ```bpy.ops.object.geometry_nodes_input_attribute_toggle(prop_path="[\"Input_2_use_attribute\"]", modifier_name="GeometryNodes")``` . Directly setting that property itself seems to have messed up its internal state or something and made it unable to toggle. @JacquesLucke @HooglyBoogly maybe want to take a look?
YimingWu added
Module
Python API
Status
Confirmed
Interest
Geometry Nodes
and removed
Status
Needs Triage
labels 2023-07-27 07:02:55 +02:00
Author

I got it thanks.

I got it thanks.
Member

@Y.T-LAW Does the problem resolve?

@JacquesLucke Should we mark this property as read only here? .active["Input_2_use_attribute"]

@Y.T-LAW Does the problem resolve? @JacquesLucke Should we mark this property as read only here? `.active["Input_2_use_attribute"]`
Author

Yes, it works fine, although bpy.ops is not very convenient to use. In my case, I need to temp_override the active object for them to work.

Yes, it works fine, although `bpy.ops` is not very convenient to use. In my case, I need to `temp_override` the active object for them to work.
Member

@Y.T-LAW yes, that's needed for calling operator with specific context. I'll close this issue for now.

Although I still suggest making that .active["Input_2_use_attribute"] property read-only in this case.

@Y.T-LAW yes, that's needed for calling operator with specific context. I'll close this issue for now. Although I still suggest making that `.active["Input_2_use_attribute"]` property read-only in this case.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-07-31 04:56:26 +02:00
Member

Actually I don't think using an operator should be necessary here.

Actually I don't think using an operator should be necessary here.
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2023-08-20 00:27:20 +02:00
Member

Thanks for the report. I can confirm. Looks like missing redraw/notifier.
Input field updates when I move mouse over it after python call.

Thanks for the report. I can confirm. Looks like missing redraw/notifier. Input field updates when I move mouse over it after python call.
Pratik Borhade added
Status
Confirmed
Interest
User Interface
and removed
Status
Needs Triage
labels 2023-08-22 08:58:19 +02:00
Member

Attribute toggle doesn't not work from UI after assigning boolean value to it. (but works when integer is assigned 🤷‍♂️ )

C.active_object.modifiers.active['Input_3_use_attribute'] = True
- - -
C.active_object.modifiers.active['Input_3_use_attribute'] = 1
`Attribute toggle` doesn't not work from UI after assigning boolean value to it. (but works when integer is assigned 🤷‍♂️ ) ``` C.active_object.modifiers.active['Input_3_use_attribute'] = True - - - C.active_object.modifiers.active['Input_3_use_attribute'] = 1 ```
@PratikPB2123 See: [Fix: geometry nodes modifier property not working after changing it in Python](https://projects.blender.org/blender/blender/pulls/109203)
Member

@mod_moder , thanks. So similar can be done for the attribute toggle (since it accepts int value)?

@mod_moder , thanks. So similar can be done for the attribute toggle (since it accepts int value)?

Not sure, but it sounds similar.

Not sure, but it sounds similar.
Hans Goudey changed title from GeometryNodes Modifier Input Attribute Toggle button does not work after toggled via Python. to Geometry Nodes Input Attribute Toggle does not work after toggled via Python 2023-08-23 15:00:01 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-08-24 13:37:22 +02:00
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2023-08-29 14:48:22 +02: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
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#110516
No description provided.