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: Implementation of Ornatrix product type #1

Merged

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Jul 2, 2024

Changelog Description

Implementation of Ornatrix Exports in Maya

  • Ornatrix Rig: Publishing Ornatrix or any Ornatrix related objects. If there are any painted map(s) by user, they are published too and the published maps would be located in the {your publish folder}/resources
  • Ornatrix Cache: Publishing Ornatrix fur simulation as Ornatrix Alembic cache. It can be loaded as Arnold StandIn, Vray Proxy and Alembic reference while it can be loaded as the file cache in the Ornatrix-related GuideFromMeshNode.

Additional info

Although Ornatrix cache loader can add HairfromGuideNode into the operator stack, it can only be shown once into the stack editor (due to some api limitation). Users need to select the objects they want to load the file cache in order to add the cached nodes "safely" into the operator stack. (But users can still find the guide node in the container set)

Requires ayon-core update

Please test along with the branch from this PR ynput/ayon-core#734, otherwise it will error out the collect resources path when publishing

This error hints at that the ayon-core PR branch is not used:

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\maya_0.2.9\ayon_maya\plugins\publish\extract_ornatrix_rig.py", line 43, in process
    image_search_path = instance.data["resourcesDir"]
KeyError: 'resourcesDir

Testing notes:

Ornatrix Rig

  1. Create Ornatrix Rig with your geometry which is assigned with ornatrix fur
  2. Publish
  3. If the content doesn't include the Ornatrix guide, it can't pass the validator.
  4. Texture maps and ma scene would be published along with rigsettings which stores all the ornatrix related parameters.
  5. Start new scene and load the reference scene of the published ornatrix rig
  6. Once you start publisher, the ornatrix cache will be automatically created with the references of the ornatrix rig.
  7. If you load the ornatrix cache, it will create group with a mesh shape which includes the GuideFromMeshNode storing the abc file cache.
  8. You can also load the ornatrix cache with Arnold StandIn, Vray Proxy and Ornatrix Alembic
  9. You can also connect your ornatrix rig with the same meshes located in pointcache and animation product type (select your mesh from pointcache and animation product type first and then your ornatrix product type)
    image

@moonyuet moonyuet marked this pull request as draft July 2, 2024 15:07
@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Jul 2, 2024
@moonyuet moonyuet marked this pull request as ready for review July 3, 2024 04:37
@LiborBatek
Copy link
Member

LiborBatek commented Jul 3, 2024

Im getting error when trying publish oxrigMain because of my source file textures

my files sits within the work folder in ../ornatrix_maps subfolder

C:\Projects\Ayon_Tests\maya\characters\ray\work\fx\ornatrix_maps\densityHair.png
C:\Projects\Ayon_Tests\maya\characters\ray\work\fx\ornatrix_maps\distributionMap.png

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\maya_0.2.9\ayon_maya\plugins\publish\extract_ornatrix_rig.py", line 43, in process
    image_search_path = instance.data["resourcesDir"]
KeyError: 'resourcesDir'

@moonyuet
Copy link
Member Author

moonyuet commented Jul 3, 2024

Im getting error when trying publish oxrigMain because of my source file textures

my files sits within the work folder in ../ornatrix_maps subfolder

C:\Projects\Ayon_Tests\maya\characters\ray\work\fx\ornatrix_maps\densityHair.png C:\Projects\Ayon_Tests\maya\characters\ray\work\fx\ornatrix_maps\distributionMap.png

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\maya_0.2.9\ayon_maya\plugins\publish\extract_ornatrix_rig.py", line 43, in process
    image_search_path = instance.data["resourcesDir"]
KeyError: 'resourcesDir'

@LiborBatek have you installed the addon with this branch? ynput/ayon-core#734

@LiborBatek
Copy link
Member

@moonyuet ouch I have overlooked that needed branch! my bad...sry will do another testing round!

@iLLiCiTiT
Copy link
Member

Please test along with the branch from this PR ynput/ayon-core#734, otherwise it will error out the collect resources path when publishing

If that PR is required for this PR to work, then you have to raise required version of ayon-core to >0.4.0 in package.py.

package.py Outdated Show resolved Hide resolved
@LiborBatek
Copy link
Member

so I was able to produce publish of oxrig this time and load it as oxGroom into new workfile but I was not able to use connect action...
image

it didnt print any log into script editor nor console tho

Im not sure with published .ma representation as it behaves as before bringing in the full character asset with ornatrix setup - do we want that? maybe by first using the locally duplicated meshShape for setting up the Ornatrix rig might do? if we want to follow such workflow...

I wasnt able to perform Load OxCache from the published Ornatrix setup (as a side product when published)? whats the supposed workflow for it?

@LiborBatek
Copy link
Member

