Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Write into textField @absolut path

1 REPLY 1
Reply
Message 1 of 2
pixel_xyz
232 Views, 1 Reply

Write into textField @absolut path

Hello people,

i have 2 textfield paths stored into an array.

I'd like to fill in the first textfield (index [0]) with the content of a variable. I'd like to specifically write the value from the variable , at the location of the first textfield which is stored into a variable like $textFieldPath[0]

Does anyone which is the command to achieve that?

Thank you very much for your help! Cat Wink

 

 

1 REPLY 1
Message 2 of 2
sven_j
in reply to: pixel_xyz

Hello,

 

I'm sorry, I'm not sure if I understood correctly want you want to do. Maybe you just want to change the text of a textField? For this you simply have to call the textField command with "-edit" to edit an existing text field and "-text" to change the text. In the end you specify the name of your text field, which is in your case from an array variable. When you want to read from a text field you have to use "-query -text". I hope I could help you.

 

global proc Test()
{
    string $window = `window`;
    rowColumnLayout -numberOfColumns 2 -columnWidth 1 200 -columnWidth 2 200;
        
    string $textFields[2];
     
// Create text fields and store their names in an array $textFields[0] = `textField "Test0"`; $textFields[1] = `textField "Test1"`; string $variable0 = "Hello"; string $variable1 = "World";
// Change the text of the text fields textField -edit -text $variable0 $textFields[0]; textField -edit -text $variable1 $textFields[1]; showWindow $window; } Test();

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report