USD IO: Validate data in the operator, before starting background job. #105404
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105404
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
While the crash revealed by #105160 has now been fixed (
d66672e17a
), don't think USD I/O operators should start the background job at all when obviously wrong data has been selected/passed as parameter. It's not really good behavior for the IO operator to return "Success" after starting a background job that will immediately fail.Not all errors can be caught at that level of course, but things like not passing an a priori valid filepath to the import operator can be checked by the operator code itself, and immediately return
CANCELLED
status.hey @mont29 this issue is open right ? Could you please explain to me in more detail what needs to be done here?
Yes it is. Essentially, code in
exec
callback ofWM_OT_usd_import
should check that the selected path is a priori a valid candidate for USD import.Hey @mont29, so I have been going through the source code and I just wanted to confirm if the bug lies in this piece of code.
This is in the /source/blender/editors/io/io_usd.c file.
I dove into the code of
RNA_string_get()
, and it calls another functionRNA_property_string_get()
which is where I feel a check forchar *value
is required?I think you need to do an extra check after these two lines. It checks for "No filename given" but it doesn't check for "Invalid filename".
In my opinion this is not necessary, what is the benefit of validating data in two places? Performance is not a concern here, and duplicated validation code means possibility of things to go out of sync.
If this is marked as a good first issue it should also which conditions you expect this to check, because even for me it's not clear what the intent is here. A valid file path can mean many things, including file existence, file/directory, read permissions, extensions, etc.
@brecht yeah it was confusing, so I just assumed .usd files would be the right ones and continued. But I should've done proper research, my bad.
As far as the necessity of this issue goes, it sure helped me gain experience with submitting PRs for blender. Messed up a lot, learnt a lot. All in all, good practice.
hey @mont29 I want to know is this issue still open? If yes, can you explain me which parameters to check for a valid filename?
Removing the good first issue tag since there is clearly no common understanding of its meaning.
Updated task with some more context and expectations info.