-
Notifications
You must be signed in to change notification settings - Fork 128
[QUAD] Maya Publish Collect Handles: Add new collector to fix issues with the handles for render #6297
base: develop
Are you sure you want to change the base?
[QUAD] Maya Publish Collect Handles: Add new collector to fix issues with the handles for render #6297
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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']}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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']}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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']}") |
There was a problem hiding this comment.
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)