mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
loader plugin for DJV has hardcoded extensions and path to DJV is taken from DJV_PATH
This commit is contained in:
parent
f9645b7ddb
commit
258d76ce6d
1 changed files with 13 additions and 28 deletions
|
|
@ -1,34 +1,27 @@
|
|||
import os
|
||||
import subprocess
|
||||
import json
|
||||
from pype.api import config
|
||||
from avalon import api
|
||||
|
||||
|
||||
def get_families():
|
||||
families = []
|
||||
paths = config.get_presets().get("djv_view", {}).get("config", {}).get(
|
||||
"djv_paths", []
|
||||
)
|
||||
for path in paths:
|
||||
def existing_djv_path():
|
||||
djv_paths = os.environ.get("DJV_PATH") or ""
|
||||
for path in djv_paths.split(os.pathsep):
|
||||
if os.path.exists(path):
|
||||
families.append("*")
|
||||
break
|
||||
return families
|
||||
|
||||
|
||||
def get_representation():
|
||||
return config.get_presets().get("djv_view", {}).get("config", {}).get(
|
||||
'file_ext', []
|
||||
)
|
||||
return path
|
||||
return None
|
||||
|
||||
|
||||
class OpenInDJV(api.Loader):
|
||||
"""Open Image Sequence with system default"""
|
||||
|
||||
config_data = config.get_presets().get("djv_view", {}).get("config", {})
|
||||
families = get_families()
|
||||
representations = get_representation()
|
||||
djv_path = existing_djv_path()
|
||||
families = ["*"] if djv_path else []
|
||||
representations = [
|
||||
"cin", "dpx", "avi", "dv", "gif", "flv", "mkv", "mov", "mpg", "mpeg",
|
||||
"mp4", "m4v", "mxf", "iff", "z", "ifl", "jpeg", "jpg", "jfif", "lut",
|
||||
"1dl", "exr", "pic", "png", "ppm", "pnm", "pgm", "pbm", "rla", "rpf",
|
||||
"sgi", "rgba", "rgb", "bw", "tga", "tiff", "tif", "img"
|
||||
]
|
||||
|
||||
label = "Open in DJV"
|
||||
order = -10
|
||||
|
|
@ -36,14 +29,6 @@ class OpenInDJV(api.Loader):
|
|||
color = "orange"
|
||||
|
||||
def load(self, context, name, namespace, data):
|
||||
self.djv_path = None
|
||||
paths = config.get_presets().get("djv_view", {}).get("config", {}).get(
|
||||
"djv_paths", []
|
||||
)
|
||||
for path in paths:
|
||||
if os.path.exists(path):
|
||||
self.djv_path = path
|
||||
break
|
||||
directory = os.path.dirname(self.fname)
|
||||
from avalon.vendor import clique
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue