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

[QUAD] Enhancement: Ability to change the animation instance active state from the Loader Arguments (Placeholder Manager) #6348

Open
wants to merge 2 commits 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
9 changes: 7 additions & 2 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3865,9 +3865,11 @@ def create_rig_animation_instance(
log (logging.Logger, optional): Logger to log to if provided

Returns:
None
instance (Any)

"""
subset_name = None
Copy link

Choose a reason for hiding this comment

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

local variable 'subset_name' is assigned to but never used


if options is None:
options = {}
name = context["representation"]["name"]
Expand Down Expand Up @@ -3921,8 +3923,11 @@ def create_rig_animation_instance(
rig_sets = [s for s in rig_sets if s is not None]
with maintained_selection():
cmds.select(rig_sets + roots, noExpand=True)
create_context.create(
new_context = create_context.create(
creator_identifier=creator_identifier,
variant=namespace,
pre_create_data={"use_selection": True}
)
instance = new_context.get("subset", None)

return instance
8 changes: 6 additions & 2 deletions openpype/hosts/maya/plugins/load/load_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,16 @@ def update(self, container, representation):
self._lock_camera_transforms(members)

def _post_process_rig(self, namespace, context, options):

nodes = self[:]
create_rig_animation_instance(
animation_instance = create_rig_animation_instance(
nodes, context, namespace, options=options, log=self.log
)

if animation_instance:
active_value = options.get("active")
if active_value is not None:
cmds.setAttr("{}.active".format(animation_instance), active_value)
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 (82 > 79 characters)


def _lock_camera_transforms(self, nodes):
cameras = cmds.ls(nodes, type="camera")
if not cameras:
Expand Down
Loading