fileTextureName auto suffix replace by expression

fileTextureName auto suffix replace by expression

Anonymous
Not applicable
406 Views
0 Replies
Message 1 of 1

fileTextureName auto suffix replace by expression

Anonymous
Not applicable

 

Hi. Is there a way in maya to automatically switch file image name suffixes or prefixes depending on situation.
Say, I have the few file nodes connected to a shader: for roughness, albedo, height, normal etc. The files themselves have their own naming convention: brick_height, brick_albedo, brick_roughness etc.

It could be usefull to change only one texture at a time, when the other file nodes take common part of filepath and replace only one particular part of it.
Leave "C:\textures\bricks\brick_***.exr" and change only symbols in *** part with a _albedo,_roughness etc.

I have simple expression
string $A=`getAttr -x file1.ftn`;
string $Disp = `substitute "Albedo" $A "Displacement"`;
setAttr -type "string" file.fileTextureName $Disp;
But the last line evaluating only once, I need some condiition when it happens everytime I change Albedo texture in particular filenode.



Thanks!


0 Likes
407 Views
0 Replies
Replies (0)