feat(resolve): collect workfile

This commit is contained in:
Jakub Jezek 2020-12-01 15:03:06 +01:00
parent 727ce8b0f7
commit 60213ecc5d
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3

View file

@ -2,6 +2,7 @@ import os
import pyblish.api
from pype.hosts import resolve
from avalon import api as avalon
from pprint import pformat
class CollectWorkfile(pyblish.api.ContextPlugin):
@ -18,6 +19,7 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
project = resolve.get_current_project()
name = project.GetName()
fps = project.GetSetting("timelineFrameRate")
base_name = name + exported_projet_ext
current_file = os.path.join(staging_dir, base_name)
@ -27,17 +29,18 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
video_tracks = resolve.get_video_track_names()
# set main project attributes to context
context.data["activeProject"] = project
context.data["activeSequence"] = active_sequence
context.data["videoTracks"] = video_tracks
context.data["currentFile"] = current_file
self.log.info("currentFile: {}".format(current_file))
context.data.update({
"activeProject": project,
"activeSequence": active_sequence,
"videoTracks": video_tracks,
"currentFile": current_file,
"fps": fps,
})
# creating workfile representation
representation = {
'name': 'hrox',
'ext': 'hrox',
'name': exported_projet_ext[1:],
'ext': exported_projet_ext[1:],
'files': base_name,
"stagingDir": staging_dir,
}
@ -56,3 +59,4 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
instance = context.create_instance(**instance_data)
self.log.info("Creating instance: {}".format(instance))
self.log.debug("__ instance.data: {}".format(pformat(instance.data)))