Is it possible to set a file texture path as a string in an operator setParameter node and then refer to the string with a texture token in an image node within a shader?
eg - setParameter:
string difcol = 'path/to/texture'
image filename:
<attr:difcol>
If so, what would the correct syntax be please if the above is wrong?
With set parameter, you can create a user data string.
Then your should be able to use it like any other user data string with the <attr> token.
I haven't tried it.
It's not currently working for me in the way I have it written above, I wondered if it was a syntax issue?
It works, but there's a known issue with the colon in Windows drive specifications like C:
They get replaced with an underscore. Here's a debug-level Arnold log that shows what happens:
00:00:00 2084MB | initializing 15 nodes ... 00:00:00 2084MB | [operators] init op: 'aiSetParameter1' 00:00:00 2084MB | [operators] cook op: 'aiSetParameter1' | node: '/pSphere1/pSphereShape1' ... 00:00:00 2084MB | node initialization done in 0:00.00 (multithreaded) 00:00:00 2084MB | [operators] post cook op: 'aiSetParameter1' ... 00:00:00 2155MB ERROR | [texturesys] could not read resolved image filename = "C_/Users/blairs/Documents/maya/projects/default/sourceimages/noicon.jpg"
This is how a working setup looks in ass:
set_parameter { name aiSetParameter1 selection "/pSphere1/pSphereShape1" assignment "string myParam='Users/blairs/Documents/maya/projects/default/sourceimages'" enable_assignment 1 } image { name aiImage1 filename "C:/<attr:myParam>/noicon.jpg" color_space "" missing_texture_color 0 0 0 1 }