Jump to content

filename edit in python


itriix

Recommended Posts

how's it going? so i have a question about setting up an exp​ression in my mantra rop out pic field. What I want to do is use the $HIPNAME variable to help construct what I want the file out name to be... however, I want to remove the '.hip' part of the filename...

example:

$HIPNAME = awesome.hip

in my output pic, if i had the path set up, and used $HIPNAME as the "name of the file" then the name would be awesome.hip.$F4.tif instead of awesome.$F4.tif....

i was going to use python's string editing abilities to remove the last 4 characters but, couldn't seem to use the $HIPNAME variable when I was using python. I tried to look for a python-->hscript command that could use those variables but only noticed some python --> hscript functions instead of that.

thoughts anyone? thanks a lot

Jonathan

Edited by itriix
Link to comment
Share on other sites

and one more thing, what is wrong with this exp​ression?

$HIP/renders/$HIPNAME.$F4.tif

in the output picture of the mantra nod

FIXED:

it wasn't rendering because i had the wrong path to the camera :P

oh well, was my first attempt at making a camera and light set up as an HDA

Edited by itriix
Link to comment
Share on other sites

I do this for my render drivers:

$HIPNAME:r.$F4.pic

alright cool thanks! i'm aware of this notation when referring to objects in networks, and also in python as slicing.... just not sure what it's doing in this example...

$HIPNAME:r.$F4.pic

BTW it works fantastic tho ;)

thanks again

Jonathan

Edited by itriix
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...