read detail attribute(string type) to file path notworking.

   663   1   0
User Avatar
Member
6 posts
Joined: July 2022
Offline
i am trying to read detail attribute(where i store a file path) to the file sop with
`details('../attribwrangle8/', 'p')`
and this is the value i got
'D:/Houdini Projects/SimpleBuildingGenerator/geo/BuildingAssets/1/1/Building_a.fbx'
the file node wont load file and seems to be the reason of the begining and ending
'
, if i get rid of them manually in file sop, it works perfect.
i am not sure if it's because my stored value has extra '
if that is the reason, how do i get rid of the begining and ending ' in vex
i find it annoying when it comes to string that involve with slash/back-slashes, the \ and / always driving me crazy.
if not, maybe it's the hscript problem?


https://gyazo.com/2d082df03413c0f1d7f2ddcdb0895a66 [gyazo.com]

all i want to do is to send file path string to a file sop so that i could loading different models.

how do you guys deal string that involves path/slash/back-slash stuffs?

any help would be appreciate!
User Avatar
Member
40 posts
Joined: March 2018
Offline
Hey,

You can just remove ' in vex by s@p = strip(s@p, "'");

sdf/fsdf/sf works properly, but in any case you need df\sdf\sdf\ use vex function re_replace("/", "\", string);
  • Quick Links