Skip to content

Alembic loaders: Add Always Add Cache Reader loaded options #252

Merged
moonyuet merged 38 commits intodevelopfrom
enhancement/YN-0479--Blender-Alembic-Loader-allow-setting-Always-Add-Cache-Reader-argument
Feb 14, 2026
Merged

Alembic loaders: Add Always Add Cache Reader loaded options #252
moonyuet merged 38 commits intodevelopfrom
enhancement/YN-0479--Blender-Alembic-Loader-allow-setting-Always-Add-Cache-Reader-argument

Conversation

@moonyuet
Copy link
Member

@moonyuet moonyuet commented Feb 6, 2026

Changelog Description

This PR is to add the setting of Always Add Cache Render for the alembic loader options, it would also support to synchronize the related settings from AYON.

Resolve #251

Additional review information

n/a

Testing notes:

  1. Build blender addon with this branch
  2. Set the toggle from ayon+settings://blender/load/AbcCameraLoader/always_add_cache_reader or ayon+settings://blender/load/CacheModelLoader/always_add_cache_reader
  3. Load Alembic objects
  4. Should be working.

@moonyuet moonyuet requested review from BigRoy and LiborBatek February 6, 2026 10:56
@moonyuet moonyuet self-assigned this Feb 6, 2026
@moonyuet moonyuet added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Feb 6, 2026
Copy link
Contributor

@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.

Nice! Looks good @moonyuet

Did you test run it as well? Or do we need more thorough testing from @LiborBatek ?

moonyuet and others added 5 commits February 6, 2026 19:04
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
@moonyuet moonyuet requested a review from BigRoy February 6, 2026 11:15
@moonyuet moonyuet requested a review from BigRoy February 6, 2026 13:24
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.

The Always Add Cache Reader works as expected...it also propagates from settings to the loader and options which is right.

Image

All been working nicely.

There is only one flaw and that is when version managed and setting different version.

as the cache file is not properly connected to the Cache reader.

Image

so the updated version is not animated anymore. However the Alembic cache file got swapped for correct version but unassigned to the cache reader

image

Not sure tho if connected to this PR or unrelated...leaving it to your decision.

@BigRoy
Copy link
Contributor

BigRoy commented Feb 6, 2026

I think that is a bug actually - probably even for animated transforms even before this PR (that did require a cache attached too)...

Seems like we're not processing TransformCache modifiers but only MeshSequenceCache ones @moonyuet ?
Or am I misreading this logic in this method?

@LiborBatek may be nice if you share with Kayla your test scene so she can reproduce easily and tweak it and confirm herself first it's stable when committing changes.

@moonyuet moonyuet requested a review from LiborBatek February 9, 2026 13:21
@BigRoy BigRoy self-requested a review February 11, 2026 00:00
@moonyuet
Copy link
Member Author

moonyuet commented Feb 11, 2026

@BigRoy Although the fixes appear to simplify the codebase, it doesn't seems to be working to setting correct filepath when setting version/upversioning.
The video shows how it doesn't work.
https://github.com/user-attachments/assets/9af2dd64-5185-4a92-87c1-98f6fd99b5e7

Similar things happened to the cache loader too (Mesh_Sequence_Modifier has disappeared), but I don't have generic example for testing the cache loader.

As this PR is more about adding Always Add Cache Reader as options, perhaps it would be helpful that we could revert the fix first, merge the relevant and then discuss the fixes in a separate issue? (Coming with this suggestion also contributes to the fact that it is sponsored PR).

@LiborBatek
Copy link
Member

LiborBatek commented Feb 11, 2026

I have tested it again and even tho there are no issues with object_path within the cache modifier I have experienced weird version managing.

Please see vid below. Generally it can work for a first time when using e.g. Manage > Set Version but fails for a second time while using e.g. Manage > Update to Latest resulting into some duplication of linked cache files and suffix.

However it does set object path within the modifier in most occasions. Still not functional and reliable atm

blender-abc-manage.mp4

