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

[QUAD] Maya Publish Collect Handles: Add new collector to fix issues with the handles for render #6297

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
54 changes: 54 additions & 0 deletions openpype/hosts/maya/plugins/publish/collect_handles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import pyblish.api


class CollectHandles(pyblish.api.InstancePlugin):
"""
OpenPype collector for handling animation-related tasks.
It checks the include handle settings of the project, determines whether to include/exclude handles
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (103 > 79 characters)

based on the current task, and initializes handle values accordingly.
Attributes:
order (int): The order of execution for this extractor.
label (str): The label used to identify this extractor.
families (list): List of families to which this extractor is applicable.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

"""
order = pyblish.api.CollectorOrder + 0.4999999
label = "Collect Handles"
families = ["animation",
"pointcache",
"camera",
"proxyAbc",
"renderlayer",
"review",
"yeticache"]

def process(self, instance):
# Check the include handle settings of the actual project
include_handles_settings = instance.context.data["project_settings"]["maya"]["include_handles"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (103 > 79 characters)

current_task = instance.context.data["anatomyData"]["task"]["name"]
include_task = include_handles_settings["include_handles_default"]

# Log information about the current task and handle settings
self.log.info(f"Processing instance: {instance.name}")
self.log.info(f"Current Task: {current_task}")
self.log.info(f"Include Handles Default: {include_task}")

# Define if we had to include/exclude the handles
for item in include_handles_settings["per_task_type"]:
if current_task in item["task_type"]:
include_task = item["include_handles"]
break

# if we exclude, initialize handles values to origin(frame start, frame end)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (84 > 79 characters)

if not include_task:
instance.context.data["frameStartHandle"] = int(instance.context.data.get("frameStart"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (100 > 79 characters)

instance.context.data["frameEndHandle"] = int(instance.context.data.get("frameEnd"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (96 > 79 characters)

instance.context.data["handleStart"] = 0
instance.context.data["handleEnd"] = 0

# Log information about the handle values initialization
self.log.info("Handles excluded.")

self.log.info(f"Frame Start Handle: {instance.context.data['frameStartHandle']}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

self.log.info(f"Frame End Handle: {instance.context.data['frameEndHandle']}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (85 > 79 characters)

self.log.info(f"Handle Start: {instance.context.data['handleStart']}")
self.log.info(f"Handle End: {instance.context.data['handleEnd']}")
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@
"collapsible": true,
"label": "Include/Exclude Handles in default playback & render range",
"children": [
{
"type": "label",
"label": "WARNING: Do not add the same task in multiple items of the include/exclude list below."
},
{
"key": "include_handles_default",
"label": "Include handles by default",
Expand Down
Loading