flame: fixing flame compatibility and python2

This commit is contained in:
Jakub Jezek 2022-04-08 12:52:27 +02:00
parent bfae95a847
commit 72ecb6192a
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
4 changed files with 6 additions and 11 deletions

View file

@ -57,7 +57,6 @@ from .plugin import (
PublishableClip, PublishableClip,
ClipLoader, ClipLoader,
OpenClipSolver OpenClipSolver
) )
from .workio import ( from .workio import (
open_file, open_file,

View file

@ -708,7 +708,7 @@ def maintained_temp_file_path(suffix=None):
except IOError as _error: except IOError as _error:
raise IOError( raise IOError(
"Not able to create temp json file: {}".format(_error)) from _error "Not able to create temp json file: {}".format(_error))
finally: finally:
# Remove the temporary json # Remove the temporary json
@ -860,7 +860,7 @@ class MediaInfoFile:
openpype.run_subprocess(cmd_args) openpype.run_subprocess(cmd_args)
except TypeError as error: except TypeError as error:
raise TypeError( raise TypeError(
"Error creating `{}` due: {}".format(fpath, error)) from error "Error creating `{}` due: {}".format(fpath, error))
def _make_single_clip_media_info(self, fpath): def _make_single_clip_media_info(self, fpath):
with open(fpath) as f: with open(fpath) as f:
@ -923,4 +923,4 @@ class MediaInfoFile:
) )
except IOError as error: except IOError as error:
raise IOError( raise IOError(
"Not able to write data to file: {}".format(error)) from error "Not able to write data to file: {}".format(error))

View file

@ -1,15 +1,11 @@
import itertools
import os import os
import re import re
import shutil import shutil
import sys
import xml.etree.cElementTree as cET
from copy import deepcopy from copy import deepcopy
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
import openpype.api as openpype import openpype.api as openpype
import qargparse import qargparse
import six
from openpype import style from openpype import style
from openpype.pipeline import LegacyCreator, LoaderPlugin from openpype.pipeline import LegacyCreator, LoaderPlugin
from Qt import QtCore, QtWidgets from Qt import QtCore, QtWidgets
@ -740,6 +736,7 @@ class OpenClipSolver(flib.MediaInfoFile):
def _create_new_open_clip(self): def _create_new_open_clip(self):
self.log.info("Building new openClip") self.log.info("Building new openClip")
self.log.debug(">> self.clip_data: {}".format(self.clip_data))
# clip data comming from MediaInfoFile # clip data comming from MediaInfoFile
tmp_xml_feeds = self.clip_data.find('tracks/track/feeds') tmp_xml_feeds = self.clip_data.find('tracks/track/feeds')

View file

@ -7,13 +7,10 @@ import json
import logging import logging
import opentimelineio as otio import opentimelineio as otio
from . import utils from . import utils
from openpype.hosts.flame.api import MediaInfoFile
import flame import flame
from pprint import pformat from pprint import pformat
reload(utils) # noqa
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -331,6 +328,8 @@ def create_otio_reference(clip_data, fps=None):
def create_otio_clip(clip_data): def create_otio_clip(clip_data):
from openpype.hosts.flame.api import MediaInfoFile
segment = clip_data["PySegment"] segment = clip_data["PySegment"]
# calculate source in # calculate source in