Not sure if you are using Shade-C for this, but if you do, then have a look at 05_livingBloomShadow.fx in the examples/fx folder. Its a shadowmap-replacement shader for an object which has vertex movement in it's main shader.
Just kick out the wiggle vertex movement stuff and add the tree wind animation instead
Then use sc_skill(entity, SC_OBJECT_MATERIAL_SHADOWMAP, yourCustomVertexAnimationMaterial); to set a shadowmap-replacement shader for this object.
[edit] Eh, just saw you already found a fix, sorry