[MEL] how to get rendering image file name?

[MEL] how to get rendering image file name?

Anonymous
Not applicable
984 Views
1 Reply
Message 1 of 2

[MEL] how to get rendering image file name?

Anonymous
Not applicable

I want to get rendering image filename at current frame.

I can use "renderSettings -gin" just after maya startup.

 

string $ign[] = `renderSettings -ign`;
print("ign = " + $ign[0] + "\n");
string $gin[] = `renderSettings -gin $ign[0]`;
print("gin = " + $gin[0] + "\n");
<output>ign = %s.%e
<output>gin = untitled.iff

But after set "Frame/Animation.ext" to "name.#.ext" on Render Settings window, code above make maya hang up.

Do I misunderstand how to use this command? or any other way?

 

 

0 Likes
985 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
// Get the name of the first and last image for the current layer
string $fl[] = `renderSettings -firstImageName -lastImageName`;
print ("First image is "+$fl[0]+"\n");
// This is the empty string if the scene is not set for animation
if ($fl[1] == "") {
	print "Not rendering animation\n";
} else {
	print ("Last image is "+$fl[1]+"\n");
}

 

0 Likes