allows to fully delete the render instances if users click the remove button in creator

This commit is contained in:
Kayla Man 2023-04-12 22:27:33 +08:00
parent ee99b21e97
commit 80a5982a24

View file

@ -247,9 +247,22 @@ class HoudiniCreator(NewCreator, HoudiniCreatorBase):
"""
for instance in instances:
instance_node = hou.node(instance.data.get("instance_node"))
node = instance.data.get("instance_node")
if instance_node:
instance_node.destroy()
# for the extra render node from the plugins
# such as vray and redshift
ipr_node = hou.node("{}{}".format(node,
"_IPR"))
if ipr_node:
ipr_node.destroy()
re_node = hou.node("{}{}".format(node,
"_render_element"))
if re_node:
re_node.destroy()
self._remove_instance_from_context(instance)
def get_pre_create_attr_defs(self):