Nerox Posted August 3, 2011 Share Posted August 3, 2011 I have a Python SOP which sometimes doesn't seem to recook when it, in my opinion, should. I wonder if there is code available which can handle this? I imagine a flag on the node which can be set in order to trigger a cook. This can happen when the incoming geometry changes or when a parameter is updated for instance. You would expect that this is a default thing, but it doesn't seem so. Quote Link to comment Share on other sites More sharing options...
graham Posted August 3, 2011 Share Posted August 3, 2011 Can you provide an example file of it not cooking. You can force a node to recook by calling hou.Node.cook(True). You could call this from a node event callback on a parm tuple change but it shouldn't really be necessary. Quote Link to comment Share on other sites More sharing options...
Nerox Posted August 5, 2011 Author Share Posted August 5, 2011 Frankly I haven't been able to reproduce this, I might have been caused by something else. Sadly I don't know what, at the same time I ran in to viewport redraw issues. At a certain point I had to reboot for something else and both problems vanished... That's actually a good thing :-), never the less it would have been nice if I knew the cause. Quote Link to comment Share on other sites More sharing options...
Klockworks Posted September 1, 2011 Share Posted September 1, 2011 I have found one of the easiest ways to get a python node to recook is to add an arbitrary button to the parms. It does not have to have a callback script or anything on it, but when you click it it will cause a recook. Quote Link to comment Share on other sites More sharing options...
Nerox Posted September 1, 2011 Author Share Posted September 1, 2011 I have found one of the easiest ways to get a python node to recook is to add an arbitrary button to the parms. It does not have to have a callback script or anything on it, but when you click it it will cause a recook. Nice! :-) Thanks for sharing Klockworks Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 12, 2013 Share Posted August 12, 2013 (edited) hmmm... I'd love to have somebody revisit this issue as I have a python sop that loads transforms from an alembic cache and I need it to recook for every frame but it won't. I even have a parameter scripted as $FF, plus if I query the node to see if it's time dependent or not it returns True. It'll only cook if it's display/template flag is on, which is not always the case. Cheers Edited August 13, 2013 by rafaelfs Quote Link to comment Share on other sites More sharing options...
graham Posted August 12, 2013 Share Posted August 12, 2013 Does your Python SOP actually evaluate the parameter with $FF in it? If not it won't build the dependency. You could also just add a useless call to hou.frame() in your code to do it as well. Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 13, 2013 Share Posted August 13, 2013 (edited) I do evaluate the parm that contains the $FF like this: myTime = node.evalParm('frame')[/CODE]I just tested with adding the useless call to hou.frame() and still it'll only recook if the node is templated or displayed.Cheers Edited August 13, 2013 by rafaelfs Quote Link to comment Share on other sites More sharing options...
graham Posted August 13, 2013 Share Posted August 13, 2013 Sorry, I missed that part about display/template above. That makes sense since Houdini isn't going to cook a node it doesn't have to. If there is nothing referencing the node that needs it to cook and it isn't somehow being displayed then I wouldn't expect it to get cooked since it would essentially be a waste of resources. Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 13, 2013 Share Posted August 13, 2013 But I do have some other nodes down the chain that are referencing parameters in my python SOP and it still won't cook. I had a similar setup that was working in 12.1, where I was grabbing the alembic transforms via an alembic CHOP. I would later reference copy the paramter with the chop() expression and still It would return current frame transforms even if the referenced node wasn't being displayed and even if it was frozen by a timeshift SOP. Was it mere luck? Quote Link to comment Share on other sites More sharing options...
edward Posted August 14, 2013 Share Posted August 14, 2013 Do you have an example .hip ? Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 14, 2013 Share Posted August 14, 2013 Here's an example. It's got a sticky note inside explaining the problem. I just want to make the python sop cook every frame independently of it's display flag. Cheers cook_test.otl cook_test.hip Quote Link to comment Share on other sites More sharing options...
edward Posted August 14, 2013 Share Posted August 14, 2013 I read the sticky note in your file, and it's supposed to behave that way. You have nothing referencing the data of "cook_test2" and there's nothing being displayed that uses the output of cook_test2. You have a ch("../cook_test2/time") but that refers to the *parameter* time, not to the data of cook_test2. 1 Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 16, 2013 Share Posted August 16, 2013 I see, so if I want it to cook I have to generate some geometry in the python SOP and convert my data to point attribute? Or something like that? Interface updates won't force the node to recook, right? Cheers Quote Link to comment Share on other sites More sharing options...
graham Posted August 16, 2013 Share Posted August 16, 2013 Yes, you need to force something in your session to actually use the geometry generated by your Python SOP in order for it to evaluate. 1 Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted August 16, 2013 Share Posted August 16, 2013 Yes, you need to force something in your session to actually use the geometry generated by your Python SOP in order for it to evaluate. Ok, I've worked this into my code, seems to work great, but I'll need to further test next week Thanks a lot, guys! Cheers 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.