Hello friends.
I've been messing about with a script that sets vray properties with a quick click and I notice that it is significantly slower than setting the properties the usual way, as with right-clicking and setting vray props that way. The idea is to save myself the hassle of right-clicking, setting all the various properties, and then clicking ok. Basically it would save a bunch of mouse-clicks.
For example, here is a single piece of the code that sets all selected objects to be matte:
...and this works. The complete tool has buttons for making selected objs matte shadow, or setting them to be not matte, etc.
What's interesting is that, with a big dataset like an automobile interior, if I have a great deal of objects selected, the script takes waaaaaay longer than the native vray method. So what I mean is, if I use my script to make a large number of objects matte, I hit the button and I end up waiting for a while. If I use the regular vray method of right-clicking, get vray properties, click the buttons and close, the result happens much faster.
Now, I know I can just do it the regular way, but I like automation; and also I don't like having to click all the buttons. Can anybody offer advice why it takes so much longer to do it with my script?
Thanks very much for any advice. Much appreciated.
I've been messing about with a script that sets vray properties with a quick click and I notice that it is significantly slower than setting the properties the usual way, as with right-clicking and setting vray props that way. The idea is to save myself the hassle of right-clicking, setting all the various properties, and then clicking ok. Basically it would save a bunch of mouse-clicks.
For example, here is a single piece of the code that sets all selected objects to be matte:
Code:
try(destroydialog _MatteObjTool) catch() rollout _MatteObjTool "Make Matte Obj" ( button _MakeMatte "Make Selected Objects Matte" on _MakeMatte pressed do ( for i = 1 to selection.count do ( setuserprop $ "VRay_Matte_Enable" true setuserprop $ "VRay_Matte_Alpha" -1 setuserprop $ "VRay_Matte_Shadows" false setuserprop $ "VRay_Matte_ShadowAlpha" false setuserprop $ "VRay_Matte_ReflectionAmount" 0.000000 setuserprop $ "VRay_Matte_RefractionAmount" 0.000000 setuserprop $ "VRay_Matte_GIAmount" 0.000000 ) ) ) createdialog _MatteObjTool
What's interesting is that, with a big dataset like an automobile interior, if I have a great deal of objects selected, the script takes waaaaaay longer than the native vray method. So what I mean is, if I use my script to make a large number of objects matte, I hit the button and I end up waiting for a while. If I use the regular vray method of right-clicking, get vray properties, click the buttons and close, the result happens much faster.
Now, I know I can just do it the regular way, but I like automation; and also I don't like having to click all the buttons. Can anybody offer advice why it takes so much longer to do it with my script?
Thanks very much for any advice. Much appreciated.
Comment