generated from ynput/ayon-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Houdini: Publish any ROP node (Generic Creator) #2
Open
BigRoy
wants to merge
15
commits into
ynput:develop
Choose a base branch
from
BigRoy:enhancement/houdini_generic_publish
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5b7fdfd
Implement Generic ROP publish from https://github.com/ynput/ayon-core…
BigRoy b5d5e09
Add argument to docstring
BigRoy 421adbf
Merge branch 'develop' into enhancement/houdini_generic_publish
MustafaJafar a267cd2
Merge branch 'develop' into enhancement/houdini_generic_publish
BigRoy d6d7e9e
Merge branches 'enhancement/houdini_generic_publish' and 'enhancement…
BigRoy 5b6f0ec
Add publish button
BigRoy 46da010
Add help
BigRoy 83e70d5
Merge branch 'develop' into enhancement/houdini_generic_publish
BigRoy e74903e
Merge branch 'develop' into enhancement/houdini_generic_publish
MustafaJafar 7e9bbd0
Merge branch 'develop' of https://github.com/ynput/ayon-houdini into …
BigRoy 6934ba6
Fix refactored merge conflict, skip non local renders like "local_no_…
BigRoy 3791df1
Do not error on existing `ayon_self_publish` parm but log a warning
BigRoy 6126888
Cosmetics
BigRoy c14710c
Elaborate TODO
BigRoy 36c65ad
Merge branch 'develop' into enhancement/houdini_generic_publish
MustafaJafar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import hou | ||
|
||
from ayon_core.pipeline import registered_host | ||
from ayon_core.pipeline.create import CreateContext | ||
|
||
|
||
def make_publishable(node): | ||
# TODO: Can we make this imprinting much faster? Unfortunately | ||
# CreateContext initialization is very slow. | ||
host = registered_host() | ||
context = CreateContext(host) | ||
|
||
# Apply the instance creation to the node | ||
context.create( | ||
creator_identifier="io.ayon.creators.houdini.publish", | ||
variant="__use_node_name__", | ||
pre_create_data={ | ||
"node": node | ||
} | ||
) | ||
|
||
|
||
# TODO: Move this choice of automatic 'imprint' to settings so studio can | ||
# configure which nodes should get automatically imprinted on creation | ||
# TODO: Do not import and reload the creator plugin file | ||
from ayon_houdini.plugins.create import create_generic | ||
import importlib | ||
importlib.reload(create_generic) | ||
AUTO_CREATE_NODE_TYPES = set( | ||
create_generic.CreateHoudiniGeneric.node_type_product_types.keys() | ||
) | ||
|
||
|
||
def autocreate_publishable(node): | ||
# For now only consider RopNode | ||
if not isinstance(node, hou.RopNode): | ||
return | ||
|
||
node_type = node.type().name() | ||
if node_type in AUTO_CREATE_NODE_TYPES: | ||
make_publishable(node) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Please, never import plugins. Shouldn't
node_type_product_types
from the creator be moved here (or to different pipeline file)?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 should be taken from settings instead - or stored elsewhere.
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.
I'm not sure about settings. Those values don't seem like something what TD can fill, they actually look like they are quite pre-determined (based only on observation and my understanding).
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.
They are - until you get into the realm of custom HDAs (custom nodes) a studio develops on their own inside of Houdini (or get shipped with addons/plugins for Houdini and are not native to Houdini). We may not know about ALL nodes from our codebase.
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.
So, basically, pipeline admins would need to expand that list as needed e.g. to add their own types or like what krishna did at early stage of this PR ynput/ayon-core#542 (comment) when he tested
labs::karma::2.0
node that we don't usually support in the current status of the addon, correct?Maybe, they would spend some time to figure out the correct values for product types.. but, is it the same case across different addons where we have product type and families filters?
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.
Does moving
node_type_product_types
to settings resolve this?