Message 1 of 1
fileTextureName auto suffix replace by expression

Not applicable
01-12-2017
06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!
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!