ozioz
05-05-2007, 05:46 PM
Hi Guys;
I am a newbie for MEL an ı have been studying it for last 30 days. I have already learned the fundamentals of MEL scripting and recently I started to build something realy basic..
I attempt to create a script that opens up a window containing ona button an a slider. the button for creating a sphere ( ıt is gonno be a polysphere by the way ) The slider will control the radius of this sphere...
Yes I know that it is totaly a stupid script and sound a little bit crazy... I was able to build the UI and button and slider. All of them worked properlly.
What I want to achive is that everytime I hit the button that creates a new sphere,I want my slider to control the last created sphere's radius info. Is that clear??? ( I hope so )
By the way, ı am realy new at this forum ( MEL sub forums ) If I am doing wrong something about asking, please warn me...
Here is What ı have done so far;
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
/*Stupid newbie script*/
//-----------------------------------
//1.Usual window stuff
//-----------------------------------
if(`window -exists windowUI`)
deleteUI windowUI;
//------------------------------------------
//2.Create a window...
//------------------------------------------
window
-title "SphereControler"
-mxb off
-wh 500 100
-sizeable off windowUI;
columnLayout
-adjustableColumn on;
button
-label "Sphere"
-command "polySphere";
attrFieldSliderGrp
-attribute "polySphere1.radius"
-fieldMinValue -10
-fieldMaxValue 10 ;
showWindow windowUI;
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
This one is only works when a polysphere is allready in the scene.. I tried so many things but I have not been able to fix this problem so far.. I am sure that it is pretty easy..
I hope you are not kidding me. .... :)
You can also suggest me everything you want!
See, you soon;
Ozioz
I am a newbie for MEL an ı have been studying it for last 30 days. I have already learned the fundamentals of MEL scripting and recently I started to build something realy basic..
I attempt to create a script that opens up a window containing ona button an a slider. the button for creating a sphere ( ıt is gonno be a polysphere by the way ) The slider will control the radius of this sphere...
Yes I know that it is totaly a stupid script and sound a little bit crazy... I was able to build the UI and button and slider. All of them worked properlly.
What I want to achive is that everytime I hit the button that creates a new sphere,I want my slider to control the last created sphere's radius info. Is that clear??? ( I hope so )
By the way, ı am realy new at this forum ( MEL sub forums ) If I am doing wrong something about asking, please warn me...
Here is What ı have done so far;
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
/*Stupid newbie script*/
//-----------------------------------
//1.Usual window stuff
//-----------------------------------
if(`window -exists windowUI`)
deleteUI windowUI;
//------------------------------------------
//2.Create a window...
//------------------------------------------
window
-title "SphereControler"
-mxb off
-wh 500 100
-sizeable off windowUI;
columnLayout
-adjustableColumn on;
button
-label "Sphere"
-command "polySphere";
attrFieldSliderGrp
-attribute "polySphere1.radius"
-fieldMinValue -10
-fieldMaxValue 10 ;
showWindow windowUI;
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
This one is only works when a polysphere is allready in the scene.. I tried so many things but I have not been able to fix this problem so far.. I am sure that it is pretty easy..
I hope you are not kidding me. .... :)
You can also suggest me everything you want!
See, you soon;
Ozioz
