Thanks to Chris Grant @ Scriptspot i now have a nice place to upload the scripts to.
they can all be found here in their very latest version:
http://www.scriptspot.com/3ds-max/leles-vray-tools
Each script has an installer.ms file.
Go to Maxscript->run Script and run the installer.ms file for the script you need.
You'll then find them into the Customize->CustomizeUI->Lele's VRay Tools category, and will be able to assign them to a menu, a button, a quadmenu or a keyboard shortcut.
Remember to save the UI configuration after you've done so, so to preserve the assignments on the next max run.
I'll bump this post when something new comes up, so to stop spamming around
Lele
EDIT#1 03-09-06:Anything_to_Physcam has been updated to fix a a minor issue where the script would do nothing at all if a node that was not a max camera was selected.You're encouraged to redownload it, and run the included .ms. it should preserve any actual shortcut assignment.
EDIT#2 05-09-06
inged 40 at WoW.Ai'm very very 'appy.
There a new small tool which might come handy: The Physical Camera parameters cloner.
It's composed of two commands, one to copy and the other to paste parameters across cameras.
It supports multiple camera selction and restoring (very usable as undo) provided the selection order is respected.
IE. it writes a tiny text file with the parameter values of each camera, without reference to the source. When it reads back, it does so in dumb order, from first to last.
Run a couple of times on a colleague's scene mixing selections, and have him scratch his head for a while
For those who can't grasp this fully (i'm one of them) just use it on a camera at a time: select, and copy, select the other camera, and paste.
As usual, Unpack in one folder, run installer.ms, go find the commands as per the installer dialog box.
EDIT#3 05-09-06: Quick go at an extension of the procedure and concepts used for the parameters copier, i added a VRay Physcam Presets Panel.
It contains 3 rows of 12 buttons, top row saves a preset (multiple cameras supported), middle row loads it (multiple cameras supported, upon load it will tell the user the number of cameras stored in the preset file), and bottom row deletes it.
It saves a file in your "3dsmax\plugcfg\studioDim" folder.
At any time you can delete the folder, losing your presets, but not harming the scripts.
As per usual run the installer.ms.
EDIT#4 06-09-06: Changed the REndertime info tool to V1. Have a go at it by all means!
EDIT#5 07-09-06: Added a releasable version of the VRay PhysCam Auto-Exposer.
Launched at the defaults, it generally makes a good job of nailing a picture.
Parameters may be subject to change later on, but for now you get to decide what is the sample size (as in image size) with which pixels it calculates what's needed, what is the base granularity (ie. step) at which it should move across ISO values.
It is smart-ish enough to know it's approaching a good situation, and it will decrease the stepping accordingly.
There is also a couple of parameters: exposure bias (ie overall brightness. i'd leave it at 12
and exposure range (or how far from the bias the average pixels' brightness can fall).
If the current selection incorporates one or more VRay PhysCams, the script will try and balance them.
If there is no camera selected, it will try and balance ALL the VRay Physcams of the scene.
I deem it safe enough to be TESTED at the moment.
It might crash, loop and whatnot (nothing i am experiencing here, but "outdoor" testing has been scarce so far), do NOT use it on a scene you care about
EDIT#6 07-09-06: Updated the auto-exposure tool (now a rar with instructions included)to intercept the ESC key (it had issues beforehand doing so), NOT to write the zillion render infos it generates into the vraylog file, and to fix a couple of bugs that would occur if it was used twice from the same script run to expose to a different bias. Hopefully soon i'll add importance sampling to the metering, still cooking on it. Get this for now
EDIT #7 08-09-06: Small bugfix to the auto exposure script. discard the old and use the new one please.
EDIT #8 15-09-06: Enhanced the code for the phiscam lightmeter to do a few things it didn't do well or at all. Strenghtened considerably the abortion on esc key interception.
Also fixed a silly bug on the physcam presets deck. grab the new rar file, rerun installer.ms.
EDIT #9 05-10-06: Lightmeter v. 1.1d (d for "about Due!") is up. KEEP the esc key pressed to stop both renderer AND script while it's prodding along.
Thanks to ChrisJ and DaForce for the invaluable help.
EDIT #10 19-11-06: There's an EARLY (read: find out for yourself if it works or not. expect nothing, be prepared to anything
) attempt at a non-iterative Physcam Exposimeter.
My math skills are asymptotically driving to zero, so bear with any most obvious mistake. The BIAS parameter does NOT work atm.
The last link of the ones above will do the trick.
EDIT #11 28-11-06: Updated float exposimeter to work in ISO or shutter speed priority, and to preserve some of the user settings (AA and GI) during the exposure process, rather than use it's own, optimised ones.
EDIT # 12 29-11-06: Updated all the scripts to work with max9 and RC2-3. Due to a big change in the way files are stored per user, in Max 9, i had to get rid of some shortcuts which worked in Max8, but prevented the scripts from running the second time max was started. They should be now bug-free (This is a big one, lol...) and a pleasure to use.
I also changed their location to a group of commands of my own, not to mess up the VRay commands category. Apologies for doing so before.
Each comes with an "installer.ms" in its folder. Run that for the scripts you want installed.
EDIT # 13 13-12-06: Updated Anything_to_Physcam so that now every converted camera and target is parented to the originating one, hence preserving animation infos from the max camera.
It's also updated so that if no cameras are selected, it will ask the user if he wishes to convert all the VISIBLE/UNFROZEN cameras in the scene.
If the user choses not to, the script will just convert the current viewport.
To convert a viewport on the fly as it used to do before, then, you'll have to have any max camera in the scene either frozen or hidden.
It should now cater for all behaviours (viewport, selected camera(s), and all the visible ones), let me know if it works as you expect it, or prefer a different behaviour.
It's updated in both the pack and individually (your choice).
EDIT # 14 18-01-07: Repacked the toolkit to include the vray stuff collector, and the spanky new vrimg2exr GUI with batching capabilities.
Also added a license.txt file which is really just a sneaky way to ask for your money
I did spare you the sad story of the broke chap, so it levels it out a bit
EDIT # 15 23-01-07: Updated the VRay rendertime infos to account for the vray sun. It will display the hour (at the equator, of course) in decimals.
Soon deprecated with the advent of RC4, but for now it works a treat.
It didn't work, previously, due to the sun behaving slightly differently from the scripting side of things and throwing an error up.
Thanks to Nikki it's now sorted. Redownload the whole pack, or just the one, as you wish.
EDIT # 16 27-01-07: Added a silly one to the pack: the Auto-Focus tool for physical Camera(s).
it will raytrace from the camera into the scene, trying to find the closest object surface directly in front of the camera (precisely, the one crossing the central pixel of the view).
If there's none, nothing will happen.
It's the same method some VRay competitor uses, even though they do it on the rendered pixel, possibly avoiding focusing issues in extreme cases, like an opacity mapped fence very close to the camera.
Since i don't take in account transparencies, the script would focus straight onto the fence, and ignore what's behind it.
The maxscript listener will output some infos.
Bear in mind, here it took 13 milliseconds to check and trace through 3000 objects, purposefully placed along the intersection ray (that would be a hell of a dense scene under standard circumstances...).
Let me know how it works your side, and if you'd like it improved in some (reasonable) way.
EDIT # 17 29-01-07: Thanks to Nikki's input, once again, i updated the Physcam AF script to allow for full AF (as it did before) or to pick one object and try and focus on it. Some part of the object mesh HAS to cross the center pixel of the viewport (ie. lay on the line drawn between camera and target, or along the camera local -Z axis) for the script to AF on it.
Just so it's clearer, the script focuses both targeted AND free physcams (CJ: so you don't have to have a target camera to get the focus properly set, for instance...).
Redonwload the AF script or the pack for the updated version.
EDIT #18 02-02-07: updated the float exposimeter and added in three new exposure methods/importance sampling.
This is due to Vlado explaining to me why glossies behaved like they did with sun and sky, so i thought i'd have to make the code somewhat better.
It's a first iteration at the new methods, but already they work well in that they can favour exposing the darker tones rather than the brighter ones (ideal for underlit, indoor scenes), the opposite (ideal for glossies-based outdoor scenes, where the reflections' hues have to be dominant), or expose based on the whole image (which is the most resilient to glossies, but for the extremest of situations). The standard way of exposing is still present, and chosen by default.
Please have a go and let me know how you feel about them.
It's there for download as solo or within the usual script pack (updated).
Installer will remove version 0.1c automatically.
EDIT #19 04-02-07:Prepared a MUCH better method for exposure, and implemented it. I also changed the other two from version 0.1d to cater for the contrast ratio and so on. The exposimeter now defaults to the new, adaptive method.
Bear in mind that extremely low exposures coupled with very small image sizes might throw it off (a bit, or a lot, depending on how extreme the circumstance is).
That's natural due to the fewer samples, and an issue with Float values being rounded to 0.0 float when the camera is very underexposed (and i mean VERY) in interior shots.
Nothing that should normally be encountered in a production workflow.
In any case, a bigger image size to sample from, and /or a second exposure iteration should nail the exposure the way it's supposed to.
EDIT #20 27-02-07:Updated the MaxCam_to_Physcam script.
Its behaviour should now be more predictable in different selection/viewport situations (it will now convert anything for real. convert a physcam view, get an identical clone of the camera, and so on).
One issue with the installer i found under max 9:
you will have to get rid of any *.mcr which has to do with the previous version.
ideally the file is named "VRay-MaxCam_2_PhysCam.mcr".
it should be in "C:\Documents and Settings\%username%\Local Settings\Application Data\Autodesk\3dsmax\9 - 32bit\enu\UI\usermacros"
Or in the normal "%maxroot%\UI\MacroScripts\" folder, depending on the max9 setup.
Sorry for this, should be a leftover from max 8.
Also forgot to add in here the link to the matrix exposimeter, discussed in this post, can be found within the pack or as stand alone.
EDIT #21 03-03-07: Updated the matrix exposimeter to fix the annoying bug happening on its first run. Stay tuned for some whacky addition...
EDIT #22 03-03-07:A "strange" update which seems to work really nicely, bless VRay.
There's now a checkbox at the bottom of the script window which will attempt to white-balance the physcam automatically.
EDIT #23 23-03-07
Updated the VRIMG_2_EXR interface to include the RGB channel (cough! ok, ok, i forgot it...).
Inside the pack there's also another surprise, one script has been reweritten from scratch, and now works a charm where it previously failed.
Grab the pack and reinstalle them to know which one
EDIT # 24 14-05-07
added a proper preset manager for the Matrix exposimeter.
Fetch the pack and reinstall the lot (particularly under max 9!) to try it out.
EDIT # 25 01-06-07
Finally fixed the LC/PPT calc.
Now the shading rate is correct and consistent.
It will also detect any new RC and set the renderer to that, should it not be set already.
The LC/PPT scale type will be set to screen, or no change will be made, if it's set to world. User will have a query box pop up with the choice to change scale type, or ditch changes.
EDIT # 26 04-07-07
I dumped the vrimg2exr gui: too much work at the moment, for me to sort some silly bugs, and the exe itself is very quick in evolving, needing particular attention.
I also fixed a silly declaration bug that prevented the matrix exposimeter presets from loading.
The link now goes to the scriptspot page.
Once there, sure get my scripts, but please click on the ads and browse through the site. Chris Grant will surely appreciate it
they can all be found here in their very latest version:
http://www.scriptspot.com/3ds-max/leles-vray-tools
Each script has an installer.ms file.
Go to Maxscript->run Script and run the installer.ms file for the script you need.
You'll then find them into the Customize->CustomizeUI->Lele's VRay Tools category, and will be able to assign them to a menu, a button, a quadmenu or a keyboard shortcut.
Remember to save the UI configuration after you've done so, so to preserve the assignments on the next max run.
I'll bump this post when something new comes up, so to stop spamming around