Note: I have tested it with both Alembic caches originating from the blender and also from outside (maya based ones) behaves very much the same in both occasions...

@BigRoy
Copy link
Contributor

BigRoy commented Feb 12, 2026

These breakings also happens for both MeshSequenceCache modifier used and also when using Transform Cache contraints...

Let's discuss these issues in a call where you can show what's happening please.

@BigRoy
Copy link
Contributor

BigRoy commented Feb 12, 2026

Let's discuss these issues in a call where you can show what's happening please.

So the case here is that inside the alembics you're updating between is that the object paths have changed. So I'll add some behavior that finds the best match.

moonyuet and others added 8 commits February 12, 2026 23:02
…ng-Always-Add-Cache-Reader-argument' of https://github.com/ynput/ayon-blender into enhancement/YN-0479--Blender-Alembic-Loader-allow-setting-Always-Add-Cache-Reader-argument

# Conflicts:
#	client/ayon_blender/plugins/load/load_cache.py
…en assigned to a single modifier or constraints
…n't create extra duplciate when the always_create_cache_loader is False
…9--Blender-Alembic-Loader-allow-setting-Always-Add-Cache-Reader-argument
@moonyuet moonyuet requested a review from BigRoy February 13, 2026 07:22
cache for cache in bpy.data.cache_files
if cache in remove_caches and not lib.has_users(cache)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see what this has to do with always_add_cache_reader. It also applies if it just happen to have applied cache to just a few.

Also, I may be misreading this, but this would essentially always result in the exact same remove_caches as just above. Because it will be in bpy.data.cache_files, it will be in remove_caches and the not lib.has_users check was also alreayd perform on the cache. As such, this logic can be removed.

Suggested change

Copy link
Member Author

@moonyuet moonyuet Feb 13, 2026

Choose a reason for hiding this comment

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

I don't see what this has to do with always_add_cache_reader. It also applies if it just happen to have applied cache to just a few.

Not really, it would add up but not remove the target from bpy.data.cache_files. like I showed in #252 (comment) but this time is the cache loader.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand, sorry. Can you explain how this differs?

Copy link
Member Author

@moonyuet moonyuet Feb 13, 2026

Choose a reason for hiding this comment

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

I don't understand, sorry. Can you explain how this differs?

Okay. My bad, let's clean this up(407fbd9). We can fix it later, the issue is still there when the always_add_cache_reader disabled with/without the cache

Recording.2026-02-13.164655.mp4

@moonyuet moonyuet requested a review from BigRoy February 13, 2026 08:58
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 errors while trying to version manage Animation in Abc which differs in object paths unfortunatelly...

getting this traceback in the console:

Running callback: <bound method CacheModelLoader.exec_update of []>
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh'  ]
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor'  ]
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh'  ]
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model'  ]
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor'  ]
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain' not found in new cache file 'C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc'  ]
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain'  ]
Done
Alembic: unknown how to handle objects of schema '', skipping object ''
Alembic: unknown how to handle objects of schema '02:15.813  object.modifier  | WARNING Object: "sh010_01_animationMain:vanguard_01_rigMain_vanguard_visor", Modifier: "MeshSequenceCache", Could not create cache reader for file C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc
', skipping object ''Alembic: unknown how to handle objects of schema '
', skipping object ''
Alembic: unknown how to handle objects of schema '', skipping object '02:15.813  object.modifier  | WARNING Object: "sh010_01_animationMain:vanguard_01_rigMain_vanguard_Mesh", Modifier: "MeshSequenceCache", Could not create cache reader for file C:/projects/Blender/Shots/sh010/publish/animation/animationMain/v003/Blnd_sh010_animationMain_v003.abc
'
Alembic: unknown how to handle objects of schema '', skipping object ''


