Jump to content

Fixed: getting past Recursion in parm callback


static

Recommended Posts

So I have a post render script on a mantra node (named 'test_singleFrames') that edits the frame range and renders again (trying to render single frames in a batch mode). But when it reaches the callback script, I get a warning/error:

test_singleFrames:Render - Recursion in parm callback

Just off the top of anyone's head, is it possible to get past this detection? I'm trying to run a somewhat recursive function ...obviously.

The code for the callback script is as follows:

def isolate_frameRange(frames,node):
	'''
	frames => list of frames to render, node => hou.Node() for rop

	Edits the mantra nodes frame range and renders
	'''
	nextFrame = frames[0]
	remaining = ''
	node.parm('f1').set(nextFrame)
	node.parm('f2').set(nextFrame)
	if len(frames) > 1: #<--------------------- basically the recursion limit
		for f in frames[1:]:
			remaining += '%s,' % f
		remaining = remaining[:-1]
		post_script = 'import test;test.isolate_frameRange([%s],hou.pwd())' % remaining
		node.parm('postrender').set(post_script)
		node.parm('execute').pressButton() #<------ assuming this is the culprit for that recursion problem
	else:
		print '...Render Completed'

Of course, if there's a better way to go about batch rendering single frames, I'm all ears :lol:

EDIT: Well I replaced some of the code so it would just spawn a new node and render from it, rather than trying to repeatedly render the same node over and over... and the recursive error went away.

Edited by static
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...