ImagePreviewCollection.load
and ImagePreviewCollection.new
don't behave as described in the Python API docs #63651
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#63651
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: Linux-5.0.7-200.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine 64 Bits
Graphics card: GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116
Blender Version
Broken: version: 2.80 (sub 57), branch: blender2.7, commit date: 2019-04-15 23:42, hash:
5ac7675f4c
(from the buildbot) - also 2.79.6Worked: I suspect it never worked as documented.
Short description of error
The Python API docs state for
ImagePreviewCollection.load
and forImagePreviewCollection.new
that is should return "The Preview matching given name, or a new empty one.". In reality it raises an exception when the Preview already exists.Exact steps for others to reproduce the error
Go to the Python console and type the following.
In the python code a check is done that raises an exception if the Preview already exists (for
load
there is even a little typo, it should be a format string:f"key {name!r} already exists"
).As far as I can see the underlying C code manages existing Previews just fine and has the behavior described in the docs. So I would propose to remove the check from the Python code. Another option would be to properly return the existing Preview from the Python code.
Of course another option would be to change the docs, but personally I would prefer to have the documented behavior.
I've attached 2 patches. 1 for removing the check in the Python code and 1 with the corrected check. The patches should apply to both 2.79 and 2.80.
ImagePreviewCollection_load_new-check_removed.diff
ImagePreviewCollection_load_new-check_fixed.diff
Added subscriber: @jasperge-2
Added subscriber: @lichtwerk
Sounds reasonable, will check with others though [and commit if agreed upon]
thx for the patch
Before the final release I think this should be fixed. I noticed this bug is still in the release candidate.
@lichtwerk Any updates on this? Would be nice to get it in for the release.
I am not available to look into this this week, so it might not make it into 2.80, but can step down from it, so others can pick it up.
Sorry this has been lying around, other things had higher priority...
This issue was referenced by
971fe43d06
Changed status from 'Confirmed' to: 'Resolved'