def _process(self, libpath, asset_group, group_name, options=None):
def _process(self, libpath, asset_group, group_name,
options: Optional[Dict] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be clear, the code in this method does not expect this to be None for the Alembic case - because None.get("always_add_cache_reader") would fail. So either we need

if options is None:
    options = {}

Or it should not have it as optional, and just require the dict.

@BigRoy
Copy link
Contributor

BigRoy commented Feb 13, 2026

No replacement found for object path '/vanguard_01_rigMain'

@moonyuet it may be worth logging the cache_file.object_paths if no replacement is found. Just to make it easier to ever debug why it couldn't be found. The only downside is - that cache_file.object_paths may be massive. :/ So we should perhaps log it only once?

Then with those logs - would be good to debug with Libor why his case fails.

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
@moonyuet
Copy link
Member Author

@BigRoy I got the files from Libor and find out that the empty lists from the new_cache.object_paths.

!!! ERR: 2026-02-13 22:17:29,670 >>> { ProductLoader }: [  Loader CacheModelLoader is doesn't specify `product_base_types` but product entity has `productBaseType` defined as `pointcache`.   ] 
[INFO]:   load_with_repre_context:  Running 'CacheModelLoader' on '/lib'
!!! ERR: 2026-02-13 22:17:30,502 >>> { ProductLoader }: [  Loader CacheModelLoader is doesn't specify `product_base_types` but product entity has `productBaseType` defined as `pointcache`.   ] 
!!! ERR: 2026-02-13 22:17:30,503 >>> { ProductLoader }: [  Loader AbcCameraLoader is doesn't specify `product_base_types` but product entity has `productBaseType` defined as `pointcache`.   ] 
!!! ERR: 2026-02-13 22:17:30,503 >>> { ProductLoader }: [  Loader LoadImageCompositor is doesn't specify `product_base_types` but product entity has `productBaseType` defined as `pointcache`.   ] 
!!! ERR: 2026-02-13 22:17:30,503 >>> { ProductLoader }: [  Loader LoadImageShaderEditor is doesn't specify `product_base_types` but product entity has `productBaseType` defined as `pointcache`.   ] 
>>> [  new_cache object paths '[]'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_visor/vanguard_01_rigMain_vanguard_visor'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh'  ] 
*** WRN: >>> { ProductLoader }: [  Object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh' not found in new cache file 'D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc'  ] 
*** WRN: >>> { ProductLoader }: [  No replacement found for object path '/vanguard_01_rigMain/vanguard_01_rigMain_model/vanguard_01_rigMain_vanguard_Mesh/vanguard_01_rigMain_vanguard_Mesh'  ] 
Alembic import D:\sh_boss_proj\interior_lenny\lib\publish\pointcache\pointcacheObjectPath\v002\il_lib_pointcacheObjectPath_v002.abc took 9.24 ms
Alembic import took 9.35 ms
Alembic: unknown how to handle objects of schema '', skipping object ''Alembic: unknown how to handle objects of schema '', skipping object '
Alembic: unknown how to handle objects of schema '', skipping object '''

01:06.969  object.modifier  | WARNING Object: "lib_01_pointcacheObjectPath:vanguard_01_rigMain_vanguard_Mesh", Modifier: "MeshSequenceCache", Could not create cache reader for file D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc
Alembic: unknown how to handle objects of schema 'Alembic: unknown how to handle objects of schema '', skipping object '', skipping object '''

01:06.969  object.modifier  | WARNING Object: "lib_01_pointcacheObjectPath:vanguard_01_rigMain_vanguard_visor", Modifier: "MeshSequenceCache", Could not create cache reader for file D:/sh_boss_proj/interior_lenny/lib/publish/pointcache/pointcacheObjectPath/v001/il_lib_pointcacheObjectPath_v001.abc

Copy link
Contributor

@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.

Works for me.

@moonyuet
Copy link
Member Author

I tested with blender 5.0.1, it works correctly as expected.

testing_video.mp4

@moonyuet moonyuet merged commit 2ba7f16 into develop Feb 14, 2026
1 check passed
@moonyuet moonyuet deleted the enhancement/YN-0479--Blender-Alembic-Loader-allow-setting-Always-Add-Cache-Reader-argument branch February 14, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0479: Blender Alembic Loader allow setting Always Add Cache Reader argument

3 participants