List file texture from an object selection?

hi everybody

I would like to list all files (textures) connected to a selection ( an objet )
can you help me please.
I just want to change the path of all the textures connected to the objects selected to be able to have multi resolution maps in differents folders, but maybe there is already a tool to de this ???

I'm pretty dang sure this has been covered in the forums before.... have you tried searching them?

yes I m so sorry but I can t find something really interesting for me in the next 10 pages of the forum

um.. why are you manually searching forum pages...? Warpcat meant why don't you actually use the "Search" feature.. ?

Anyway, there are at least two MEL scripts that replace paths and re-point textures in the MEL scripts section. One is called replaceTex.mel and is a manual command line tool (probably better for you if you want to hook it up to your own procedure) and the other is called FileTextureManager.mel and this is an all-singing-all-dancing UI that will manage your textures in a number of ways...

:nathaN

are you saying you want to re-point the file texture for JUST the SELECTED objects? I'm no expert on shaders but I think this will mean you having to assign a NEW material, if you don't want every texture to change... is this what you want? cos that would get quite messy quite quickly.. I think.. although it could be done quite easily...

anyway, the 4 lines below will list every file texture connected to the selected object(s) (into the variable array "$files"):

string $sel[] = ls -l -sl -tr;
string $shader[] = listHistory -f 1 $sel;
string $history[] = listHistory $shader;
string $files[] = ls -type "file" $history;

be aware though that there is some weird "bug" in Maya that allows multiple shaders to be connected to an object even though they are not visible on any of it's faces... anyone know what that's all about...?

:nathaN

New shader for this naaaw no you dont need that! You could allways use a shading switch instead!

thanks for these answers.
the aim goal of this script would be to change only the path of the textures connected to the selected objects, but I don t understand why it could force me to create another shader ???
in the case you have a character in front of the camera and another far away I just want to be able to decrease the resolution of the one wich is away. oufff

well, as Joojaa suggested, you won't have to create any new shaders because you can use "switches" (whatever they are ) but why do you want to do this anyway? doesn't mip-mapping do this? adding more textures will only increase your memory footprint....?

A switch is a node that allows a shader to read data form different pasrts so for example you could have many textures connected to the material at once.

Wich means less materials on screen burt exal amount of textures.

but yeah mipmapping is multiresolution texturing! so youd want to use one BOT (and convert it to something similliar in your gamne eingene) file instead!

Razowski says he wants a high res texture to look lower res in the distance. If this isn't the basic function of mip-mapping I don't know what is...

No prob you read my first dfraft wich i then corrected! (while you answered me!)

Yes he wants BOT textures or maps mentalray.

heh, that's the problem with automatic emailed replys

Ps i do iterate (especialy if im not entirely sure if i was right or not, like now) so i can write an answer go back read the entire thing again and change what i said. mostly it takes me 2-3 rounds to get it right! im fast so the ones that do read in between are few and far between.

hahah now I'm gonna have to edit MY post!

heh, people reading this in the future are gonna be confused as hell

yes I m confused and this was my post at the begining so I imagine for the others.
finally it s very interesting what I heard here.
Are you tell me that something like the .map in MR exist in maya (bot ?).
I m sorry I don t know this "option" as I m learning maya by myself, but if it works like the MR one it s exactly what I m looking for with my 1gig of texture
can you tell me more, how it works and if it works with MR too ??? big thanks

Yes, thats it! Theres a command line tool to do this also running optimize shece from command line automaticaly does thi hit f1 and consult your manual.