generated from ynput/ayon-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b75b8cb
commit b905953
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
client/ayon_houdini/plugins/workfile_build/load_placeholder.py
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,52 @@ | ||
from ayon_core.pipeline.workfile.workfile_template_builder import ( | ||
LoadPlaceholderItem, | ||
PlaceholderLoadMixin, | ||
) | ||
|
||
from ayon_houdini.api.workfile_template_builder import ( | ||
HoudiniPlaceholderPlugin | ||
) | ||
from ayon_houdini.api.lib import read, lsattr | ||
|
||
|
||
class HoudiniPlaceholderLoadPlugin( | ||
HoudiniPlaceholderPlugin, PlaceholderLoadMixin | ||
): | ||
"""Workfile template plugin to create "load placeholders". | ||
"load placeholders" will be replaced by AYON products. | ||
""" | ||
|
||
identifier = "ayon.load.placeholder" | ||
label = "Houdini Load" | ||
|
||
def populate_placeholder(self, placeholder): | ||
self.populate_load_placeholder(placeholder) | ||
|
||
def repopulate_placeholder(self, placeholder): | ||
self.populate_load_placeholder(placeholder) | ||
|
||
def get_placeholder_options(self, options=None): | ||
return self.get_load_plugin_options(options) | ||
|
||
def get_placeholder_node_name(self, placeholder_data): | ||
|
||
node_name = "{}_{}".format( | ||
self.identifier.replace(".", "_"), | ||
placeholder_data["product_name"] | ||
) | ||
return node_name | ||
|
||
def collect_placeholders(self): | ||
output = [] | ||
load_placeholders = self.collect_scene_placeholders() | ||
|
||
for node in load_placeholders: | ||
placeholder_data = read(node) | ||
output.append( | ||
LoadPlaceholderItem(node.path(), placeholder_data, self) | ||
) | ||
|
||
return output | ||
|