jonp Posted September 10, 2012 Share Posted September 10, 2012 (edited) Hi, vm_imagefilesuffix appears to only attach camera names to the end of a file path string, but I want to insert the camera name into a different part of the string. Is it possible to do this without a hacky workaround? My own hacky workaround is to set vm_picture to just be the file extension, and add everything else to vm_imagefilesuffix. -Jon Edited September 11, 2012 by jonp Quote Link to comment Share on other sites More sharing options...
jonp Posted September 11, 2012 Author Share Posted September 11, 2012 OK I've figured out a potentially cleaner workaround by filtering the IFD using the 'mantra -P' flag, then having a Python script do: mantra.setproperty('image:filename', outfile) Now what I need to know is how to get or set the name of the camera in an IFD so the mantra module can read it as a property. Hi, vm_imagefilesuffix appears to only attach camera names to the end of a file path string, but I want to insert the camera name into a different part of the string. Is it possible to do this without a hacky workaround? My own hacky workaround is to set vm_picture to just be the file extension, and add everything else to vm_imagefilesuffix. -Jon Quote Link to comment Share on other sites More sharing options...
symek Posted September 12, 2012 Share Posted September 12, 2012 I love tricks with python filtering, lots of useful stuff we do with that. However you could use expression. For examples something like: $JOB/render/mantra/$USER/$OS.`opname(chs("camera"))`.$F4.exr may work for you. skk. Quote Link to comment Share on other sites More sharing options...
jonp Posted September 12, 2012 Author Share Posted September 12, 2012 I'm not quite sure how that would work with my setup, because I have five cameras rendered out of one mantra node. In the end I've basically gotten what I want from the output path by embedding some of the output string into the imagefilesuffix, but I would rather have all of the naming logic done in the mantra node itself. I love tricks with python filtering, lots of useful stuff we do with that. However you could use expression. For examples something like: $JOB/render/mantra/$USER/$OS.`opname(chs("camera"))`.$F4.exr may work for you. skk. Quote Link to comment Share on other sites More sharing options...
symek Posted September 12, 2012 Share Posted September 12, 2012 I'm not quite sure how that would work with my setup, because I have five cameras rendered out of one mantra node. That's why we use the expression. Whatever camera you set in Mantra node, the name of a file will update accordingly. Quote Link to comment Share on other sites More sharing options...
jonp Posted October 23, 2012 Author Share Posted October 23, 2012 (edited) I finally worked out a (sort of) pipeline-friendly fix for this. When generating IFDs with stereo cameras, soho's IFDframe.py file reads vm_filenamesuffix on the stereo camera and inserts that value into the file path, just before the frame number in the file path. There is no way in the GUI to override this. So I've created a new file IFDframe.py in my local houdini soho area that imports the original IFDframe and replaces the file suffix function with my own. My function puts the stereo name in as a folder, not a file suffix. I used a bit of Python trickery to try to make it forward compatible (unless the original IFDframe disappears or the original function name changes.): import osimport impimport sys# import everything from the original IFDframe as a replacement, then replace the stereo filename functionhh = os.getenv('HH')python_version = "%d.%d" % (sys.version_info[0], sys.version_info[1])soho_path = '%s/soho/python%s' % (hh, python_version)IFDframe_source = imp.load_source('IFDframe', '%s/IFDframe.py' % soho_path)from IFDframe import *def insertDomeChannelFolder(filename, file_suffix): """ Inserts stereo/dome camera name into the end of a directory path as a folder. Replaces insertFileSuffix in IFDframe.py. """ if file_suffix is None or file_suffix == '' or filename == 'ip': return filename file_dir, file_name = os.path.split(filename) return os.path.join(file_dir, file_suffix, file_name)insertFileSuffix = insertDomeChannelFolder[/CODE] Edited October 24, 2012 by jonp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.