mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Add collect workfile to blender host
This commit is contained in:
parent
976ff308e9
commit
10aea1088a
1 changed files with 38 additions and 0 deletions
38
openpype/hosts/blender/plugins/publish/collect_workfile.py
Normal file
38
openpype/hosts/blender/plugins/publish/collect_workfile.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from pyblish.api import InstancePlugin, CollectorOrder
|
||||
|
||||
|
||||
class CollectWorkfile(InstancePlugin):
|
||||
"""Inject workfile data into its instance."""
|
||||
|
||||
order = CollectorOrder
|
||||
label = "Collect Workfile"
|
||||
hosts = ["blender"]
|
||||
families = ["workfile"]
|
||||
|
||||
def process(self, instance):
|
||||
"""Process collector."""
|
||||
|
||||
context = instance.context
|
||||
filepath = Path(context.data["currentFile"])
|
||||
ext = filepath.suffix
|
||||
|
||||
instance.data.update(
|
||||
{
|
||||
"setMembers": [filepath.as_posix()],
|
||||
"frameStart": context.data.get("frameStart", 1),
|
||||
"frameEnd": context.data.get("frameEnd", 1),
|
||||
"handleStart": context.data.get("handleStart", 1),
|
||||
"handledEnd": context.data.get("handleEnd", 1),
|
||||
"representations": [
|
||||
{
|
||||
"name": ext.lstrip("."),
|
||||
"ext": ext,
|
||||
"files": filepath.name, # TODO resources
|
||||
"stagingDir": filepath.parent,
|
||||
}
|
||||
],
|
||||
}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue