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

Backport load transform to older UE versions #181

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Dec 17, 2024

Changelog Description

This PR is to backport load transform to older UE versions(4.27), and the new alembic conversion presets supports in Unreal 5.
https://dev.epicgames.com/documentation/en-us/unreal-engine/python-api/class/AbcConversionPreset?application_version=5.0#unreal.AbcConversionPreset
Also it introduces the custom alembic conversion presets of which user can choose to set it in ayon settings if the transform is still not what they want.
image
Resolve #179

Additional review information

Please install and build addon with this branch to update the settings
Test it in 5.1 if possible

Testing notes:

  1. Try the default alembic presets
  2. Load Asset in alembic format (Animation, PointCache, Model, Layout)
  3. Switch the alembic presets to custom
  4. Load Asset in alembic format (Animation, PointCache, Model, Layout)

@moonyuet moonyuet added the type: enhancement Improvement of existing functionality or minor addition label Dec 17, 2024
@moonyuet moonyuet self-assigned this Dec 17, 2024
@moonyuet moonyuet changed the title backport load transform to older UE versions Backport load transform to older UE versions Dec 17, 2024
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.

Been tested inside UE 5.1 and the basic loading for Alembic and FBX products been working without triggering any errors...

However there is some issue with transforms when loading my enviro asset (which works ok inside Maya and UE 5.5)

here inside maya (note the outer shell and its transforms)
Screenshot 2024-12-23 122739

once loaded as Alembic static mesh it got weirdly scaled and rotated (most of its parts):

Screenshot 2024-12-23 123923

I have also tried to freeze transforms for the outer shell (as it got some transforms like 100 Scale due to its origin aka been imported from other DCC, however this wasnt an issue in different UE versions)

@LiborBatek
Copy link
Member

...freezing transforms didnt produce any correct result while loaded into UE 5.1

note: FBX repre works ok tho

@moonyuet moonyuet requested a review from LiborBatek December 23, 2024 14:48
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.

There is still an issue with one of my object once loading the Layout with Alembic set to Maya preset aka default UE addons one.

Now its in correct scale but still rotated 90 deg... no errors in console tho.

image

@moonyuet moonyuet requested a review from LiborBatek January 2, 2025 07:59
@LiborBatek
Copy link
Member

No matter how hard I have tried it still produces wrong transforms... I have tried to use custom preset, maya one, also re publish assets from maya but it still been wrong...

image

There is one weird finding tho...as in UE 5.1 I was not even able to import the Alembic repre of the asset as staticmesh via native import action and it doesnt work too... asset been rotated and scaled weirdly....

Checking in the asset in maya seems fine and without issues... so maybe some kind of UE Prefs interferring with my AYON setup??

Really stuck on it atm, sry.

Any ideas??

@moonyuet
Copy link
Member Author

moonyuet commented Jan 3, 2025

No matter how hard I have tried it still produces wrong transforms... I have tried to use custom preset, maya one, also re publish assets from maya but it still been wrong...

image

There is one weird finding tho...as in UE 5.1 I was not even able to import the Alembic repre of the asset as staticmesh via native import action and it doesnt work too... asset been rotated and scaled weirdly....

Checking in the asset in maya seems fine and without issues... so maybe some kind of UE Prefs interferring with my AYON setup??

Really stuck on it atm, sry.

Any ideas??

I try to find some issues of which related to the transforms when importing the Alembic.

I find this quite helpful: https://forums.unrealengine.com/t/alembic-uv/368981

We could try to set -90 degree to rotation X, and then set -1 in z scale. If the scale appears to be smaller we can multiply the scales 100 like we did in OP.

Will investigate more tomorrow

@moonyuet
Copy link
Member Author

moonyuet commented Jan 4, 2025

I have tested some simple assets in my side, the default custom presets work for my case.
I can load the object with correct transforms.
image
image
image
image

I updated the PR with that custom preset in maya for 5.1
I am using 5.1.1 for the test
I also find out some loopholes for the json layout loader in maya and unreal of which they are not supporting to load layout for the loaded asset from different library projects. I will create github issue for that later.

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.

I believe the check should be:

unreal_pipeline.UNREAL_VERSION.minor >= 4):

because the Maya preset doesn't work in 5.3 and custom needs to be used. With this change, import works as expected.

@moonyuet moonyuet requested a review from antirotor January 8, 2025 11:04
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 have tested it in UE 5.1 UE 5.3 and UE 5.5 and all unreal versions works well when loading products and namely layout products.

LGTM

@moonyuet moonyuet merged commit bbaf6b5 into develop Jan 8, 2025
1 check passed
@moonyuet moonyuet deleted the enhancement/AY-7266_Backport-load-transforms-to-older-UE-versions branch January 8, 2025 14:25
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.

AY-7266_Backport load transforms to older UE versions
3 participants