I'd like to see a function for getting the matView and matProj of a view.

I need this for a shadow mapping shader I'm writing. To project the depth map onto the scene, it uses a matrix that is the product of the models world matrix, the lights matView and matProj matrices (a camera is placed at the light position) and a TexAdjust matrix. The problem is that there is no way to get the matView and matProj of the light in the ENABLE_RENDER (where the models matWorld is available).

I tried saving matView and matProj in the ENABLE_VIEW of the DepthRender material but it doesn't work because I also use another material event (ENABLE_TREE, for switching the material depending on the view) and there is no way to determine what triggered the event (unknown parameter EVENT_TREE).