How to use IPropertyCollector to set preview for renderers?

i am making a custom timeline clip that switch materials (sharedMaterials). Unfortunately, i can’t make
GatherProperties() works with renderers. i can make IPropertyCollector works with transform position, but not materials. i have goolged it for quite a while but no useful feedback. Do anyone has any suggestion?

i have tried …

driver.AddFromComponent(renderer.gameObject,renderer);
driver.AddFromName(renderer,"m_Materials");
driver.AddFromName(renderer,"m_SharedMaterials");
driver.AddFromName(renderer,"m_materials");
driver.AddFromName(renderer,"m_sharedMaterials");

I guess you need to use ExposedReference

AnimationClips bind to m_Materials.Array.data[0](change the index based on which material you want to change).

Please tell me if this works for you

2 Likes