V-Ray file name prefix python script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  06 June 2014
V-Ray file name prefix python script

Hello! I'm a beginner coder and I have a question about developing a python script that will edit the file name prefix of a file AFTER the tokens have been entered into the file name prefix box.

More specifically our problem is this: The way our pipeline is setup, when we save a scene, our software automatically saves with a new version number. So if we save a file called scene_0001 that uses the prefix tokens:

../renders/<Scene>/%l/v01/%l

the files will render with this prefix"

../renders/scene_0001/masterLayer/v01/masterLayer

when we save this file and go to render again, our pipeline will automatically increment to scene_v0002 during the save, making the new rendered files have this prefix:

../renders/scene_0002/masterLayer/v01/masterLayer

This creates a folder and organization problem because it's creating too many folders when we render and making things a mess. Our only fix for now is to keep manually naming prefixes before rendering. We want to keep the rendering process as streamlined as possible and remove the possibility of human error when manually renaming the render files. Would it be possible to make a script that can remove the _0001 from the file name? So the files will be called this when they are rendered:

../renders/scene/masterLayer/v01/masterLayer

My initial solution would be to stop giving the scenes version numbers, but that isn't possible with our current pipeline setup.

I'm not even sure if this is possible to do with code. With my limited knowledge on the subject the only thing i can think of is a script that intercepts the output files, searches the script for a specific string, and then deletes the unnecessary strings... but I have no idea how to execute this!

Thank you for your time!
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:14 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.