user string

Is it possible to import a string attribute via a “userString” node or so. Like with “userColor” but for strings. I want to drive the file parameter of an image file node with a string attribute.

kind regards
Jon

I don’t think you have to do anything except add it as a token in the filepath.

Sorry, I’m not quite following. Are you saying I should read the attributes straight from the filepath parameter?

No that’s not how that works. Can you tell us what you want to achieve?

We can control material properties using geometry attributes. For example, the color of a material can be driven by “User Color” nodes, while parameters like glossiness can be controlled with “User Float” attributes.

What I’d like to achieve is similar for the file path of a V-Ray image file node—controlled by a geometry attribute, such as a “User String.” However, there is no “User String” node available. The intended effect would be the same: just as a “User Float” adjusts glossiness based on a geometry attribute, I want to apply the same principle to the file path parameter.

Essentially, I want to replicate the functionality of the “MultiTex” node, but instead of manually loading all the images and connecting them to MultiTex, then controlling them again with a “User Integer,” I’d prefer to use my string geometry attribute directly in the image file node. This approach would be much faster and more efficient for me.

Ok, I’ve done this before as well, here are the steps:

in your geo sopnet create attributewrangle node with this string where S2ver = “v001”; is your user attribute which you want to drive in your shader. You can have as many as you want. I usually have version for textures and source (because we like to switch from original tex format like exr, png, tiff etc to .tx for final render)

Then you need to pass these attributes through vray obj properties node which is added to the sopnet in obj level


Once you do that, you can type those strings in the file image path of your imageFile node like /textures/<ver>/<rez>/

After you do this, you can create custom attribute on top of your geo sopnet and pass them to the attribute wrangle node.​​

Hey Dimitry, thanks for your explanation and sorry for the late reply—I thought I had already written back^^ but I just saw that I hadn’t responded yet.
This is exactly the kind of approach I had in mind. I’m just wondering now whether attributes can only be forced on the Object Level. My geometry is usually stored in digital assets. These are then pulled in via object merges from the digital assets. So you would always need to know which attributes to force. It would be great if this could be set on the geometry level. However, the Object Properties (geometry node) doesn’t have a shading tab where you could force attributes.