flame: adding extensions to loaders

also removing representations from settings and ignoring them in plugin settings loader
This commit is contained in:
Jakub Jezek 2023-02-24 15:19:50 +01:00 committed by Jakub Trllo
parent 339417c505
commit 6d43fa2190
5 changed files with 47 additions and 37 deletions

View file

@ -702,6 +702,37 @@ class ClipLoader(LoaderPlugin):
_mapping = None
def apply_settings(cls, project_settings, system_settings):
plugin_type_settings = (
project_settings
.get("flame", {})
.get("load", {})
)
if not plugin_type_settings:
return
plugin_name = cls.__name__
plugin_settings = None
# Look for plugin settings in host specific settings
if plugin_name in plugin_type_settings:
plugin_settings = plugin_type_settings[plugin_name]
if not plugin_settings:
return
print(">>> We have preset for {}".format(plugin_name))
for option, value in plugin_settings.items():
if option == "enabled" and value is False:
print(" - is disabled by preset")
elif option == "representations":
continue
else:
print(" - setting `{}`: `{}`".format(option, value))
setattr(cls, option, value)
def get_colorspace(self, context):
"""Get colorspace name

View file

@ -4,6 +4,10 @@ import flame
from pprint import pformat
import openpype.hosts.flame.api as opfapi
from openpype.lib import StringTemplate
from openpype.lib.transcoding import (
VIDEO_EXTENSIONS,
IMAGE_EXTENSIONS
)
class LoadClip(opfapi.ClipLoader):
@ -14,7 +18,10 @@ class LoadClip(opfapi.ClipLoader):
"""
families = ["render2d", "source", "plate", "render", "review"]
representations = ["exr", "dpx", "jpg", "jpeg", "png", "h264"]
representations = ["*"]
extensions = set(
ext.lstrip(".") for ext in IMAGE_EXTENSIONS.union(VIDEO_EXTENSIONS)
)
label = "Load as clip"
order = -10

View file

@ -4,7 +4,10 @@ import flame
from pprint import pformat
import openpype.hosts.flame.api as opfapi
from openpype.lib import StringTemplate
from openpype.lib.transcoding import (
VIDEO_EXTENSIONS,
IMAGE_EXTENSIONS
)
class LoadClipBatch(opfapi.ClipLoader):
"""Load a subset to timeline as clip
@ -14,7 +17,10 @@ class LoadClipBatch(opfapi.ClipLoader):
"""
families = ["render2d", "source", "plate", "render", "review"]
representations = ["exr", "dpx", "jpg", "jpeg", "png", "h264"]
representations = ["*"]
extensions = set(
ext.lstrip(".") for ext in IMAGE_EXTENSIONS.union(VIDEO_EXTENSIONS)
)
label = "Load as clip to current batch"
order = -10

View file

@ -114,17 +114,6 @@
"render",
"review"
],
"representations": [
"exr",
"dpx",
"jpg",
"jpeg",
"png",
"h264",
"mov",
"mp4",
"exr16fpdwaa"
],
"reel_group_name": "OpenPype_Reels",
"reel_name": "Loaded",
"clip_name_template": "{asset}_{subset}<_{output}>",
@ -143,17 +132,6 @@
"render",
"review"
],
"representations": [
"exr",
"dpx",
"jpg",
"jpeg",
"png",
"h264",
"mov",
"mp4",
"exr16fpdwaa"
],
"reel_name": "OP_LoadedReel",
"clip_name_template": "{batch}_{asset}_{subset}<_{output}>",
"layer_rename_template": "{asset}_{subset}<_{output}>",

View file

@ -494,12 +494,6 @@
"label": "Families",
"object_type": "text"
},
{
"type": "list",
"key": "representations",
"label": "Representations",
"object_type": "text"
},
{
"type": "separator"
},
@ -552,12 +546,6 @@
"label": "Families",
"object_type": "text"
},
{
"type": "list",
"key": "representations",
"label": "Representations",
"object_type": "text"
},
{
"type": "separator"
},