messagebox question

Hi, if i got a script as below:

on btn3 pressed do
(
if $selection.count> 0 then
(
for i=1 to $selection.count do
(
$.f_number = 8
$.shutter_speed = 8
$.ISO = 100
$.vignetting = off
$.whiteBalance_preset = 1
)
)
else
(
messagebox "Please select a VrayPhysicalCamera to proceed." title:"VrayPhysicalCamera"
)
)

and i have 10 button like this in one single script, do i need to copy paste 10 time of the above script to create 10 button, so everything when you select nothing and click the button, it will display the messagebox.

Is there any other easy way to script this?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

First of all we need to know what will need to do this 10 buttons and then talk about code optimisation

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.