Lele
EDIT#1 03-09-06:Anything_to_Physcam has been updated to fix a a minor issue where the script would do nothing at all if a node that was not a max camera was selected.You're encouraged to redownload it, and run the included .ms. it should preserve any actual shortcut assignment.
EDIT#2 05-09-06


It's composed of two commands, one to copy and the other to paste parameters across cameras.
It supports multiple camera selction and restoring (very usable as undo) provided the selection order is respected.
IE. it writes a tiny text file with the parameter values of each camera, without reference to the source. When it reads back, it does so in dumb order, from first to last.
Run a couple of times on a colleague's scene mixing selections, and have him scratch his head for a while

For those who can't grasp this fully (i'm one of them) just use it on a camera at a time: select, and copy, select the other camera, and paste.
As usual, Unpack in one folder, run installer.ms, go find the commands as per the installer dialog box.
EDIT#3 05-09-06: Quick go at an extension of the procedure and concepts used for the parameters copier, i added a VRay Physcam Presets Panel.
It contains 3 rows of 12 buttons, top row saves a preset (multiple cameras supported), middle row loads it (multiple cameras supported, upon load it will tell the user the number of cameras stored in the preset file), and bottom row deletes it.
It saves a file in your "3dsmax\plugcfg\studioDim" folder.
At any time you can delete the folder, losing your presets, but not harming the scripts.
As per usual run the installer.ms.
EDIT#4 06-09-06: Changed the REndertime info tool to V1. Have a go at it by all means!
EDIT#5 07-09-06: Added a releasable version of the VRay PhysCam Auto-Exposer.
Launched at the defaults, it generally makes a good job of nailing a picture.
Parameters may be subject to change later on, but for now you get to decide what is the sample size (as in image size) with which pixels it calculates what's needed, what is the base granularity (ie. step) at which it should move across ISO values.
It is smart-ish enough to know it's approaching a good situation, and it will decrease the stepping accordingly.
There is also a couple of parameters: exposure bias (ie overall brightness. i'd leave it at 12

If the current selection incorporates one or more VRay PhysCams, the script will try and balance them.
If there is no camera selected, it will try and balance ALL the VRay Physcams of the scene.
I deem it safe enough to be TESTED at the moment.
It might crash, loop and whatnot (nothing i am experiencing here, but "outdoor" testing has been scarce so far), do NOT use it on a scene you care about

EDIT#6 07-09-06: Updated the auto-exposure tool (now a rar with instructions included)to intercept the ESC key (it had issues beforehand doing so), NOT to write the zillion render infos it generates into the vraylog file, and to fix a couple of bugs that would occur if it was used twice from the same script run to expose to a different bias. Hopefully soon i'll add importance sampling to the metering, still cooking on it. Get this for now

EDIT #7 08-09-06: Small bugfix to the auto exposure script. discard the old and use the new one please.
EDIT #8 15-09-06: Enhanced the code for the phiscam lightmeter to do a few things it didn't do well or at all. Strenghtened considerably the abortion on esc key interception.
Also fixed a silly bug on the physcam presets deck. grab the new rar file, rerun installer.ms.
EDIT #9 05-10-06: Lightmeter v. 1.1d (d for "about Due!") is up. KEEP the esc key pressed to stop both renderer AND script while it's prodding along.
Thanks to ChrisJ and DaForce for the invaluable help.
EDIT #10 19-11-06: There's an EARLY (read: find out for yourself if it works or not. expect nothing, be prepared to anything

My math skills are asymptotically driving to zero, so bear with any most obvious mistake. The BIAS parameter does NOT work atm.
The last link of the ones above will do the trick.
EDIT #11 28-11-06: Updated float exposimeter to work in ISO or shutter speed priority, and to preserve some of the user settings (AA and GI) during the exposure process, rather than use it's own, optimised ones.
EDIT # 12 29-11-06: Updated all the scripts to work with max9 and RC2-3. Due to a big change in the way files are stored per user, in Max 9, i had to get rid of some shortcuts which worked in Max8, but prevented the scripts from running the second time max was started. They should be now bug-free (This is a big one, lol...) and a pleasure to use.
I also changed their location to a group of commands of my own, not to mess up the VRay commands category. Apologies for doing so before.
Each comes with an "installer.ms" in its folder. Run that for the scripts you want installed.
EDIT # 13 13-12-06: Updated Anything_to_Physcam so that now every converted camera and target is parented to the originating one, hence preserving animation infos from the max camera.
It's also updated so that if no cameras are selected, it will ask the user if he wishes to convert all the VISIBLE/UNFROZEN cameras in the scene.
If the user choses not to, the script will just convert the current viewport.
To convert a viewport on the fly as it used to do before, then, you'll have to have any max camera in the scene either frozen or hidden.
It should now cater for all behaviours (viewport, selected camera(s), and all the visible ones), let me know if it works as you expect it, or prefer a different behaviour.
It's updated in both the pack and individually (your choice).
EDIT # 14 18-01-07: Repacked the toolkit to include the vray stuff collector, and the spanky new vrimg2exr GUI with batching capabilities.
Also added a license.txt file which is really just a sneaky way to ask for your money

I did spare you the sad story of the broke chap, so it levels it out a bit

EDIT # 15 23-01-07: Updated the VRay rendertime infos to account for the vray sun. It will display the hour (at the equator, of course) in decimals.
Soon deprecated with the advent of RC4, but for now it works a treat.
It didn't work, previously, due to the sun behaving slightly differently from the scripting side of things and throwing an error up.
Thanks to Nikki it's now sorted. Redownload the whole pack, or just the one, as you wish.
EDIT # 16 27-01-07: Added a silly one to the pack: the Auto-Focus tool for physical Camera(s).
it will raytrace from the camera into the scene, trying to find the closest object surface directly in front of the camera (precisely, the one crossing the central pixel of the view).
If there's none, nothing will happen.
It's the same method some VRay competitor uses, even though they do it on the rendered pixel, possibly avoiding focusing issues in extreme cases, like an opacity mapped fence very close to the camera.
Since i don't take in account transparencies, the script would focus straight onto the fence, and ignore what's behind it.
The maxscript listener will output some infos.
Bear in mind, here it took 13 milliseconds to check and trace through 3000 objects, purposefully placed along the intersection ray (that would be a hell of a dense scene under standard circumstances...).
Let me know how it works your side, and if you'd like it improved in some (reasonable) way.
EDIT # 17 29-01-07: Thanks to Nikki's input, once again, i updated the Physcam AF script to allow for full AF (as it did before) or to pick one object and try and focus on it. Some part of the object mesh HAS to cross the center pixel of the viewport (ie. lay on the line drawn between camera and target, or along the camera local -Z axis) for the script to AF on it.
Just so it's clearer, the script focuses both targeted AND free physcams (CJ: so you don't have to have a target camera to get the focus properly set, for instance...).
Redonwload the AF script or the pack for the updated version.
EDIT #18 02-02-07: updated the float exposimeter and added in three new exposure methods/importance sampling.
This is due to Vlado explaining to me why glossies behaved like they did with sun and sky, so i thought i'd have to make the code somewhat better.
It's a first iteration at the new methods, but already they work well in that they can favour exposing the darker tones rather than the brighter ones (ideal for underlit, indoor scenes), the opposite (ideal for glossies-based outdoor scenes, where the reflections' hues have to be dominant), or expose based on the whole image (which is the most resilient to glossies, but for the extremest of situations). The standard way of exposing is still present, and chosen by default.
Please have a go and let me know how you feel about them.
It's there for download as solo or within the usual script pack (updated).
Installer will remove version 0.1c automatically.
EDIT #19 04-02-07:Prepared a MUCH better method for exposure, and implemented it. I also changed the other two from version 0.1d to cater for the contrast ratio and so on. The exposimeter now defaults to the new, adaptive method.
Bear in mind that extremely low exposures coupled with very small image sizes might throw it off (a bit, or a lot, depending on how extreme the circumstance is).
That's natural due to the fewer samples, and an issue with Float values being rounded to 0.0 float when the camera is very underexposed (and i mean VERY) in interior shots.
Nothing that should normally be encountered in a production workflow.
In any case, a bigger image size to sample from, and /or a second exposure iteration should nail the exposure the way it's supposed to.
EDIT #20 27-02-07:Updated the MaxCam_to_Physcam script.
Its behaviour should now be more predictable in different selection/viewport situations (it will now convert anything for real. convert a physcam view, get an identical clone of the camera, and so on).
One issue with the installer i found under max 9:
you will have to get rid of any *.mcr which has to do with the previous version.
ideally the file is named "VRay-MaxCam_2_PhysCam.mcr".
it should be in "C:\Documents and Settings\%username%\Local Settings\Application Data\Autodesk\3dsmax\9 - 32bit\enu\UI\usermacros"
Or in the normal "%maxroot%\UI\MacroScripts\" folder, depending on the max9 setup.
Sorry for this, should be a leftover from max 8.
Also forgot to add in here the link to the matrix exposimeter, discussed in this post, can be found within the pack or as stand alone.
EDIT #21 03-03-07: Updated the matrix exposimeter to fix the annoying bug happening on its first run. Stay tuned for some whacky addition...
EDIT #22 03-03-07:A "strange" update which seems to work really nicely, bless VRay.
There's now a checkbox at the bottom of the script window which will attempt to white-balance the physcam automatically.
EDIT #23 23-03-07
Updated the VRIMG_2_EXR interface to include the RGB channel (cough! ok, ok, i forgot it...).
Inside the pack there's also another surprise, one script has been reweritten from scratch, and now works a charm where it previously failed.
Grab the pack and reinstalle them to know which one

EDIT # 24 14-05-07
added a proper preset manager for the Matrix exposimeter.
Fetch the pack and reinstall the lot (particularly under max 9!) to try it out.
EDIT # 25 01-06-07
Finally fixed the LC/PPT calc.
Now the shading rate is correct and consistent.
It will also detect any new RC and set the renderer to that, should it not be set already.
The LC/PPT scale type will be set to screen, or no change will be made, if it's set to world. User will have a query box pop up with the choice to change scale type, or ditch changes.
EDIT # 26 04-07-07
I dumped the vrimg2exr gui: too much work at the moment, for me to sort some silly bugs, and the exe itself is very quick in evolving, needing particular attention.
I also fixed a silly declaration bug that prevented the matrix exposimeter presets from loading.
The link now goes to the scriptspot page.
Once there, sure get my scripts, but please click on the ads and browse through the site. Chris Grant will surely appreciate it

Comment