python post-frame script

   5036   3   2
User Avatar
Member
230 posts
Joined: Oct. 2009
Offline
hello,

I wrote a simple script in python which will calculated it per post-frame in order to send the files generated from Houdini (simulations and renderings) over the network using ssh from each machine to my the external drive which is connected to my main machine. This script is this:

import os

frame = $F
padding = 4

file = “/home/i9089303/test/test.%0*d.jpg” % (padding, frame)

line = “scp -Cr ”+file+“ i9089303@pc18637media/VFX/”

os.system(line)

This version is the plan B. I wanted to be procedural by reading the file with its path, frame with padding and extension automatically by the output parameter -ex. ch(“vm_picture”)-. In this case the script would had this form:

import os

file = ch(“vm_picture”)
line = “scp -Cr ”+file+“ i9089303@pc18637media/VFX/”
os.system(line)

but it gives me back a warning and interrupts the rendering on the first frame. Warning: failed to load ‘SOP_unix.svg’ ‘/home/myusername/houdini11.1/config/Icons/SVGIcons.cache’ corrupted?

I know by testing it (using print and print type()) that it gives back a string which hold all the information which I need but for some reason this warning brakes everything.

any ideas how to fix this?
User Avatar
Member
8081 posts
Joined: July 2005
Offline
The error sounds unrelated to what you're doing. Rather it looks like an error when Houdini starts up because it thinks your icon cache is corrupted.
User Avatar
Member
230 posts
Joined: Oct. 2009
Offline
edward
The error sounds unrelated to what you're doing. Rather it looks like an error when Houdini starts up because it thinks your icon cache is corrupted.

thanks edward for the reply. Well I tested it with and without this command… that's why I came up with the long version of the script, and the error was coming only when I was using ch(). But today I tested it again and it is working just fine. Maybe was something wrong with the installation of Houdini on the machine I was using last time.

P.S. If anyone wants to use this script ever, it needs to add the following line at the top of the script(sort version) which I forgot when I posted it here: from hou import *

cheers
User Avatar
Member
68 posts
Joined: May 2013
Offline
Pardon my noob level but I thought I'd through out an idea that may or may not be useful in this and similar situations.
assuming you get out your parm (mantra filename node) maybe like so…
rn = hou.node('/out/mantra1')
fname = rn.parm('vm_picture')

file is fine to get with…
file = fname.eval()

that's the expandedString
  • Quick Links