Jump to content
macj89

Use a portion of $HIPNAME in ROP

Recommended Posts

Hi guys!

I was wondering if i could use a portion of the $HIPNAME (scene name) to name my renders.

Example:

SH001_mountain_v1.hip

So, what I want, is my render file name look like this:

SH001_mountain_$OS_v1_$F4.exr

 

So, basically we are looking a way to extract the first 14 characters from the $HIPNAME aswell the last 2 characters (version number).

I know it's posible with Python but i am trying to avoid it, since we tried and it gave us a lot of errors (we are not coders).

Is this thing posible with Hscript or should i go deep into python?

Thank you very much guys!

Share this post


Link to post
Share on other sites

You can try doing it in VEX, putting $HIPNAME in a parameter, create a string variable initialized with chs("ref_to_your_param"), and then use the split function on this variable (and other VEX functions on strings), to keep the parts that you want, and use sprintf to concatenate the full path you need, and then putting that into an attribute at detail level. Then create another parameter on your Wrangle, in which you will use detail() to get the path into the parameter, that you can reference on your mantra node inside the image filename.

Alternatively, in this case, I am wondering if you could use substr() :

`substr($HIPNAME, 0, 15)`$OS_`substr($HIPNAME, 16, 2)`_$F4.exr

Try it and let us know

Edited by StepbyStepVFX
  • Thanks 1

Share this post


Link to post
Share on other sites

A consistent and user friendly way of doing it would be to add something to the $HSITE launch scripts (123.py, 456.py) where it takes the scene file name and creates a new variable like $HIPBASE that excludes the version number. Then use that variable in the file name rather than screwing around with expressions on the parameter.

  • Thanks 1

Share this post


Link to post
Share on other sites

I am not a good coder and i am having a really hard time with this thing. I already had a bad time with python and I was trying to get a solution via the normal hscript.

So, where am I now:

1. My $HIPNAME is this one:  SEQ_SH0000_globalfx_v001_mac

2. I create a $RENDER global variable, non procedural, because this folder has to be on the same level of $HIP but I don't know how to set up procedurally haha

3. Following @StepbyStepVFX advice, i wrote this down:

$RENDER/`substr($HIPNAME, 0, 11)`${OS}/`substr($HIPNAME, (abs(strlen($HIPNAME))-8), (abs(strlen($HIPNAME))-4))`/`substr($HIPNAME, 0, 11)`${OS}_`substr($HIPNAME, (abs(strlen($HIPNAME))-8), (abs(strlen($HIPNAME))-1))`.$F4.exr

 

It should be giving me this naming:

..../render/SEQ_SH0000_object_task/v001/SEQ_SH0000_object_task_v001_mac.1001.exr

but it is giving me this:

..../render/SEQ_SH0000_object_task/v001_mac/SEQ_SH0000_object_task_v001_mac.1001.exr

 

So,  I got it almost!

I just have to get rid of that _mac that is not working as expected, is like the STRLEN is not detecting properly the character numbers for  v001_mac    , i can get rid of the v001 but i can't get rid of the  _mac.

`substr($HIPNAME, 24, 28)` gives me  _mac 

`substr($HIPNAME, 20, 24)`gives me v001_mac instead of v001, that it doesn't make any sense. 

 

Thanks guys! I will get into that $HSITE thing, its the first time that i hear that! haha

 

*attaching the hip

SEQ_SH0000_globalfx_v001_mac.hiplc

Edited by macj89

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×