Skip to content

Allow to add Instances and have their families' Plugins show after collection #359

@BigRoy

Description

@BigRoy

Issue

I'm in the process of setting up a Publishing workflow where some instances will spawn "dependent publishes" if they are set to publish in the current run, e.g. the user did not disable them in the Pyblish UI. More info on what I'm trying to achieve can be found in this Avalon + USD + Pyblish discussion.


We've recently started looking into adopting Houdini 18 Solaris with USD inside Avalon and are making good progress. Currently we have a good view of how we want to structure assets and shots with a lot of information gained from this Generating Assets and Shots in USD (Pipeline) topic.

Use case

  • We have a couple of model variations the User may want to publish. These are now showing as our Publish instances.
  • Whenever any Model variation instance was active when the user starts the Publish two dependent "publishes" should be created to, specifically a master usdModel and usdShade.
  • Whenever any usdModel file is to be generated it should also bootstrap an usdAsset file whenever the usdAsset file does not exist yet.

The crucial point is that these dependencies are versioned seperately and turn into their own subset.

So e.g.

  • Artist generated model variation usdModel_damaged
  • This means master usdModel and usdShade will need to be updated in their respective subset and versions.
  • If usdAsset does not exist yet (e.g. this is first usdModel ever) then also generate usdAsset subset v001.

I've found it particularly hard to make these dependencies simple to write and debug inside Pyblish and Avalon. This commit has the crucial bits of my current "quick 'n' dirty" draft.


As such, after the instances are collected and the user made his pick as to what to publish then when the user clicks validate or publish the dependent instances get created. However, currently these will not themselves have their relevant plug-ins loaded for their family. This is currently due to how after Collecting the irrelevant Plug-ins are removed. For example this second Validator will never trigger:

class CreateDependencies(pyblish.api.ContextPlugin):
    order = pyblish.api.ValidatorOrder - 0.4

    def process(self, context):
        instance = context.create_instance("dependency")
        instance.data["family"] = "dependency"


class ValidateDependencies(pyblish.api.InstancePlugin):
    order = pyblish.api.ValidatorOrder
    families = ["dependency"]

    def process(self, instance):
        # Never runs...
        self.log.info("Running dependency")

This means I cannot add new instances or alter the instances after the User's publishing choices are well defined. Because I can't add it in-between Collecting and Validating.

Changing CVEI?

In the discussion I opted for maybe adding an additional step to CVEI, specifically:

  1. Initialize - find and create the Instances for the user to interact with, only with essential information to allow the user to check the contents.
  2. Collect - collect any additional data needed for validation, extraction and integration. Including the potential adding of automated dependent instances.
  3. Validate - validate all the existing instances
  4. Extract - output the publish instances.
  5. Integrate - push the extracted data into the correct location on disk and into your production database.

A user would then be able to "change what instances to trigger" (e.g. through Pyblish QML) at the end of Initialize (1). Then on Validate or Publish the publishing will continue onwards through respectively 2-3 or 2-5. The difference in behavior would then be after Collect (2) that all plugins are still checked whether they should be run for the potentially new or changes families.


I would love to see a way where I can trivially add instances as dependencies after the user initiated the publish choices and still allow them to be shown individually to the user as a result. This would then also allow to debug those dependent publishes right in the Pyblish User Interfaces.


This is somewhat related to #346 due to the allowing the Initialize step to become solely the "list which instances are available to publish" and all the post collecting of data to be done in then step two: Collect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions