Fix #114415: USDZ conversion happens outside of main thread. #114420

Merged
Bastien Montagne merged 1 commits from mont29/blender:tmp-fix-114415-usdz-export into blender-v4.0-release 2023-11-03 10:56:05 +01:00

USDZ conversion currently requires to change the 'current working
directory', due to internal USD library limitations.

This can only be done from main thread (and is highly discouraged in
general). This implies that USDZ conversion cannot happen from the Job
worker thread.

This commit moves it to the endjob callback of the USD export job
instead, as it is guaranteed to be executed from caller thread, i.e.
main thread in this case.

USDZ conversion currently requires to change the 'current working directory', due to internal USD library limitations. This can only be done from main thread (and is highly discouraged in general). This implies that USDZ conversion cannot happen from the Job worker thread. This commit moves it to the `endjob` callback of the USD export job instead, as it is guaranteed to be executed from caller thread, i.e. main thread in this case.
Bastien Montagne requested review from Brecht Van Lommel 2023-11-02 17:50:21 +01:00
Bastien Montagne requested review from Michael Kowalski 2023-11-02 17:50:21 +01:00
Bastien Montagne added this to the 4.0 milestone 2023-11-02 17:50:27 +01:00
Bastien Montagne added the
Interest
USD
label 2023-11-02 17:50:35 +01:00
Bastien Montagne added this to the USD project 2023-11-02 17:50:41 +01:00
Author
Owner

@blender-bot build

@blender-bot build
Brecht Van Lommel approved these changes 2023-11-02 19:05:02 +01:00
Brecht Van Lommel left a comment
Owner

It's unfortunate to block the UI for a conflict that is unlikely to happen in practice, but I guess it's not so bad and we might as well be correct.

Can you add a comment explaining why this code is here? In the future we may be able to move this, if the USDZ API gets improved.

It's unfortunate to block the UI for a conflict that is unlikely to happen in practice, but I guess it's not so bad and we might as well be correct. Can you add a comment explaining why this code is here? In the future we may be able to move this, if the USDZ API gets improved.
Michael Kowalski approved these changes 2023-11-02 20:10:38 +01:00
Michael Kowalski left a comment
Member

Thank you for the fix!

Thank you for the fix!
Bastien Montagne force-pushed tmp-fix-114415-usdz-export from 3045494db8 to 31bd2a0f64 2023-11-03 10:50:00 +01:00 Compare
Bastien Montagne merged commit cc6c5cb7f4 into blender-v4.0-release 2023-11-03 10:56:05 +01:00
Bastien Montagne deleted branch tmp-fix-114415-usdz-export 2023-11-03 10:56:10 +01:00
Sign in to join this conversation.
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
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
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
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#114420
No description provided.