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

Simple tvpaint publish #1555

Merged
merged 3 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions openpype/hosts/tvpaint/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@


def on_instance_toggle(instance, old_value, new_value):
# Review may not have real instance in wokrfile metadata
if not instance.data.get("uuid"):
return

instance_id = instance.data["uuid"]
found_idx = None
current_instances = pipeline.list_instances()
Expand Down
19 changes: 0 additions & 19 deletions openpype/hosts/tvpaint/plugins/create/create_review.py

This file was deleted.

24 changes: 24 additions & 0 deletions openpype/hosts/tvpaint/plugins/publish/collect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ def process(self, context):
json.dumps(workfile_instances, indent=4)
))

# Backwards compatibility for workfiles that already have review
# instance in metadata.
review_instance_exist = False
for instance_data in workfile_instances:
if instance_data["family"] == "review":
review_instance_exist = True
break

# Fake review instance if review was not found in metadata families
if not review_instance_exist:
workfile_instances.append(
self._create_review_instance_data(context)
)

for instance_data in workfile_instances:
instance_data["fps"] = context.data["sceneFps"]

Expand Down Expand Up @@ -90,6 +104,16 @@ def process(self, context):
instance, json.dumps(instance.data, indent=4)
))

def _create_review_instance_data(self, context):
"""Fake review instance data."""

return {
"family": "review",
"asset": context.data["workfile_context"]["asset"],
# Dummy subset name
"subset": "reviewMain"
}

def create_render_layer_instance(self, context, instance_data):
name = instance_data["name"]
# Change label
Expand Down