This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2128 from pypeclub/feature/PYPE-1907_nuke--OpenPy…
…pe-switch-asset-not-working-
- Loading branch information
Showing
12 changed files
with
503 additions
and
793 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
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
37 changes: 37 additions & 0 deletions
37
openpype/hosts/nuke/plugins/inventory/repair_old_loaders.py
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from avalon import api, style | ||
from avalon.nuke import lib as anlib | ||
from openpype.api import ( | ||
Logger) | ||
|
||
|
||
class RepairOldLoaders(api.InventoryAction): | ||
|
||
label = "Repair Old Loaders" | ||
icon = "gears" | ||
color = style.colors.alert | ||
|
||
log = Logger().get_logger(__name__) | ||
|
||
def process(self, containers): | ||
import nuke | ||
new_loader = "LoadClip" | ||
|
||
for cdata in containers: | ||
orig_loader = cdata["loader"] | ||
orig_name = cdata["objectName"] | ||
if orig_loader not in ["LoadSequence", "LoadMov"]: | ||
self.log.warning( | ||
"This repair action is only working on " | ||
"`LoadSequence` and `LoadMov` Loaders") | ||
continue | ||
|
||
new_name = orig_name.replace(orig_loader, new_loader) | ||
node = nuke.toNode(cdata["objectName"]) | ||
|
||
cdata.update({ | ||
"loader": new_loader, | ||
"objectName": new_name | ||
}) | ||
node["name"].setValue(new_name) | ||
# get data from avalon knob | ||
anlib.set_avalon_knob_data(node, cdata) |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.