Relative Reference unable to read filepath

   279   2   1
User Avatar
Member
2 posts
Joined: May 2017
Offline
Hello Forum,
Ran into a weird one I can't figure out.

Right now I'm trying to figure out how to use relative references to update a filepath on an Attribfrommap node.



So this wrangle "works" in that if I give it this reference it loads the filepath and the A_FILENAME location correctly, output as "File_Path_Test" just to confirm it's working. (As seen in the 3rd screenshot)
However, I need to load this filepath while the "Decal_GraffitiA" path is a reference to a parameter on the parent node.

So here's my wrangle doing that.




However here's the two resulting test attributes.
As you can see the "combinedPath" script right now does not load the A_FILENAME filepath, and instead just loads it as a string of text.




I'm unsure how to make this script load the filepath as it does with the more explicit path, while still loading and updating based on the "../Material_Assignment2" string. Which is a material picker.
Which I'm hoping will update the path, as I'm maintaining the same names for "opacity/A_FILENAME" and could be used to quickly change the filepath in the attributefrommap node and be used to procedurally remove geo without color.

Here is the attributefrommap node, which, Ideal in the "texture map" section would be pointed towards whatever drives it to load the filepath based on whatever material is assigned in the material_assignment2 string as previous.



Thanks in advance!
And if you need anything clarified let me know.

I'm working on a test file to share, but I'm using octane materials, and a lot of currently loaded textures that would be hard to package. So hoping it's a simple script fix.

Attachments:
Wrangle3.JPG (39.1 KB)
Wrangle2.JPG (49.9 KB)
MergeWithPathsListed.JPG (32.8 KB)
FilePathTarget.JPG (51.8 KB)

User Avatar
Member
8555 posts
Joined: July 2007
Offline
Rkelly1912
As you can see the "combinedPath" script right now does not load the A_FILENAME filepath, and instead just loads it as a string of text.
Based on your code filePath contains absolute path to your opacity parameter
And that's exactly what you see when written into combinedPath attribute
Since opfullpath() just converts relative path to absolute

If you want to evaluate that parameter you can use chs() function as you did for your test

Using your combined absolute path to the parameter
string filePath = chs( filePath ); 
or even the relative path to the parameter
string filePath = chs( combinedString );
Edited by tamte - Feb. 20, 2024 15:37:00
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2 posts
Joined: May 2017
Offline
Hey Tamte,

That works, I figured it was something simple.

Thanks!
  • Quick Links