Custom UI Help Please
Hi I"m not good at all at Mel, and I can't figure this out. I want to make a script for this loop:
int $f; for ($f = 1; $f <= 10; $f++) { currentTime $f; shaveWriteRib -frame $f ("c:\\file." + $f + ".rib"); } and run it through this UI: window -height 90 -title "RibWriter" -width 370; rowLayout -columnWidth4 80 100 100 80 -enable on -height 64 -numberOfColumns 4 -visible on -width 362; text -enable on -height 17 -label "Frames" -visible on -width 80; intField -editable on -enable on -height 23 -maxValue 1000 -minValue 1 -visible on -width 100; button -height 28 -label "Rib It" -width 80; showWindow; What I want is to use this UI to select the amount of frames to export. But I only know the loop and have no Idea how to write the script to run it off of that UI, I realize this might not get me any where but I"m having a hard time with this. Thanks! |
You need to wrap your loop in a procedure and then call that procedure from the button in your UI. The procedure would be something like this:
Code:
global proc myShaveWriteProcedure() Code:
button -c "myShaveWriteProcedure"; Code:
global proc myShaveWindow() |
Well that got me alot further, than I would of gotten, thanks. Here is my new script, but I don't seem to have the float field connected to the amount of frames, here it is:
global proc myShaveWriteProcedure() { int $f; for ($f = 1; $f <= 1000; $f++) { currentTime $f; shaveWriteRib -frame $f ("c:\\file." + $f + ".rib"); } } global proc myShaveWindow() { window -height 90 -width 320; rowLayout -columnWidth3 80 100 80 -height 64 -numberOfColumns 3 -width 312; text -height 17 -label "Frames" -width 80; floatField -height 23 -maxValue 1000 -minValue 1 -value 1 -width 100; button -command "myShaveWriteProcedure" -height 28 -label "Rib It" -width 80; } showWindow; |
You need to query the value from the floatField and then pass that value into your loop procedure. A couple of things to get you going in the right direction:
Querying the floatField's value and assigning it to a variable: Code:
$frame = `floatfield -q -value fieldName` Code:
myShaveWriteProcedure($frame); Code:
global proc myShaveWrite{$frame)() |
I really don't know how to do this I guess I'll have to learn it, which I should of do first, so thanks for all ur help!
|
All times are GMT. The time now is 07:03 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018