IO: Import multiple alembic files at once #121492

Merged
Jesse Yurkovich merged 5 commits from guishe/blender:multiple-abc into blender-v4.2-release 2024-06-05 21:20:39 +02:00
Contributor

Allows to import multiple alembic files in single operator call,
either by file explorer import window or by drag-and-drop from external sources.

When importing multiple alembic files as background job, import progress will be divided
by all files, so if 5 files are imported, each file will make a progress of 20%.
This can be improved if the job text can be customized to display for example
Import Alembic 1/5 and using 100% progress status display for each file, but that is out
of the scope of this pr.

They are few options like sequence_min_frame,sequence_max_frame that only changes
Scene min and max frame, this set the maximum and minimum detected in all file paths.


Extra notes:
While debugging i get a few error messages related to the importer, but not related to the patch.
image

Allows to import multiple alembic files in single operator call, either by file explorer import window or by drag-and-drop from external sources. When importing multiple alembic files as background job, import progress will be divided by all files, so if `5` files are imported, each file will make a progress of `20%`. This can be improved if the job text can be customized to display for example `Import Alembic 1/5` and using 100% progress status display for each file, but that is out of the scope of this pr. They are few options like `sequence_min_frame`,`sequence_max_frame` that only changes Scene min and max frame, this set the maximum and minimum detected in all file paths. ---- Extra notes: While debugging i get a few error messages related to the importer, but not related to the patch. ![image](/attachments/fe0b63a5-f0f9-4495-980b-7689b59add25)
9.6 KiB
Guillermo Venegas changed title from WIP: IO: Import multiple alembic files at once to IO: Import multiple alembic files at once 2024-05-07 16:07:46 +02:00
Iliya Katushenock added this to the Pipeline, Assets & IO project 2024-05-07 17:53:32 +02:00
Jesse Yurkovich requested review from Jesse Yurkovich 2024-05-17 23:24:29 +02:00

I'll start checking with others if they're ok with the general approach used here. In the meantime the progress bar calculation may need a bit of work. When trying to import in 3 large alembics (just a bunch of primitives with 1-4 frames of animation data) you might see the following (it is repeated for each of the 3):
progressbar.png

I'll start checking with others if they're ok with the general approach used here. In the meantime the progress bar calculation may need a bit of work. When trying to import in 3 large alembics (just a bunch of primitives with 1-4 frames of animation data) you might see the following (it is repeated for each of the 3): ![progressbar.png](/attachments/e8045dc9-e204-4950-8c65-f0669ca47fa9)
Jesse Yurkovich requested changes 2024-06-05 04:16:49 +02:00
Jesse Yurkovich left a comment
Member

Just 2 minor comments. The rest of the code seems to work alright from what I've tested.

Just 2 minor comments. The rest of the code seems to work alright from what I've tested.
@ -633,15 +636,16 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op)
}
AlembicImportParams params = {0};

Now that AlembicImportParams is defined in a full c++ header, use params{}; to initialize because = {0}; has slightly different semantics.

Now that AlembicImportParams is defined in a full c++ header, use `params{};` to initialize because `= {0};` has slightly different semantics.
Author
Contributor

ABC_alembic.h needs to be moved to ABC_alembic.hh to follow conventions too
Don't know if that can add a lot of noise in this pr

Edit: They are other c++ files in .h that requires ABC_alembic.h (abc_archive.h and abc_hierarchy_iterator.h), so i think its fine by now

`ABC_alembic.h` needs to be moved to `ABC_alembic.hh` to follow conventions too Don't know if that can add a lot of noise in this pr Edit: They are other c++ files in `.h` that requires `ABC_alembic.h` (`abc_archive.h` and `abc_hierarchy_iterator.h`), so i think its fine by now
@ -699,3 +725,3 @@
job->wm = CTX_wm_manager(C);
job->import_ok = false;
STRNCPY(job->filepath, filepath);
job->paths = std::move(params->paths);

This produces a few warnings for me with a variety of tools because params is const:
Warning C26478 Don't use std::move on constant variables. (es.56)

This produces a few warnings for me with a variety of tools because `params` is `const`: `Warning C26478 Don't use std::move on constant variables. (es.56)`
guishe marked this conversation as resolved
Can you retarget to the 4.2 branch: https://developer.blender.org/docs/handbook/contributing/pull_requests/#rebasing-a-pull-request
Guillermo Venegas force-pushed multiple-abc from a9c0a9a091 to bdb2f66416 2024-06-05 19:28:48 +02:00 Compare
Guillermo Venegas changed target branch from main to blender-v4.2-release 2024-06-05 19:29:20 +02:00

@blender-bot build

@blender-bot build
Jesse Yurkovich merged commit 5e9d19d58b into blender-v4.2-release 2024-06-05 21:20:39 +02:00
Guillermo Venegas deleted branch multiple-abc 2024-07-02 17:16:44 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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 Assignees
2 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#121492
No description provided.