General IO: Persistent Export settings on Collections #115690

Open
opened 2023-12-01 22:59:13 +01:00 by Jesse Yurkovich · 0 comments

UI and UX

  • Inside the existing "Collection" properties space, a new section related to IO will be added

  • This new section will contain a List of file format configurations

    • Implies that there's an "Add" button like Modifiers to add a new configuration
    • Each configuration will be contained inside its own layout Panel
    • Each configuration roughly corresponds to the following data
      • The FileHandler identifier to indicate which format is being configured (USD, glTF, OBJ, etc.)
      • The File Path for output (should support Blender's relative path syntax and operations)
      • A Panel containing the IO format's export properties
  • There are three locations for actually invoking the IO operations

    • As an Export button on each individual configuration's Panel header
    • As an Export All button inside the Collection properties section itself to perform IO against all Exporters in the Collection
    • As a File -> Export All Collections menu item that will export all configured collections in the scene

Implementation Details and Goals

  • Unified drawing of the operator Properties
    • The same drawing code needs to be useable inside the File-Select dialog, the Popup during drag-drop operations, and inside this new Collection properties panel
  • Access and Structure of properties
    • Storage for the format's properties will be inside our own IDProperty collection. The Definition of properties remains on the Operator.
    • Properties need to be bound to an owner for the Undo system to properly take affect
  • The FileHandler handle type should gain a property for the Export operator identifier

Remaining design and implementation tasks

Required for using C++ exporters

Required for using Python exporters

  • Undo does not work with properties from Python operators (FBX, glTF)
  • Exporters need modified to use layout panels

Required for initial commit to main

  • Presets do not work. They depend on accessing the active_operator context property, which is problematic with the current operator lifetime
  • Implement depsgraph "build from collection" infrastructure
    • Does this need exposed to Python? The Python IO addons sometimes just iterate all_objects on a Collection. Is that good enough?
  • The filepath property should be sanitized after each user modification to e.g. enforce a valid name + extension or similar
    • Should it default to //<collection name>.<extension> so that filepath always starts off valid?
    • Status: Defaulting to //<collection name>.<extension> in primary PR now

Required before release

  • UI badge or indicator icon in the Outliner for Collections

Future design work

  • Allow the user to store "common" settings for the formats instead of setting them on each collection
    • For consistency and convenience
    • Maybe use settings on the "parent" collection?
    • Makes use of the ability to determine if an IDProperty has been set or not (See KeyMapItems: they only override settings that are explicitly set)
  • How does IO work with Collection instancing and linking collections from external files?
    • Investigate "Layer collections"

Additional perspective and background

## UI and UX - Inside the existing "Collection" properties space, a new section related to IO will be added - This new section will contain a List of file format configurations - Implies that there's an "Add" button like Modifiers to add a new configuration - Each configuration will be contained inside its own layout Panel - Each configuration roughly corresponds to the following data - The FileHandler identifier to indicate which format is being configured (USD, glTF, OBJ, etc.) - The File Path for output (should support Blender's relative path syntax and operations) - A Panel containing the IO format's export properties - There are three locations for actually invoking the IO operations - As an `Export` button on each individual configuration's Panel header - As an `Export All` button inside the Collection properties section itself to perform IO against all Exporters in the Collection - As a `File` -> `Export All Collections` menu item that will export all configured collections in the scene ### Implementation Details and Goals - Unified drawing of the operator Properties - The same drawing code needs to be useable inside the File-Select dialog, the Popup during drag-drop operations, and inside this new Collection properties panel - Access and Structure of properties - Storage for the format's properties will be inside our own IDProperty collection. The Definition of properties remains on the Operator. - Properties need to be bound to an owner for the Undo system to properly take affect - The FileHandler handle type should gain a property for the Export operator identifier ## Remaining design and implementation tasks Required for using C++ exporters - [x] Exporters need to properly surface errors to the user: Proposal [Import/Export IO: Handle errors in a more consistent manner](https://projects.blender.org/blender/blender/issues/117881) Required for using Python exporters - [x] Undo does not work with properties from Python operators (FBX, glTF) - [x] Exporters need modified to use layout panels Required for initial commit to main - [x] Presets do not work. They depend on accessing the `active_operator` context property, which is problematic with the current operator lifetime - [x] Implement depsgraph "build from collection" infrastructure - [ ] Does this need exposed to Python? The Python IO addons sometimes just iterate all_objects on a Collection. Is that good enough? - [x] The `filepath` property should be sanitized after each user modification to e.g. enforce a valid name + extension or similar - [x] Should it default to `//<collection name>.<extension>` so that `filepath` always starts off valid? - Status: Defaulting to `//<collection name>.<extension>` in primary PR now Required before release - [x] UI badge or indicator icon in the Outliner for Collections ### Future design work - Allow the user to store "common" settings for the formats instead of setting them on each collection - For consistency and convenience - Maybe use settings on the "parent" collection? - Makes use of the ability to determine if an IDProperty has been set or not (See KeyMapItems: they only override settings that are explicitly set) - How does IO work with Collection instancing and linking collections from external files? - Investigate "Layer collections" ### Additional perspective and background * [Unified object and geometry I/O handling (68935)](https://projects.blender.org/blender/blender/issues/68935) / [FileHandler PR](https://projects.blender.org/blender/blender/pulls/112466) * [Collections for Import/Export (68933)](https://projects.blender.org/blender/blender/issues/68933) * [Add Existing Import/Export Functionality to Collection Properties (100367)](https://projects.blender.org/blender/blender/issues/100367)
Jesse Yurkovich added the
Module
Pipeline, Assets & IO
Type
Design
labels 2023-12-01 22:59:14 +01:00
Bastien Montagne added this to the USD project 2023-12-08 16:45:24 +01:00
Brecht Van Lommel added this to the 4.2 LTS milestone 2024-03-28 18:17:45 +01:00
Sign in to join this conversation.
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
1 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#115690
No description provided.