Discussion / Issue
When publishing a set of textures there can easily be multiple sequences of textures for a single material - and an export from Substance could even export multiple materials.
As an example, a Texture Set from Substance Painter could be:
- Possibly multiple Materials
- Possibly multiple textures per material
- Possibly UDIM tiles
Would that be a single “TexturePackage” subset?
Would that be a “TextureSet” subset per material?
Would that be a “Texture” subset per texture type? (So just the Defaultmaterial_Base_color is one subset, then DefaultMaterial_Height is another)
- What do we expect to be in the loader?
- What do we expect to see in the manager?
- How do we expect site sync to decide what textures to transfer?
My first thoughts
Texture subset per channel
We’ll publish Textures individually per sequence, that is e.g. base_Roughness.<udim>.exr
- so with e.g. Substance’s default Redshift template for a material:
// template
$mesh_$textureSet_Color(_$colorSpace)(.$udim)
$mesh_$textureSet_Roughness(_$colorSpace)(.$udim)
$mesh_$textureSet_Metalness(_$colorSpace)(.$udim)
$mesh_$textureSet_Normal(_$colorSpace)(.$udim)
$mesh_$textureSet_DisplaceHeightField(_$colorSpace)(.$udim)
$mesh_$textureSet_EmissionColor(_$colorSpace)(.$udim)
We’d get subsets:
// subsets
textureMain_Color
textureMain_Roughness
textureMain_Metalness
textureMain_Normal
textureMain_DisplaceHeightField
textureMain_EmissionColor
These are then all their own subsets that can have their own color spaces, etc.
As such - a texture subset would refer to a single ‘channel’ for the material (but does allow a sequence like a UDIM sequence)
Additionally we allow subsets to be ‘subscribed’ or ‘connected’ to another subset. A package like a Texture Set then is a Subset its own which can have its own family, versions and representations. The Loader could then visually group the texture subsets by default under this subset (similar to Grouping).
Something like:
subset["data"]["children"] = ["version-id-1", "version-id-2", "version-id-3"]
This TextureSet subset could then also contain additional files, like a special family + json if it came from e.g. Substance Painter with a parameters JSON file to allow special loaders to load the package into e.g. Maya including the shader parameters or alike.
Thoughts?
Issues?
Additional notes
I think it’s worthwhile to spend some time also simplifying how to manage files for publishing. In particular the Extractors, I’d like to propose explicit functions like e.g.
add_files(instance, files)
add_udim(instance, files)
add_sequence(instance, files)
Instead of the messy quirkiness of deadling with instance.data["representations"]
and its files in each Extractor which tends to grow complex per Extractor with a lot of duplicated code doing the same thing over and over - leaving a lot of code management over time when we want to change instance.data
behavior. By exposing that to a function like this we can internally tweak that data structure easier.
These could then each have explicit arguments for color space, frame range, original frame ranges, etc.:
def add_files(instance, files, source_frames, destination_template):
...
Related issues
Potentially related discussions: