Fix #111169: PointerProperty ignores poll function when setting value #111189
Closed
Philipp Oeser
wants to merge 1 commits from
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
lichtwerk/blender:111169
into main
pull from: lichtwerk/blender:111169
merge into: blender:main
blender:main
blender:universal-scene-description
blender:brush-assets-project
blender:blender-v3.3-release
blender:blender-v3.6-release
blender:partial-write-refactor
blender:blender-v4.1-release
blender:blender-v3.6-temp_wmoss_animrig_public
blender:temp-sculpt-dyntopo
blender:gpencil-next
blender:anim/animation-id-113594
blender:blender-v4.0-release
blender:blender-projects-basics
blender:bridge-curves
blender:sculpt-blender
blender:asset-browser-frontend-split
blender:asset-shelf
blender:tmp-usd-python-mtl
blender:tmp-usd-3.6
blender:blender-v3.5-release
blender:blender-v2.93-release
blender:realtime-clock
blender:sculpt-dev
blender:bevelv2
blender:xr-dev
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 Commits
Author | SHA1 | Message | Date |
---|---|---|---|
Philipp Oeser | e8301b0ab8 |
Fix #111169: PointerProperty ignores poll function when setting value
buildbot/vexp-code-patch-coordinator Build done.
Details
According to docs, a pointer PointerProperty poll function should "determine whether an item is valid for this property". This was only used for filtering in the UI templates though, setting (e.g. from python) ignored this entirely. There was a comment about this in code (so I assume this was somewhat known), however there doesnt seem to be a reason not to run the poll when setting the value as well afaict. Report was about python defined ID properties, but this was also true for other properties. For example, you could run the following (even though `rna_Brush_imagetype_poll` explicitly forbids this) ``` image = D.images['Render Result'] brush = D.brushes['Clone'] brush.clone_image = image ``` So now run the poll in `RNA_property_pointer_set`. Alternatively, we could introduce a separate "set" method that would be capable of "determine whether an item is valid for this property" (but then again "poll" actually seems like the right place for this already). |