View Full Version : How to get texture size like 512*512

01 January 2008, 06:58 AM
I haven't find any command to get texture size like 512*512 or 1024*1024,

how to get maya file's(.mb) size?

I will appreciate if anyone give some info.

01 January 2008, 07:31 AM
I've got it!

getAttr file1.osx;

left question:
How to get .mb and .tga files' size?

01 January 2008, 04:41 PM
Not sure if there's a shorter or more efficient way to get round this but try the following:

string $dir[];
tokenize (system("dir c:\\myScene.mb")) " " $dir;
print $dir[15];

Hope this helps!

01 January 2008, 11:09 PM
Is that a two part question? To find the texture size you have to walk the shader tree's and you can then find the size of the textures in the scene.

//Get Images X and Y sizes
print ("Get Images X and Y sizes\n");
int $textureX = `getAttr $myFileName.outSizeX`;
int $textureY = `getAttr $myFileName.outSizeY`;

01 January 2008, 09:28 AM
You mean:
int $textureX = `getAttr ($myFileName + ".outSizeX")`;
int $textureY = `getAttr ($myFileName + ".outSizeY")`;

hey dir is nice but .. here in germany it spits out the wrong piece. here its:
string $dir[] = stringToStringArray((system("dir C:\\videos\\angriff_1.avi")), " ");
print $dir[12];

Edit: can it be that the code indentation is somehow screwed up on cgtalk?

01 January 2008, 02:42 AM
Thank you guys!!!

Problems solved.

CGTalk Moderation
01 January 2008, 02:42 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.