I had to come up with a simpler and quicker way of writing UI's in mel because the formLayout is really too complex and tedious to work with (at least for me!). FormLayouts require you to attach and position items in relation to each other which ends up getting annoying if you have to make modifications or add new elements to your UI. So instead I've started to nest gridLayouts inside of columnLayouts. This gives 100% predictable results, while not having to fuss with the complexity of the formLayout. Check out the new layout, with example code below.
string $win = `window -title "columnGridExample" columnGridLayout`; columnLayout -width 300 -cal "center" -adj 1; gridLayout -nc 2 -cwh 150 20; text -l "list title"; text -l "list title"; setParent..; gridLayout -nc 2 -cwh 150 300; textScrollList -ams 1; textScrollList -ams 1; setParent..; gridLayout -nc 2 -cwh 150 25; button -label "refresh"; button -label "refresh"; setParent..; separator -h 10 -style "none"; checkBoxGrp -ncb 3 -l1 "cBox1" -l2 "cBox2" -l3 "cBox3"; checkBoxGrp -ncb 3 -l1 "cBox4" -l2 "cBox5" -l3 "cBox6"; separator -h 10 -style "none"; checkBox -label "use custom options?" -v 0; textField -w 225; separator -h 20 -style "none"; button -label "GO!" -bgc 0.5 0.2 0.2; showWindow $win;
As you can see I tried to give users extra control and allow them to gamma correct whatever they want. The check boxes mark attributes among maya and mental ray shaders for gamma correction, while the textures check box adds a gamma correction node in between the textures outColor and destination. Also users can choose to use mip_gamma_gain or the standard maya gammaCorrect node. If you want to gamma correct an attribute that is not included in the checkboxes, check off correct custom attributes?
The format for the custom attribute text box is as follows:
color, outColor, diffuse
Download dbrGammaCorrect
No comments:
Post a Comment