0

How do you print an integer into a string in Maya MEL scripting?

bobobobo
  • 64,917
  • 62
  • 258
  • 363

1 Answers1

0

It turns out you can just use + to concatenate string and integer objects in Maya Embedded Language.

For example:

int $i ;
string $s ;

    for( $i = 0; $i < 5; $i++ ) {
        $s = "ooh" + $i ;
        print $s ;
    }

There is also the format command

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
bobobobo
  • 64,917
  • 62
  • 258
  • 363