diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 6d4bda5d2ae..9eaae3e5e72 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -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 + if options is None: options = {} name = context["representation"]["name"] @@ -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 diff --git a/openpype/hosts/maya/plugins/load/load_reference.py b/openpype/hosts/maya/plugins/load/load_reference.py index a4ab6c79c18..1a2dab2a426 100644 --- a/openpype/hosts/maya/plugins/load/load_reference.py +++ b/openpype/hosts/maya/plugins/load/load_reference.py @@ -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) + def _lock_camera_transforms(self, nodes): cameras = cmds.ls(nodes, type="camera") if not cameras: