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

UnrealAlembicPointCacheLoader/SkeletalMeshLoader: Align the loaded frame range to db #32

Merged

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented Jul 31, 2024

Changelog Description

Resolve #24 and also align to load skeletalmesh according to db.

Additional info

n/a

Testing notes:

  1. Launch Unreal
  2. Load PointCache with Import Alembic Point Cache and Import Alembic Skeletal Mesh
  3. Frame range should be correct

@moonyuet moonyuet requested a review from LiborBatek July 31, 2024 09:59
@moonyuet moonyuet added the type: bug Something isn't working label Jul 31, 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.

Im still getting full animation outside of the frame range so e.g. all 1000 keyframes before the actual frame range

image

Takes also ages to load such pointcache animation

@LiborBatek
Copy link
Member

@moonyuet its maybe worth noting that also that pointcache anim ends up in different folder than it should (generally creates the shot inside /assets which again being somewhat odd (not following the folder path of the shot it originates from) see pic below

Screenshot 2024-08-02 122931

@moonyuet moonyuet marked this pull request as draft August 2, 2024 14:58
@moonyuet moonyuet marked this pull request as ready for review August 5, 2024 11:33
@moonyuet moonyuet marked this pull request as draft August 5, 2024 11:34
@moonyuet
Copy link
Member Author

moonyuet commented Aug 5, 2024

Member

This can be implemented along with #4

@LiborBatek
Copy link
Member

@antirotor I would like to ask if we are all on the same page that every single uasset we bring into UE should have pretty much the same folder path as in Ayon DB, right? Im asking as there are some discrepancies in that regard as seen above...

@LiborBatek LiborBatek self-requested a review August 7, 2024 13:35
@LiborBatek
Copy link
Member

just to note that it is sitll malfunctioning when trying to load Anim pointcache (besides invalid frame range it also is not transformed accordingly / swapping Y > Z etc)

@moonyuet moonyuet marked this pull request as ready for review August 7, 2024 15:36
@moonyuet
Copy link
Member Author

moonyuet commented Aug 7, 2024

just to note that it is sitll malfunctioning when trying to load Anim pointcache (besides invalid frame range it also is not transformed accordingly / swapping Y > Z etc)

It should be fixed along with this PR.

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.

Now when importing pointcacheAnim it correctly sets frame range matching the DB entry.
In my case 75 frames.

image

LGTM

@moonyuet moonyuet requested a review from LiborBatek August 26, 2024 10:53
@moonyuet
Copy link
Member Author

Now when importing pointcacheAnim it correctly sets frame range matching the DB entry. In my case 75 frames.

image

LGTM

@LiborBatek Would you mind to re-test again with setting version to see if it will import the assets with correct frame range? Thanks!

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.

When using Ayon>Load it correctly create exclusive folder for each version and all having correct frame range but when trying to Ayon>Manage>Set Version it fails with following error:

on: Error: Traceback (most recent call last):
LogPython: Error:   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 366, in <lambda>
LogPython: Error:     lambda: self._show_version_dialog(item_ids, active_repre_id)
LogPython: Error:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 843, in _show_version_dialog
LogPython: Error:     self._update_containers_to_version(
LogPython: Error:   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 1032, in _update_containers_to_version
LogPython: Error:     self._update_containers(item_ids, versions)
LogPython: Error:   File "C:\Work\REPO\ayon-core\client\ayon_core\tools\sceneinventory\view.py", line 1007, in _update_containers
LogPython: Error:     update_container(container, item_version)
LogPython: Error:   File "C:\Work\REPO\ayon-core\client\ayon_core\pipeline\load\utils.py", line 539, in update_container
LogPython: Error:     return Loader().update(container, context)
LogPython: Error:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 187, in update
LogPython: Error:     task = self.get_task(
LogPython: Error:            ^^^^^^^^^^^^^^
LogPython: Error:   File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 64, in get_task
LogPython: Error:     options.sampling_settings.frame_start = loaded_options.get("frameStart")
LogPython: Error:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error: TypeError: AbcSamplingSettings: Failed to convert type 'str' to property 'FrameStart' (IntProperty) for attribute 'frame_start' on 'AbcSamplingSettings'
  TypeError: NativizeProperty: Cannot nativize 'str' as 'FrameStart' (IntProperty)
    TypeError: Nativize: Cannot nativize 'str' as 'int32'

@moonyuet moonyuet requested a review from LiborBatek August 27, 2024 08:12
@LiborBatek
Copy link
Member

@moonyuet Im getting error when trying just to load the pointcache anim ??

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\loader\models\actions.py", line 740, in _load_representations_by_loader
    load_with_repre_context(
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\pipeline\load\utils.py", line 325, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 163, in load
    f"{self.root}/{folder_name}/{name_version}", suffix=f"_{ext}")
       ^^^^^^^^^
AttributeError: 'AnimationAlembicLoader' object has no attribute 'root'

@moonyuet
Copy link
Member Author

moonyuet commented Aug 27, 2024

@moonyuet Im getting error when trying just to load the pointcache anim ??

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\loader\models\actions.py", line 740, in _load_representations_by_loader
    load_with_repre_context(
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\pipeline\load\utils.py", line 325, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 163, in load
    f"{self.root}/{folder_name}/{name_version}", suffix=f"_{ext}")
       ^^^^^^^^^
AttributeError: 'AnimationAlembicLoader' object has no attribute 'root'

i guess it could be because the merge of too much PRs. fixed in b75c73f

@LiborBatek
Copy link
Member

now it works again with AYON>Load but Im getting error when trying Manage>Set Version, it creates the folder for particular version which I had selected but its empty in the end due to following error:

LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\sceneinventory\view.py", line 366, in <lambda>
LogPython: Error:     lambda: self._show_version_dialog(item_ids, active_repre_id)
LogPython: Error:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\sceneinventory\view.py", line 843, in _show_version_dialog
LogPython: Error:     self._update_containers_to_version(
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\sceneinventory\view.py", line 1032, in _update_containers_to_version
LogPython: Error:     self._update_containers(item_ids, versions)
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\tools\sceneinventory\view.py", line 1007, in _update_containers
LogPython: Error:     update_container(container, item_version)
LogPython: Error:   File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_0.4.3\ayon_core\pipeline\load\utils.py", line 539, in update_container
LogPython: Error:     return Loader().update(container, context)
LogPython: Error:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 252, in update
LogPython: Error:     self.import_and_containerize(
LogPython: Error:   File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 88, in import_and_containerize
LogPython: Error:     task = self.get_task(filepath, asset_dir, asset_name, False, loaded_options)
LogPython: Error:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error:   File "c:\Work\REPO\ayon-unreal\client\ayon_unreal\plugins\load\load_alembic_animation.py", line 65, in get_task
LogPython: Error:     options.sampling_settings.frame_start = loaded_options.get("frameStart")
LogPython: Error:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LogPython: Error: TypeError: AbcSamplingSettings: Failed to convert type 'NoneType' to property 'FrameStart' (IntProperty) for attribute 'frame_start' on 'AbcSamplingSettings'
  TypeError: NativizeProperty: Cannot nativize 'NoneType' as 'FrameStart' (IntProperty)
    TypeError: Nativize: Cannot nativize 'NoneType' as 'int32'

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.

Now all working well!

I have tested both skeletonMesh and skeletalAnim aka pointcacheAnim and was able to load with correct frame range, manage >set version and finally remove any version without issues...

sml note (not related to this PR?) : speaking of pointcache animation it still imports into different locations (../assets/) then shot context, but I guess its not in the scope of this PR so can be merged anyway

@moonyuet moonyuet merged commit 59300db into develop Aug 27, 2024
1 check passed
@moonyuet moonyuet deleted the bugfix/align_alembic_skeletal_loader_frame_range_to_db branch August 27, 2024 14:28
@mkolar mkolar assigned moonyuet and unassigned LiborBatek Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading of Alembic as pointcache with frame range not aligned with DB
2 participants