diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-02 11:12:01 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-02 11:12:01 +0400 |
commit | ba8c2be739877db351f07ac210616bb921194377 (patch) | |
tree | 6c416a93a0634e56cbb9ef3706f8060dbf308883 /release/scripts/startup/bl_operators/clip.py | |
parent | 6dec250ec62fbe923b6f5c87fd6ec3cf29a463f3 (diff) |
Improve behavior of Setup Tracking Scene when default nodes exists in the tree
Diffstat (limited to 'release/scripts/startup/bl_operators/clip.py')
-rw-r--r-- | release/scripts/startup/bl_operators/clip.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 1bd40f163de..e9184771a4b 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -528,6 +528,17 @@ class CLIP_OT_setup_tracking_scene(Operator): bg.layers = [False] * 10 + [True] + [False] * 9 @staticmethod + def _wipeDefaultNodes(tree): + if len(tree.nodes) != 2: + return False + types = [node.type for node in tree.nodes] + types.sort() + + if types[0] == 'COMPOSITE' and types[1] == 'R_LAYERS': + while tree.nodes: + tree.nodes.remove(tree.nodes[0]) + + @staticmethod def _findNode(tree, type): for node in tree.nodes: if node.type == type: @@ -587,6 +598,11 @@ class CLIP_OT_setup_tracking_scene(Operator): need_stabilization = False + # Remove all the nodes if they came from default node setup. + # This is simplest way to make it so final node setup is + # is correct. + self._wipeDefaultNodes(tree) + # create nodes rlayer_fg = self._findOrCreateNode(tree, 'CompositorNodeRLayers') rlayer_bg = tree.nodes.new(type='CompositorNodeRLayers') |