Jul 2011
1 / 3
Jul 2011
Jul 2011

I'm trying to make an option in my UI similar to the PSDfiletexture node where I have a button that opens a dialog box so you can search for a PSD. I have it working, and when i print my result it prints correctly, but how do i then take that result and put it in the textFieldGrp so the user can see/edit the file that has been loaded???  Thanks for any help!!  -DD 

////////////////

showWindow TheWindow;

 if ( window -exists TheWindow ) { deleteUI -window TheWindow; }

 window -w 360 -sizeable 1 -menuBar true -title "myWindow" TheWindow;

 columnLayout -adjustableColumn true;

button -label "Find File" -command "importImage";

columnLayout ;

 $Path = textFieldGrp -w 360 -label "Path";

 showWindow TheWindow;

/////////////////////////////////////// 

proc importImage (){

string $basicFilter = "*.psd";

string $result[] = fileDialog2 -fileMode 4 -fileFilter $basicFilter -dialogStyle 1;

print $result;

};

  • created

    Jul '11
  • last reply

    Jul '11
  • 2

    replies

  • 2.3k

    views

  • 1

    user

you just have to edit the textFieldGrp's 'text.' Look in the mel docs and you should be able to figure it out. You just need to know the name of the textFieldGrp you're editing. You should be able to stick it in the importImage procedure.

Thanks molemansd7.... i finally got it working

///////////////////////////////////////

showWindow TheWindow;

if ( window -exists TheWindow ) { deleteUI -window TheWindow; }

window -w 360 -sizeable 1 -menuBar true -title "myWindow" TheWindow;

columnLayout;

textFieldButtonGrp -label "Path: " -text "" -buttonLabel "Path" -buttonCommand "importImage" GetPath;

showWindow TheWindow;

///////////////////////////////////////

proc importImage (){

string $FilterByPSD = "*.psd";

 string $result[] = fileDialog2 -fileMode 4 -fileFilter $FilterByPSD -dialogStyle 1;

textFieldButtonGrp -e -text $result GetPath;

};

 

Suggested Topics

Want to read more? Browse other topics in Maya or view latest topics.