PDA

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


ooorc46
01-29-2008, 05: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.

ooorc46
01-29-2008, 06:31 AM
I've got it!

getAttr file1.osx;

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

Segmoria
01-29-2008, 03: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!

Omita
01-29-2008, 10: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`;

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

@segmoria:
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?

ooorc46
01-31-2008, 01:42 AM
Thank you guys!!!

Problems solved.

CGTalk Moderation
01-31-2008, 01: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.