as I wasnt able to reconnect to my pointcache animated character I didnt test to produce oxCache for particular shot animation yet... I will try at least on manually connected oxRig to see how it behaves for publishing process...

@moonyuet
Copy link
Member Author

moonyuet commented Jul 3, 2024

as I wasnt able to reconnect to my pointcache animated character I didnt test to produce oxCache for particular shot animation yet... I will try at least on manually connected oxRig to see how it behaves for publishing process...

Once you loaded the Oxcache family, you can find the guide node with cached abc in the container set.
image

@LiborBatek
Copy link
Member

so I was also able to produce oxCache publish on manually setuped oxRig> pointcache animation for particular shot but there is no currently any Action in manage available to the user atm?!

image

@moonyuet
Copy link
Member Author

moonyuet commented Jul 3, 2024

so I was able to produce publish of oxrig this time and load it as oxGroom into new workfile but I was not able to use

so I was also able to produce oxCache publish on manually setuped oxRig> pointcache animation for particular shot but there is no currently any Action in manage available to the user atm?!

image

there is a bug for this, will fix it as soon as possible.

@LiborBatek
Copy link
Member

LiborBatek commented Jul 3, 2024

when manually bringing the published oxCache into the workfile by performing File>Import>OrnatrixAlembic there is a cache loaded into my active workfile but it is not sequenceaka lacks animation and also doesnt look as the oxRig setup ...the hair strands are ackwardly scaled aka thick?!

image

Note: as I have inspected the products created it seems that the ackward look been caused by partial stack of modifiers exported (just guides but not thickness mod etc.) dont know for what reason tho

@moonyuet
Copy link
Member Author

I guess there is a case which geometry is with more than one hair shape and it can still be published?
image

I can still publish without the validator btw.
image

@BigRoy
Copy link
Contributor

BigRoy commented Jul 18, 2024

Based on the discussion here me and @moonyuet have decided to:

  • Lift the single hair shape validation/restriction.
  • Remove the loader for Ornatrix Groom .ZIP (which with that may also remove the Extraction of that actually because then it's unused?)
  • Remove the loader for "Load Ornatrix Cache with Hair Guide" because it's complicated to get it working from an artist's perspective and it seems to suffer from the same bugs.

That brings this PR back to being able to generate Ornatrix RIGs and Alembic caches.

I'll port over the things I remove to another PR but turn that into a draft just so we can release the first feature set now @m-u-r-p-h-y @tatiana-ynput. @moonyuet also mentioned that most likely the client will be using the Extracted alembics anyway by loading into e.g. proxies or alike.

BigRoy added a commit to BigRoy/ayon-maya that referenced this pull request Jul 18, 2024
@BigRoy
Copy link
Contributor

BigRoy commented Jul 18, 2024

So it now works.

HOWEVER, please be aware that the Ornatrix Alembic Loader does NOT import the animation of the cache.

image

I spent way too much time thinking the export didn't include the animation - just to figure out that importer doesn't load it. Arnold Standins do load them and render fine.

@moonyuet it'd be good if you can do review.

We've reverted some logic closer to what @LiborBatek reported issues with - but I was unable whatsoever to reproduce those issues (in any way!), so let's take them with a grain of salt and assume it was user error at the time.

I'll mark it approved so you can check it one more @moonyuet and then can merge it.

@BigRoy BigRoy requested a review from iLLiCiTiT July 18, 2024 17:01
@moonyuet
Copy link
Member Author

So it now works.

HOWEVER, please be aware that the Ornatrix Alembic Loader does NOT import the animation of the cache.

image

I spent way too much time thinking the export didn't include the animation - just to figure out that importer doesn't load it. Arnold Standins do load them and render fine.

@moonyuet it'd be good if you can do review.

We've reverted some logic closer to what @LiborBatek reported issues with - but I was unable whatsoever to reproduce those issues (in any way!), so let's take them with a grain of salt and assume it was user error at the time.

I'll mark it approved so you can check it one more @moonyuet and then can merge it.

Okay good. I will check tomorrow and merge it. Thank you so much for the help!

@moonyuet
Copy link
Member Author

moonyuet commented Jul 19, 2024

@BigRoy Do a simple test and it looks good and we can merge this.

onratrix_video.mp4

@moonyuet moonyuet dismissed stale reviews from antirotor and LiborBatek July 19, 2024 08:08

the style cosmetic is already fixed

@moonyuet moonyuet merged commit 29a2d7c into develop Jul 19, 2024
1 check passed
@moonyuet moonyuet deleted the feature/AY-5677_-Ornatrix_Feature-integrationunit-tests branch July 19, 2024 08:12
@mkolar mkolar assigned moonyuet and unassigned BigRoy and LiborBatek Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants