Merge pull request #5410 from ynput/bugfix/OP-6230_3dsMax-handling-object-deletion

Max: fix the bug of handling Object deletion in OP Parameter
This commit is contained in:
Kayla Man 2023-08-08 16:29:40 +08:00 committed by GitHub
commit ee006f8d01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,6 +136,7 @@ MS_CUSTOM_ATTRIB = """attributes "openPypeData"
temp_arr = #()
for x in all_handles do
(
if x.node == undefined do continue
handle_name = node_to_name x.node
append temp_arr handle_name
)
@ -212,14 +213,19 @@ class MaxCreator(Creator, MaxCreatorBase):
if pre_create_data.get("use_selection"):
node_list = []
sel_list = []
for i in self.selected_nodes:
node_ref = rt.NodeTransformMonitor(node=i)
node_list.append(node_ref)
sel_list.append(str(i))
# Setting the property
rt.setProperty(
instance_node.modifiers[0].openPypeData,
"all_handles", node_list)
rt.setProperty(
instance_node.modifiers[0].openPypeData,
"sel_list", sel_list)
self._add_instance_to_context(instance)
imprint(instance_node.name, instance.data_to_store())