diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-17 05:42:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-17 05:44:46 +0300 |
commit | 971fe43d06ddad94933666c89c40ed345338992a (patch) | |
tree | d1af187cb2ef1513c695ccd3744bf63b71aa5517 /release/scripts | |
parent | 70eb24a575354968434591528b8096f797c81245 (diff) |
Fix T63651: ImagePreviewCollection.new,load don't work as documented
Update doc-strings, add note for why this decision was made.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bpy/utils/previews.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy/utils/previews.py b/release/scripts/modules/bpy/utils/previews.py index 511df853d66..7402dbb6c0c 100644 --- a/release/scripts/modules/bpy/utils/previews.py +++ b/release/scripts/modules/bpy/utils/previews.py @@ -65,6 +65,10 @@ class ImagePreviewCollection(dict): # Internal notes: # - Blender's internal 'PreviewImage' struct uses 'self._uuid' prefix. + # - Blender's preview.new/load return the data if it exists, + # don't do this for the Python API as it allows accidental re-use of names, + # anyone who wants to reuse names can use dict.get() to check if it exists. + # We could use this for the C API too (would need some investigation). def __init__(self): super().__init__() |