Notifications
Clear all

[Closed] 3ds max script help

can someone please explain what the following script is doing:

MBfn = “fn MB_Slider_Update_cb = ” +

(” +

for i = 1 to fmb.controls.count do” +

(” +

if classof(fmb.controls[i]) == SliderControl then” +

(“+

fmb.controls[i].value = fmb.controls[i+1].value”+

)”+

)”+

)”+

registertimecallback MB_Slider_Update_cb”
execute mbfn

Thanks.

2 Replies

It creates a function called

MB_Slider_Update_cb

which steps through a list of controls (I assume on a rollout) and when it finds a slider control, it sets its value to the value of the next one in the list.

Then it sets it up so that this function is called every time the time slider moves.

I have no idea why they’re building a string and using execute. They could have easily just defined the function normally and registered it.

Also, there are a couple of possible errors in there. It checks each control to see if it’s a slider, but doesn’t check whether the next control is a slider so he may be setting some values from unlike controls (and definitely, the last slider’s value will be set from a control that is not a slider or is undefined).

Secondly, It only moves the sliders one way, meaning whether the time slider moves forward or backward or jumps to the start frame or end frame or anything, this script will increment its sliders by one in the same direction. Without knowing what it’s for, I have no idea if this is the expected behavior, but I have a feeling it isn’t.

Hope this helps (and if you’re looking for more specifics, just ask. I love working these things out. Keeps me from doing my “real” work.)

 PEN

I think that if you are trying to learn from some one elses script that is a bad place to start. Looks like a bit of a mess to me as well.