Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Houdini: Ability to properly duplicate ROP
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSouchet committed Sep 11, 2024
1 parent d9731d0 commit c1aedd3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion openpype/hosts/houdini/api/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""Houdini specific Avalon/Pyblish plugin definitions."""
import sys
from uuid import uuid4
from abc import (
ABCMeta
)
Expand Down Expand Up @@ -118,15 +119,27 @@ def cache_subsets(shared_data):
if shared_data.get("houdini_cached_subsets") is None:
cache = dict()
cache_legacy = dict()
instance_id_list = []

for node in lsattr("id", "pyblish.avalon.instance"):

creator_identifier_parm = node.parm("creator_identifier")
instance_id_parm = node.parm("instance_id")
if creator_identifier_parm:
# creator instance
creator_id = creator_identifier_parm.eval()
instance_id = instance_id_parm.eval()
# Regenerating instance in case of identical values between nodes
if instance_id in instance_id_list or node.path() != node.parm("instance_node").eval():
new_data = {
"instance_node": node.path(),
"instance_id": str(uuid4()),
"subset": node.name()
}
# Refreshing node values
imprint(hou.node(node.path()), new_data, update=True)
cache.setdefault(creator_id, []).append(node)

instance_id_list.append(instance_id)
else:
# legacy instance
family_parm = node.parm("family")
Expand Down

0 comments on commit c1aedd3

Please sign in to comment.