Hey all,
I was recently in a situation where I needed a colorpicker in 3ds max that had a click event and a changed event.
But the one in maxscript and dotnet do not allow me to do more then the changed event.
Anybody has a solution for this?
Cheers,
Robb
You could try something like the following:
rollout colorPickerButtonTest "ColorPicker-Button Test"
(
colorpicker theColor "" color:[0,0,255] modal:false width:200 height:200 pos:[5,5] enabled:false
button theButton "C" width:50 height:50 pos:[155,155]
on theButton pressed do
(
print "clicked"
newColor = colorPickerDlg (theColor.color) "Pick A Color:" alpha:true pos:[100,100]
theColor.changed(newColor)
)
on theColor changed nColor do (
print "changed"
theColor.color = nColor
theButton.pos = theButton.pos -- force redraw
)
)
createDialog colorPickerButtonTest 210 210
Eevans, I would have expected Nysuatro to be looking for a “changed” event inside the color picker. E.g., to get a real modeless color picker so that any changes inside the color picker would reflect realtime to the viewports (or so).
SamiV.
Eevans, I would have expected Nysuatro to be looking for a “changed” event inside the color picker. E.g., to get a real modeless color picker so that any changes inside the color picker would reflect realtime to the viewports (or so).
SamiV.
In that case, I suppose that you could manually check the “theColor.color” attribute at some interval (using the technique described here http://lonerobot.net/?p=50) to see whether on not it has changed (rather than relying on the colorPicker control’s changed function). That said, I haven’t used DotNet w/ Max, so I’m not exactly speaking from expertise. : )