Skip to content

Commit

Permalink
[SHOT-3302] Remove recursive transformation in scene_operations.py du…
Browse files Browse the repository at this point in the history
…ring Scene Breakdown Update #22

In apply transformations mehod use only the first child of the old node for every new node children. (#22)
  • Loading branch information
000paradox000 authored Feb 21, 2020
1 parent 91c2285 commit 816024c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hooks/tk-multi-breakdown/basic/scene_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,16 @@ def _apply_transformations(self, old_node, new_node, materials):

self._apply_materials(old_node, new_node, materials)

for i in range(0, old_node.getNChildren()):
for j in range(0, new_node.getNChildren()):
if old_node.getChild(i).getName() == new_node.getChild(j).getName():
self._apply_transformations(
old_node.getChild(i), new_node.getChild(j), materials
)
break
old_node_child = old_node.getChild(0)
old_node_child_name = old_node_child.getName()

for i in range(0, new_node.getNChildren()):
new_node_child = new_node.getChild(i)
new_node_child_name = new_node_child.getName()

if old_node_child_name == new_node_child_name:
self._apply_transformations(old_node_child, new_node_child, materials)
break

def _apply_materials(self, old_node, new_node, materials):
"""
Expand Down

0 comments on commit 816024c

Please sign in to comment.