[Closed] Z_depth script
Ok, so I have a script that creates an object that ties the environment ranges of a selected camera to the max and min values of a z_depth render element. It works great for still images but when I animatie the spinner the zimn and zmax don’t update. I am aware that it is because the values are only changed when the spinners value is changed by the user and not when animated. My question is there some way to make the zmin and zmax equal to a sliders value based on updating the values when a frame change takes place? Or maybe a loop that checks for the value of the slider at each frame and will change the z depth values accordingly.
Wire the parameters… Search for parameter wiring in Max and Maxscript help.
Thanks, but that won’t work. The zmin and zmax are not animatable and you cant wire to them. I am already doing this where I can in may script. The problem here is that there are no controllers to wire to.
this is why I need to find a way to change the z depth values to match my spinners at each frame.
That’s the least of your problems.
The ZDepth Render Element’s range controls are considered non-animatable so even if you could update them (via a #PreRenderFrame callback for example), the renderer will refuse to accept the changes if you are rendering a range of frames. Only the values from the first frame will be cached and used for the whole range even if the spinners would update while rendering (I got that working btw.)
So you are forced to render each frame in a separate render call, one frame at a time. It is up to you how you will do that.
Sorry, I didn’t see you were talking about an Element Z Pass… but do you need to have it as an element? Is it to embed in a multipass EXR?
If not:
You can save a copy of your file and do a material override with a mentalra shader and in the surface slot put a falloff map with the type set to distance. this way you can wire the parameters or even animate then at will.
If it is to embed in a multipass EXR:
Do the same material and then create in the render elements a mr shader element and put that material in there, I never tried this way but it should work, this way you have the material with the falloff wired to your spinners and have it outputing as a render element.
Hope this helps.
Ahh, sweet this might be the way to go. I ‘ll be back soon and let you know if it works. thanks
So far so good. I am using the falloff inside a shader element and I have the near and far ranges wired to the camera environment ranges.
Thanks for all your help