File SOP: use detail value in file's naming?

   2169   6   0
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi!

I'm saving one UDIM at a time from my geo. I would like to use my @UDIM (detail) and have it automatically be part of the file's name. So if my detail @UDIM is 1021 it should save the file:

geo.1021.fbx

How to do that?

-Olivier
User Avatar
Member
1004 posts
Joined: April 2017
Offline
…I've made some progress.

I used a detail wrangle with this:

int selectedUdim = detail(0, "selectedUdim", 0);

string path = chs("path");
string geoName = chs("geo_name");
string sUdim = itoa(selectedUdim); 
string fileType = chs("fileType");
string dot = ".";

s@fullPath = path + geoName + dot + sUdim + fileType;

That gives me the path I wanted: E3D/_Houdini_Room/geo/Semi_circle/SemiCircle.1009.fbx

The problem is when I try to use a detail function in the ROP_FBX sop. The function doesn't work. Probably because it thinks detail(0, “fullPath”, 0) is a string and not a function. How to solve this?

-Olivier
Edited by olivierth - March 17, 2019 14:21:55

Attachments:
vex_strings.JPG (77.8 KB)
rop_fbx_detail_string.JPG (44.9 KB)

User Avatar
Member
84 posts
Joined: July 2013
Offline
i guess you have write inside backticks: ´detail…´. a string needs this to know when it have to evaluate an expression.
User Avatar
Member
1004 posts
Joined: April 2017
Offline
I copy/pasted your backticks (don't know how to do those on my keyboard). Should the detail function turn green if it's recognized as a function? The text stays white and when I save, it doesn't save my file.

-Olivier
Edited by olivierth - March 17, 2019 18:25:52

Attachments:
backticks_path.JPG (22.3 KB)

User Avatar
Member
8535 posts
Joined: July 2007
Online
you have to use details() function to get string attribute values

so it'd be:
`details(0, "fullpath")`
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
7749 posts
Joined: Sept. 2011
Offline
The backtick is also called the ‘grave accent’ key.

I don't know what keyboard layout you use but it is in the upper left corner on a US keyboard layout.
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Ah! So it's not the same function. I was trying detail without “s”. …That's also why I thought my keyboard shortcut gave me the wrong ticks.

Thanks, I'll use this soon!

-Olivier
  • Quick Links