mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix extract template and palettes thumbnails on mac
This commit is contained in:
parent
762789d145
commit
0dacc5ca0e
3 changed files with 14 additions and 5 deletions
|
|
@ -183,11 +183,11 @@ PypeHarmony.color = function(rgba) {
|
|||
/**
|
||||
* get all dependencies for given node.
|
||||
* @function
|
||||
* @param {string} node node path.
|
||||
* @param {string} _node node path.
|
||||
* @return {array} List of dependent nodes.
|
||||
*/
|
||||
PypeHarmony.getDependencies = function(node) {
|
||||
var target_node = node;
|
||||
PypeHarmony.getDependencies = function(_node) {
|
||||
var target_node = _node;
|
||||
var numInput = node.numberOfInputPorts(target_node);
|
||||
var dependencies = [];
|
||||
for (var i = 0 ; i < numInput; i++) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class ExtractPalette(pype.api.Extractor):
|
|||
os.path.basename(palette_file)
|
||||
.split(".plt")[0] + "_swatches.png"
|
||||
)
|
||||
self.log.info(f"Temporary humbnail path {tmp_thumb_path}")
|
||||
self.log.info(f"Temporary thumbnail path {tmp_thumb_path}")
|
||||
|
||||
palette_version = str(instance.data.get("version")).zfill(3)
|
||||
|
||||
|
|
@ -52,6 +52,11 @@ class ExtractPalette(pype.api.Extractor):
|
|||
palette_version,
|
||||
palette_file,
|
||||
tmp_thumb_path)
|
||||
except OSError as e:
|
||||
# FIXME: this happens on Mac where PIL cannot access fonts
|
||||
# for some reason.
|
||||
self.log.warning("Thumbnail generation failed")
|
||||
self.log.warning(e)
|
||||
except ValueError:
|
||||
self.log.error("Unsupported palette type for thumbnail.")
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ class ExtractTemplate(pype.api.Extractor):
|
|||
for backdrop in self.get_backdrops(dependency):
|
||||
backdrops[backdrop["title"]["text"]] = backdrop
|
||||
unique_backdrops = [backdrops[x] for x in set(backdrops.keys())]
|
||||
|
||||
if not unique_backdrops:
|
||||
self.log.error(("No backdrops detected for template. "
|
||||
"Please move template instance node onto "
|
||||
"some backdrop and try again."))
|
||||
raise AssertionError("No backdrop detected")
|
||||
# Get non-connected nodes within backdrops.
|
||||
all_nodes = instance.context.data.get("allNodes")
|
||||
for node in [x for x in all_nodes if x not in dependencies]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue