Jump to content

vm_imagefilesuffix


jonp

Recommended Posts

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 by jonp
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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 os
import imp
import sys
# import everything from the original IFDframe as a replacement, then replace the stereo filename function
hh = 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 by jonp
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...