-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed publish updates issues with tk-multi-breakdown hook. Added a co…
…uple of missing imports in tk-multi-loader2 hook.
- Loading branch information
1 parent
90caf9c
commit eace773
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,25 @@ | |
__email__ = "[email protected]" | ||
|
||
|
||
|
||
|
||
class NatronBreakdownSceneResource(str): | ||
""" | ||
Helper Class to store metadata per update item. | ||
tk-multi-breakdown requires item['node'] to be a str. This is what is displayed in | ||
the list of recognized items to update. We want to add metadata to each item | ||
as what we want to pass to update is the parameter and not the node itself. | ||
python friendly object + __repr__ magic method. | ||
""" | ||
|
||
def __new__(cls, node, parameter): | ||
text = "%s" % node | ||
obj = str.__new__(cls, text) | ||
obj.parameter = parameter | ||
return obj | ||
|
||
|
||
class BreakdownSceneOperations(Hook): | ||
""" | ||
Breakdown operations for Natron. | ||
|
@@ -59,7 +78,7 @@ def scan_scene(self): | |
file_param = node.getParam('filename') | ||
ref_path = file_param.getValue() | ||
ref_path = ref_path.replace("/", os.path.sep) | ||
refs.append({"attr": node, "type": "file", "path": ref_path}) | ||
refs.append({"node": NatronBreakdownSceneResource(node, file_param), "type": "file", "path": ref_path}) | ||
|
||
return refs | ||
|
||
|
@@ -79,7 +98,8 @@ def update(self, items): | |
engine = self.parent.engine | ||
|
||
for i in items: | ||
node = i["attr"] | ||
node = i["node"] | ||
attr = node.parameter | ||
node_type = i["type"] | ||
new_path = i["path"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
|
||
import os | ||
import sgtk | ||
import re | ||
import glob | ||
from sgtk.errors import TankError | ||
|
||
import NatronGui | ||
|