functools.partial wrapped functions can't be used for bpy.props.XXXProperty update callbacks #70742
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#70742
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Win 10
Graphics card: 1070 8gb
Blender Version
Broken: current 2.81 master
Short description of error
I'm working on a in Python node graph and I need updates on every property change; this is proving more difficult than I would have guessed. I tried to implement a default update function that will optionally wrap the function specified at attribute declaration like so:
Attribute in class is declared like this:
On registration, it errors:
I'd think functools.partial objects should work, so I consider this a bug.
Thanks!
Added subscriber: @CharlesWardlaw
Added subscriber: @Blazej-Floch
Note:
In source/blender/python/intern/bpy_props.c:1657
PyFunction_Check could be PyCallable_Check. Not sure if the PyFunction_GET_CODE would still work, but I believe there are functions to do the same with callable objects.
It uses PyObject_CallObject to call so I guess that should work.
Added subscriber: @PixelTrader
Added subscribers: @ideasman42, @mont29
Changed status from 'Open' to: 'Archived'
There is no bug here, things are working as expected, with some limitations indeed. This is a complex mix of python and blender API, you cannot always use all the magic of pristine python with it.
Not saying that improvements here are not possible, but this tracker is for actual bugs, not feature requests. Although if someone wants to work on a patch, it would always be welcomed, of course.
Maybe check with @ideasman42 first though, not sure what would be the implications of such change as the one suggested by @Blazej-Floch (there are other considerations to take into account, like performances e.g.).
Agree this isn't an error in the code, however it's not a problem to support this.