python loading the wrong frame in python sop - Scripting - od|forum Jump to content

python loading the wrong frame in python sop


Dee

Recommended Posts

I made a little tool at the facility I'm working at and it's failing.  I can't figure out why.  Would any of the amazing experts here know what I'm doing wrong?  I use the python sop to load geometry, but different geometry based on the switches at the top level of the hda.  It seems to just pick a frame at random and load that one when submitted to the farm using a non-ui render license, then freeze and never change the frame loaded when each new frame is rendered.  However, when loading locally, it works just fine.  Would anyone know the cause of this?

Here's the code from the file loader, in case you need to see that to know what I'm doing wrong.  I'm still very new to python:

import os
node = hou.pwd()
n = hou.pwd()
geo = node.geometry()




#Get shot and user specific information from UI
try:
  user = n.parm("../user").eval()
except:
  print "failed to find user"
  user = "failed"


try:
  show = n.parm("../show").eval()
except:
  show = "failed"
  print "failed to find show"


try:
  shot = n.parm("../shot").eval()
except:
  print "failed to find shot"
  shot = "failed"


try:
  seq = n.parm("../seq").eval()
except:
  print "failed to find seq"
  seq = "failed"


try:
  version = hou.expandString('$VERSION')
except:
  print "failed to find version"
  version = 1


#take is this facility's sub-version or revision number
try:
  take = hou.expandString('$TAKE')
except:
  print "your take is not set in this file"
  take = 1


try:
  cachename = node.parm("../cacheName").eval()
except:
  print "failed to find cachename"
  cachename = "failed"




forcever = node.parm("../ForceVer").eval()
doproxy = node.parm("../doProxy").eval()
if forcever == 'default':
  forcever = 'v' + str(version).zfill(4) + '_t' + str(take).zfill(4)
#frame = hou.expandString('$F4')
frame = int(hou.frame())


pathname = '/jobs/' + show + '/users/' + user + '/' + seq + '/' + shot + '/fx/cache_geo_houdini/' + cachename + '/' + forcever + '/'
filename = show + '_' + seq + '_' + shot + '_fx_' + cachename + '_' + forcever + '.' + str(frame).zfill(4) + '.bgeo.gz'
proxfile = show + '_' + seq + '_' + shot + '_fx_' + cachename + '_' + forcever + '_PROXY.' + str(frame).zfill(4) + '.bgeo.gz'


if doproxy:
  #load prox
  if os.path.exists(pathname + proxfile):
    hou.Geometry.loadFromFile(geo,pathname + proxfile)
  else:
    #print 'writeprox'
    hou.hscript('opcook -F ../OUT_proxy_failed')
    hou.Geometry.loadFromFile(geo,pathname + proxfile)
else:
  #load full
  if os.path.exists(pathname + filename):
    hou.Geometry.loadFromFile(geo,pathname + filename)
  else:
    print 'Cache file not found.'
Edited by Dee
Link to comment
Share on other sites

  • 8 months later...
  • 1 month later...

Yes, actually. :-)

I had been updating the otl frequently. When you do that and the version updates on the farm, the frame freezes. When I stopped tweaking it so much there were no problems.

Link to comment
Share on other sites

Oh, I wasn't changing the code of the Python node. that always stayed the same. I was adding extra nodes into my otl for more added functionality. importing the code would probably work if that was what I was changing. since the tool itself changed a little bit, it caused a problem. it didn't seem to matter that the part of the tool I was changing had nothing to do with the Python node.

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...