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

Maya: Optional preserve references.#5994

Merged
antirotor merged 6 commits intoynput:developfrom
tokejepsen:enhancement/maya_scene_preserve_references
Dec 21, 2023
Merged

Maya: Optional preserve references.#5994
antirotor merged 6 commits intoynput:developfrom
tokejepsen:enhancement/maya_scene_preserve_references

Conversation

@tokejepsen
Copy link
Copy Markdown
Contributor

Changelog Description

Optional preserve references when publishing Maya scenes.

Testing notes:

  1. Create Maya scene with a reference in.
  2. Create MayaScene and publish with disabled Preserve References.

@tokejepsen tokejepsen requested a review from LiborBatek December 4, 2023 15:41
@tokejepsen tokejepsen self-assigned this Dec 4, 2023
@ynbot ynbot added size/XS Denotes a PR changes 0-99 lines, ignoring general files host: Maya type: enhancement Enhancements to existing functionality labels Dec 4, 2023
@BigRoy
Copy link
Copy Markdown
Collaborator

BigRoy commented Dec 4, 2023

Should this attribute definition instead maybe be on the extractor instead of the creator since it's so related to this extractor.

@tokejepsen
Copy link
Copy Markdown
Contributor Author

Should this attribute definition instead maybe be on the extractor instead of the creator since it's so related to this extractor.
@BigRoy do you mean putting it as a class attribute? Like here:

label = "Maya Scene (Raw)"
hosts = ["maya"]
families = ["mayaAscii",
"mayaScene",
"setdress",
"layout",
"camerarig"]
scene_type = "ma"

@BigRoy
Copy link
Copy Markdown
Collaborator

BigRoy commented Dec 4, 2023

No, as get_attribute_defs like here.

Values are then retrieved like so.

Note to also inherit from OpenPypePyblishPluginMixin or the OptionalPyblishPluginMixin.

@moonyuet
Copy link
Copy Markdown
Member

moonyuet commented Dec 6, 2023

No, as get_attribute_defs like here.

Values are then retrieved like so.

Note to also inherit from OpenPypePyblishPluginMixin or the OptionalPyblishPluginMixin.

I agree and I have a question on whether we need OP/AYON setting which pre-sets the particular option as we are adding the setting in the creator?
If yes, it also probably needs apply_settings function to sync the OP/AYON setting to align with the creator setting.

def apply_settings(self, project_settings):
        # your code....

If no, it is just perhaps adding the setting into the extractor and add get_attribute_defs function. And call the value back with some_values = self.get_attr_values_from_data(instance.data) (like BigRoy said).

@tokejepsen tokejepsen requested a review from BigRoy December 6, 2023 08:07
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Copy link
Copy Markdown
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

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

Didn't test it but overall the code looks good to me. Likely @LiborBatek can do a test run and @iLLiCiTiT can look into the open conversation.

Copy link
Copy Markdown
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Did tests in maya 2023 and maya 2024 also with Legacy and Ayon modes...

all working fine for mayaScene family when Preserve References being ON

image

and when OFF the references are no longer present in the asset:

image

So all working as expected!

@antirotor antirotor merged commit c2a8f19 into ynput:develop Dec 21, 2023
@ynbot ynbot added this to the next-patch milestone Dec 21, 2023
@tokejepsen tokejepsen deleted the enhancement/maya_scene_preserve_references branch December 21, 2023 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community contribution host: Maya size/XS Denotes a PR changes 0-99 lines, ignoring general files type: enhancement Enhancements to existing functionality

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants