Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maya: Account for no placeholder set. #459

Merged
merged 5 commits into from
Apr 30, 2024
Merged

Conversation

tokejepsen
Copy link
Member

Changelog Description

When building a template from the current scene with Load template, the below error would occur.

# ==============================
# No object matches name: PLACEHOLDERS_SET
# ==============================
# Traceback (most recent call last):
#   File "C:\Users\tokejepsen\ayon-core\client\ayon_core\pipeline\workfile\workfile_template_builder.py", line 722, in populate_scene_placeholders
#     placeholder_plugin.populate_placeholder(placeholder)
#   File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\maya\api\workfile_template_builder.py", line 246, in populate_placeholder
#     self.populate_load_placeholder(placeholder)
#   File "C:\Users\tokejepsen\ayon-core\client\ayon_core\pipeline\workfile\workfile_template_builder.py", line 1639, in populate_load_placeholder
#     self.post_placeholder_process(placeholder, failed)
#   File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\maya\api\workfile_template_builder.py", line 266, in post_placeholder_process
#     cmds.sets(node, addElement=PLACEHOLDER_SET)
TypeError: No object matches name: PLACEHOLDERS_SET

Testing notes:

  1. Open new scene in Maya.
  2. Using Loader on a workfile or mayaScene, prepped as a template, using Load as template.

@BigRoy
Copy link
Collaborator

BigRoy commented Apr 29, 2024

Shouldn't the file you're loading/building with contain the placeholder_SET. If not, does that technically mean you're loading a scene that has no placeholders to begin with so there's nothing to build?

I'm not sure why the placeholder set pre-existing originally was a requirement but I wonder if that not being the case would now hide another issue instead?

@LiborBatek
Copy link
Member

@BigRoy to me its seems like just one unneccessary limitation was removed...I guess you could use just a template file containing loaded assets not any placeholders at all for example?

Copy link
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.

LGTM, I dont experience any kind of errors regarding non existent placeholder set.

image

I guess its good to go...

@BigRoy
Copy link
Collaborator

BigRoy commented Apr 29, 2024

I guess you could use just a template file containing loaded assets not any placeholders at all for example?

Well, that would be odd - no? Since if it has no placeholders, then there's nothing to run in the workfile template system?

@tokejepsen
Copy link
Member Author

Well, that would be odd - no? Since if it has no placeholders, then there's nothing to run in the workfile template system?

I get this when having a blank Maya scene and use the "Load as template" action.

@BigRoy
Copy link
Collaborator

BigRoy commented Apr 30, 2024

I get this when having a blank Maya scene and use the "Load as template" action.

I guess you're building it from a scene that should've contained the placeholder SET to begin with but it didn't?
Again, I technically don't know why the set was required to begin with so I'm not too bother by the change. Just wonder whether there originally was reason for it to be required :D

Copy link
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.

Looks fine to me.

# Conflicts:
#	client/ayon_core/hosts/maya/api/workfile_template_builder.py
@LiborBatek
Copy link
Member

LiborBatek commented Apr 30, 2024

just did one more test with practically empty template file and all good...it behaves predictably and also gives warning msg if no placeholders found

WRN: >>> { <ayon_core.hosts.maya.api.workfile_template_builder.MayaTemplateBuilder object at 0x000001CA288A7160> }: [ No placeholders were found. ] 

Copy link
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.

I did tested and works ok.

@antirotor antirotor merged commit e4c9466 into develop Apr 30, 2024
1 check failed
@antirotor antirotor deleted the bugfix/maya_placeholder_set branch April 30, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya size/XS type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants