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: Fix Maya Alembic Extractors #478

Merged

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented May 1, 2024

Changelog Description

Fix Alembic extractors after PR #336

Additional info

Quick attempt to fix bug:

Traceback (most recent call last):
  File "C:\Users\Maqina-02\AppData\Local\Ynput\AYON\dependency_packages\ayon_2404022047_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\Maqina-02\AppData\Local\Ynput\AYON\addons\core_0.3.1-dev.3\ayon_core\hosts\maya\plugins\publish\validate_alembic_options_defaults.py", line 46, in process
    attributes = self._get_publish_attributes(instance)
  File "C:\Users\Maqina-02\AppData\Local\Ynput\AYON\addons\core_0.3.1-dev.3\ayon_core\hosts\maya\plugins\publish\validate_alembic_options_defaults.py", line 33, in _get_publish_attributes
    cls.plugin_name(
TypeError: 'str' object is not callable
DEBUG: Extracting pointcache..
Traceback (most recent call last):
  File "C:\Users\Maqina-02\AppData\Local\Ynput\AYON\dependency_packages\ayon_2404022047_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\Maqina-02\AppData\Local\Ynput\AYON\addons\core_0.3.1-dev.3\ayon_core\hosts\maya\plugins\publish\extract_pointcache.py", line 165, in process
    "writeCreases", self.writeCreases
AttributeError: 'ExtractAnimation' object has no attribute 'writeCreases'
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Ynput\AYON\dependency_packages\ayon_2403071252_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "E:\dev\ayon-core\client\ayon_core\hosts\maya\plugins\publish\extract_pointcache.py", line 218, in process
    extract_alembic(**kwargs)
TypeError: extract_alembic() got an unexpected keyword argument 'userAttr'

This same error also occurred with writeNormals and the python and mel callbacks.

Testing notes:

  1. Publish alembic/pointcache
  2. Test Alembic options default validation
  3. Test Alembic options default repair
  4. Extracting Pointcache Alembic should work for both existing instances and new instances.
  5. Extracting Animation (from loaded rig should work) for both existing instances and new instances.

@BigRoy BigRoy changed the title Maya: Fix Maya Validate Alembic Default Options Maya: Fix Maya Alembic Extractors May 1, 2024
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

make sense, thanks!

@BigRoy
Copy link
Collaborator Author

BigRoy commented May 2, 2024

@LiborBatek could you please do a few thorough test runs of publishing animation and pointcache alembics from Maya. Also check whether the output of the publish contains what you think it should, etc. and or whether there aren't any odd warnings/errors logged anywhere.

I hit so many odd bugs after #336 that I feel we might need some extra testing on these fixes to ensure they are correct.


@tokejepsen The swap from autoSubd to writeCreases attribute - do you see any issues with that? I'm not sure if there was any reason for refactoring that to autoSubd before.

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Tested successfully in Maya 2023.

@tokejepsen
Copy link
Member

do you see any issues with that? I'm not sure if there was any reason for refactoring that to autoSubd before.

Cant see any issues. Thought the autoSubd was part of the available flags, but the PR to implement this was very confusing to keep track of everything.

@BigRoy
Copy link
Collaborator Author

BigRoy commented May 2, 2024

Thought the autoSubd was part of the available flags, but the PR to implement this was very confusing to keep track of everything.

For completeness sake. It is indeed one of the flags for the AbcExport command, but in older versions pre-Maya 2018 it was writeCreases flag that did something similar and was replaced by autoSubd. However, historically writeCreases was already used in Avalon -> OpenPype -> AYON and thus got auto-swapped to autoSubd in the code logic when exporting using AbcExport.

Anyway, so we could go either writeCreases or autoSubd but writeCreases will be easier to maintain backwards compatible to existing instances, I hope.

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.

Getting error when using Validate Alembic Options Defaults

Screenshot 2024-05-03 092609
Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-core\client\ayon_core\hosts\maya\plugins\publish\validate_alembic_options_defaults.py", line 48, in process
    default_value = settings[key]
KeyError: 'flags'

@LiborBatek
Copy link
Member

LiborBatek commented May 3, 2024

Im also a bit curious about ABC settings,

If I use Pre roll and set some value for it like 10 in the Ayon Settings (Maya addon)

Screenshot 2024-05-03 100054

and I also expose those attributes for the user in the publisher... there is simply no way to override those values within the Publisher Settings....as Validate always fails when put something different than in the Ayon settings...

Screenshot 2024-05-03 100237

It can be just different Pre Roll amount of frames or even just disabling of Pre Roll feature

Screenshot 2024-05-03 101124

Is that working as supposed to? Or its just my ignorance and it shouldnt be used or thought using it like this??

Ok I got it...I need to turn Off the Validate Alembic Options Defaults ...maybe this could be mentioned as a hint when the Validation fails...as it could be set differently (some attrib) intentionally by the user...took me a serious amount of time to find this out :)

@LiborBatek
Copy link
Member

@BigRoy regarding that aformentioned error message on Validate Alembic Option Defaults I was able to publish well using different rig asset....just to note (that it happened with just particular asset) ...thinking of it now, the difference was, that the Animation publish instance it the first case was old and this one freshly created...

image

@BigRoy
Copy link
Collaborator Author

BigRoy commented May 3, 2024

Ok I got it...I need to turn Off the Validate Alembic Options Defaults ...maybe this could be mentioned as a hint when the Validation fails...as it could be set differently (some attrib) intentionally by the user...took me a serious amount of time to find this out :)

I've tweaked the validation report:
image


thinking of it now, the difference was, that the Animation publish instance it the first case was old and this one freshly created...

Perfect. Should be caught now with a warning with commit b4b1e2a

@BigRoy BigRoy requested a review from LiborBatek May 3, 2024 15:09
@tokejepsen tokejepsen mentioned this pull request May 5, 2024
1 task
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.

Hmm, Im getting error when trying to use Repair action
...could be because
I have predefined some custom attrib prefixes in the Ayon maya addon settings?! and those arent present in my active workfile on the asset?!

here is scrngrab and copy of the error msg details...

image

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-core\client\ayon_core\pipeline\publish\publish_plugins.py", line 243, in process
    plugin.repair(instance)
  File "C:\Work\REPO\ayon-core\client\ayon_core\hosts\maya\plugins\publish\validate_alembic_options_defaults.py", line 107, in repair
    create_publish_attributes[cls.plugin_name][key] = settings[key]
KeyError: 'flags'

@LiborBatek
Copy link
Member

LiborBatek commented May 6, 2024

@BigRoy when the Animation instance been removed and recreated again all suddenly started to work...also with Repair action being fully working at this occasion too!

image

@LiborBatek
Copy link
Member

also works with the other rig asset...and with Repair action too not causing any error msg at all...

image

@BigRoy
Copy link
Collaborator Author

BigRoy commented May 6, 2024

Hmm, Im getting error when trying to use Repair action ...could be because I have predefined some custom attrib prefixes in the Ayon maya addon settings?! and those arent present in my active workfile on the asset?!

here is scrngrab and copy of the error msg details...

image

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2402141620_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Work\REPO\ayon-core\client\ayon_core\pipeline\publish\publish_plugins.py", line 243, in process
    plugin.repair(instance)
  File "C:\Work\REPO\ayon-core\client\ayon_core\hosts\maya\plugins\publish\validate_alembic_options_defaults.py", line 107, in repair
    create_publish_attributes[cls.plugin_name][key] = settings[key]
KeyError: 'flags'

Thanks for reporting - I indeed missed it in the repair method. Fixed with bd1f7dc

@tokejepsen tokejepsen merged commit 3bf7bfe into ynput:develop May 9, 2024
1 check failed
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