-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show publish plug-in attributes based on families
instead of only productType
#994
Merged
BigRoy
merged 6 commits into
ynput:develop
from
BigRoy:enhancement/attributes_by_families_tiny
Nov 12, 2024
Merged
Show publish plug-in attributes based on families
instead of only productType
#994
BigRoy
merged 6 commits into
ynput:develop
from
BigRoy:enhancement/attributes_by_families_tiny
Nov 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t also by `families` data on created instance
BigRoy
added
the
type: enhancement
Improvement of existing functionality or minor addition
label
Nov 6, 2024
2 tasks
iLLiCiTiT
reviewed
Nov 11, 2024
Co-authored-by: Jakub Trllo <[email protected]>
antirotor
approved these changes
Nov 11, 2024
10 tasks
Ready for merge @iLLiCiTiT ? |
10 tasks
This was referenced Nov 12, 2024
MustafaJafar
approved these changes
Nov 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog Description
Show publish plug-in attributes based on
families
instead of onlyproductType
This PR can be tested together with ynput/ayon-houdini#144
This PR split off from this one #973 so it only contains the tiny change.
Additional info
This commit 8208bef allows to show publish plugin attributes also based on the created instance
families
data instead of only the product type. As such, if the Creator defines extra families - then the Pyblish plug-ins for which it will run will now also show their publisher attributes.This is a required change to easily start supporting a workflow where we can target particular instances from plug-ins without having to target the product type itself. This opens the door to allow say, five different creators, to each produce a
model
family but with e.g. a different representation - like a USD model, groom, look, etc.📔 ✏️ Houdini (and Maya) currently exposes a
get_publish_families
method on the Creators - we may want to move that to the base creator plug-in in core by default because it'll greatly simplify the implementation of defining more families than just the product type from a creator across all the DCCs.Why?
1. Product type versus families
Also see explanation on product type versus families.
The idea is that a product type should not be 1:1 tightly coupled to a particular node or export method inside the DCC, so that technically any amount of export methods could publish a product type like model or pointcache which only consider the product type's validations (like a model must be static) but not care at all about e.g. Alembic properties being set up correctly on the Alembic ROP.
Imagine an instance with families
pointcache
extractor.AbcExport
And an instance:
model
extractor.AbcExport
The intent is very clear - these instances have different product types but use the same means of exporting, triggering an Alembic exporter. It now becomes very easy to preserve the
model
logic for validations but just add a different means of extraction, likeextractor.fbx
,extractor.maya_usd
orextractor.multiverse_usd
, etc.It should be much easier to without conflict add many creators with the same product type while avoiding 'collisions' on how to trigger only the relevant exporters or plug-ins.
Vice versa as well, it should be easy to add a file format (representation) to any amount of existing creators without needing to target
model
orpointcache
.Also, Explicit is better than Implicit.
2. Type hints and autocomplete for instances. (Less unknown dicts!)
Type Hinting: Preferably we can get to a point where if a certain family applies we can be sure certain data is present. For example:
Take this random example above.
My IDE now autocompletes for me:
And type hints:
3. Ensured data types (continuation of typed instances)
This could even be taken a step further to also be used for validation - using e.g. pydantic. If an instance says it has a frame range using a family - then we can even apply a dedicated validation plug-in validating whether the instance adheres to the type hint of that dataclass or type hint.
And of course
mypy
and other tooling can validate more things in a modern IDE due to the strictness in the typing if e.g. anint
is accidentally used in a string operation, etc.4. Correctly use the pyblish ecosystem
By avoiding using custom metadata like
if instance.data["review"]: process_review()
type of logic and instead tagging whether something say, has a reviewable or a certain type of media file, or certain type of representation throughfamilies
means that ALSO the publishing system only ever considers it for processing for a plug-in if it has it. Instead of needing to know how a review product type differs in maya, to houdini, to blender, etc.Similarly with all of the above steps it also means it's much clearer from e.g. a standalone studio addon to target e.g. family
file.usd
or alike that we KNOW there will at least be a USD file generated - and hence can basically add a stack of pre-integration file processors of that instead of targeting ALL instances and needing to search manually for representations, etc.Testing notes:
We may need to do a quick simple test across different DCCs that may define
families
data (at Creation, during publishing shouldn't make a difference) on the instance to see whether they still behave as intended. As far as I know that logic currently only exists inside Houdini and Maya.