Skip to content

Commit

Permalink
implement load placeholder plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Jul 10, 2024
1 parent b75b8cb commit b905953
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions client/ayon_houdini/plugins/workfile_build/load_placeholder.py
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

0 comments on commit b905953

Please sign in to comment.