Goal
Allow to use Blender’s import tools (Append, Link, Asset Browser) without messing with OP compatibility.
This would work only for Blender files interactions
State of the art
Blender workflow with OP is currently deeply refactored following a proposal we’ve submitted few months ago: #3171
When testing this workflow for our production, we face several issues because the instances are managed by collections. This design generates a big issue: it is very tedious to manage non-outliner datablocks (NOD) like materials, node groups (geometry nodes, compositing groups…), textures…
We’ve started to handle materials for the look
family with collections, but when loading it into a workfile, it creates an empty collection that holds the data, which is disturbing for the user. If we extend this design to other NODs, it’ll become very messy.
Also, since the Asset Browser allows to Mark as Asset
almost any kind of datablock, we cannot take advantage of it for materials, which is very sad.
Proposal
Metadata management
During extraction, some metadata are added to the datablock, the ones we know (asset name, subset name, parent, family…) but some are handled by dedicated behaviours.
Representation ID set after asset integration
Using a subprocess and a script, we update the integrated blend files with the representation
ObjectId after the doc has been created in the DB, with a class IntegrateBlenderAsset(IntegrateAsset)
. Which makes the Asset Browser usable for datablocks because the metadata required by OP is stored into the published file and not set to the instance when loading it.
Loader type determined by handler
Determine the OP loader with a handler and make the avalon
content compliant with the scene inventory requirements.
List of publishable instances held in Blender Scene
Every scene where an instance is created, will hold a CollectionProperty
called ‘op_instances’, a list of created instances and which will be listed in publish.
UI panel for managing publishable instances
Creating a panel integrated in Blender to create and manage these created instances seems the best option to us. It’ll be faster, more consistent, and won’t generate Qt crashes Blender can encounter. We can associate a family to each datablock type to create the appropriate instance.
Renaming datablock at instance creation
The main constraint for the user will be that the datablock for which an instance is created will be renamed by the OP naming convention. This is to guarantee consistency across all users’ workfiles and publications.
Auto clear instances list at save
Because a datablock for which a publish instance exists can be deleted, it would generate an inconsistency between the instances list and the actual existing datablocks. We propose to test if a datablock targeted by an OP instance still exists in the scene and delete the instance if not, processed by a handler run before saving.
What about compatibility with other softwares?
We are here talking only about using Blender features to import from other blend files. The feature we want to deal with don’t work for other file types.
For cross DCCs formats, the Load
will set the required metadata, the same way it currently works.