Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Resolve: Match folder structure to other hosts #3653

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions openpype/hosts/resolve/__init__.py
Original file line number Diff line number Diff line change
@@ -1,129 +0,0 @@
from .api.utils import (
setup,
get_resolve_module
)

from .api.pipeline import (
install,
uninstall,
ls,
containerise,
update_container,
publish,
launch_workfiles_app,
maintained_selection,
remove_instance,
list_instances
)

from .api.lib import (
maintain_current_timeline,
publish_clip_color,
get_project_manager,
get_current_project,
get_current_timeline,
create_bin,
get_media_pool_item,
create_media_pool_item,
create_timeline_item,
get_timeline_item,
get_video_track_names,
get_current_timeline_items,
get_pype_timeline_item_by_name,
get_timeline_item_pype_tag,
set_timeline_item_pype_tag,
imprint,
set_publish_attribute,
get_publish_attribute,
create_compound_clip,
swap_clips,
get_pype_clip_metadata,
set_project_manager_to_folder_name,
get_otio_clip_instance_data,
get_reformated_path
)

from .api.menu import launch_pype_menu

from .api.plugin import (
ClipLoader,
TimelineItemLoader,
Creator,
PublishClip
)

from .api.workio import (
open_file,
save_file,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)

from .api.testing_utils import TestGUI


__all__ = [
# pipeline
"install",
"uninstall",
"ls",
"containerise",
"update_container",
"reload_pipeline",
"publish",
"launch_workfiles_app",
"maintained_selection",
"remove_instance",
"list_instances",

# utils
"setup",
"get_resolve_module",

# lib
"maintain_current_timeline",
"publish_clip_color",
"get_project_manager",
"get_current_project",
"get_current_timeline",
"create_bin",
"get_media_pool_item",
"create_media_pool_item",
"create_timeline_item",
"get_timeline_item",
"get_video_track_names",
"get_current_timeline_items",
"get_pype_timeline_item_by_name",
"get_timeline_item_pype_tag",
"set_timeline_item_pype_tag",
"imprint",
"set_publish_attribute",
"get_publish_attribute",
"create_compound_clip",
"swap_clips",
"get_pype_clip_metadata",
"set_project_manager_to_folder_name",
"get_otio_clip_instance_data",
"get_reformated_path",

# menu
"launch_pype_menu",

# plugin
"ClipLoader",
"TimelineItemLoader",
"Creator",
"PublishClip",

# workio
"open_file",
"save_file",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",

"TestGUI"
]
134 changes: 130 additions & 4 deletions openpype/hosts/resolve/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,137 @@
"""
resolve api
"""
import os

bmdvr = None
bmdvf = None

API_DIR = os.path.dirname(os.path.abspath(__file__))
HOST_DIR = os.path.dirname(API_DIR)
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
from .utils import (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file

get_resolve_module
)

from .pipeline import (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file

install,
uninstall,
ls,
containerise,
update_container,
publish,
launch_workfiles_app,
maintained_selection,
remove_instance,
list_instances
)

from .lib import (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file

maintain_current_timeline,
publish_clip_color,
get_project_manager,
get_current_project,
get_current_timeline,
create_bin,
get_media_pool_item,
create_media_pool_item,
create_timeline_item,
get_timeline_item,
get_video_track_names,
get_current_timeline_items,
get_pype_timeline_item_by_name,
get_timeline_item_pype_tag,
set_timeline_item_pype_tag,
imprint,
set_publish_attribute,
get_publish_attribute,
create_compound_clip,
swap_clips,
get_pype_clip_metadata,
set_project_manager_to_folder_name,
get_otio_clip_instance_data,
get_reformated_path
)

from .menu import launch_pype_menu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file


from .plugin import (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file

ClipLoader,
TimelineItemLoader,
Creator,
PublishClip
)

from .workio import (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file

open_file,
save_file,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)

from .testing_utils import TestGUI
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module level import not at top of file



__all__ = [
"bmdvr",
"bmdvf",

# pipeline
"install",
"uninstall",
"ls",
"containerise",
"update_container",
"reload_pipeline",
"publish",
"launch_workfiles_app",
"maintained_selection",
"remove_instance",
"list_instances",

# utils
"get_resolve_module",

# lib
"maintain_current_timeline",
"publish_clip_color",
"get_project_manager",
"get_current_project",
"get_current_timeline",
"create_bin",
"get_media_pool_item",
"create_media_pool_item",
"create_timeline_item",
"get_timeline_item",
"get_video_track_names",
"get_current_timeline_items",
"get_pype_timeline_item_by_name",
"get_timeline_item_pype_tag",
"set_timeline_item_pype_tag",
"imprint",
"set_publish_attribute",
"get_publish_attribute",
"create_compound_clip",
"swap_clips",
"get_pype_clip_metadata",
"set_project_manager_to_folder_name",
"get_otio_clip_instance_data",
"get_reformated_path",

# menu
"launch_pype_menu",

# plugin
"ClipLoader",
"TimelineItemLoader",
"Creator",
"PublishClip",

# workio
"open_file",
"save_file",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",

"TestGUI"
]
2 changes: 1 addition & 1 deletion openpype/hosts/resolve/api/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pyblish.api


from ...action import get_errored_instances_from_context
from openpype.action import get_errored_instances_from_context


class SelectInvalidAction(pyblish.api.Action):
Expand Down
6 changes: 3 additions & 3 deletions openpype/hosts/resolve/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import os
import contextlib
from opentimelineio import opentime

from openpype.lib import Logger
from openpype.pipeline.editorial import is_overlapping_otio_ranges

from ..otio import davinci_export as otio_export

from openpype.api import Logger

log = Logger().get_logger(__name__)
log = Logger.get_logger(__name__)

self = sys.modules[__name__]
self.project_manager = None
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/resolve/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

from Qt import QtWidgets, QtCore

from openpype.tools.utils import host_tools

from .pipeline import (
publish,
launch_workfiles_app
)

from openpype.tools.utils import host_tools


def load_stylesheet():
path = os.path.join(os.path.dirname(__file__), "menu_style.qss")
Expand Down
13 changes: 8 additions & 5 deletions openpype/hosts/resolve/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pyblish import api as pyblish

from openpype.api import Logger
from openpype.lib import Logger
from openpype.pipeline import (
schema,
register_loader_plugin_path,
Expand All @@ -16,11 +16,15 @@
deregister_creator_plugin_path,
AVALON_CONTAINER_ID,
)
from . import lib
from . import PLUGINS_DIR
from openpype.tools.utils import host_tools
log = Logger().get_logger(__name__)

from . import lib
from .utils import get_resolve_module

log = Logger.get_logger(__name__)

HOST_DIR = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "create")
Expand All @@ -39,7 +43,6 @@ def install():
See the Maya equivalent for inspiration on how to implement this.

"""
from .. import get_resolve_module

log.info("openpype.hosts.resolve installed")

Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/resolve/api/preload_console.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
import time
from openpype.hosts.resolve.utils import get_resolve_module
from openpype.api import Logger
from openpype.lib import Logger

log = Logger().get_logger(__name__)
log = Logger.get_logger(__name__)

wait_delay = 2.5
wait = 0.00
Expand Down
Loading