mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
feat(resolve): collect workfile
This commit is contained in:
parent
727ce8b0f7
commit
60213ecc5d
1 changed files with 12 additions and 8 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue