Jump to content

Triggering a top cook from hda interface


Recommended Posts

Hi there

I am currently making a HDA that takes a mesh, does an infection solve and spits out resulting textures; I have finally got my top graph cooking fine however I am a bit lost as to how the user will actually trigger it from the HDA interface.

Promoting the force cook on the topnet doesn't work and even when normally activated, it seems to use up all houdini's threads as opposed to a cook from within the graph.

I have also been scouring the pdg python module docs to see if I can trigger the network to cook from a callback script.

The furthest I have got on that front is the cook method on both pdg.GraphContext and pdg.Node objects.

pdg.GraphContext.cook() seems to want a CookOptions object which I don't know how to generate or manually create.

pdg.Node.cook() wants a block argument and I am also lost as to what that is, I've tried using block=1,1 etc

I found a py file called top in /houdini/python2.7libs/pdg/job/ which contains a function called cookTopNode. This looks promising however I don't know how to call it nor which module/object it is a member of.

I'll provide a scene file if needed, just needs a bit of decluttering first

Any help is greatly appreciated.

George

Link to comment
Share on other sites

9 hours ago, Andr1 said:

Hi, it seems that you have looked into the pdg api, but probably you want to use the hou.TopNode class instead and more precisely the executeGraph() function

https://www.sidefx.com/docs/houdini/hom/hou/TopNode.html

let me know if you succeed as I'll have to do the same soon (cook topnet from hda)

cheers

Hi there

Thanks for the response.

I've spent all day trying to figure this one out. 

The function you mentioned worked but neither that nor the functions I mentioned earlier seem to trigger the pdg nodes to re-evaluate their parameters. They will cook with the same parameters you used on the first cook in that instance of houdini. I also cannot find a function on any of the relevant pdg/hou classes that will force the nodes to re- eval.

I am yet to find something that replaces a shift+v on the output node.

At this point I am tempted to get the user to just enter the node and hit shift+v themselves although that is far from ideal.

Link to comment
Share on other sites

On 8/2/2019 at 11:48 PM, ColecloughGeorge said:

 They will cook with the same parameters you used on the first cook in that instance of houdini. I also cannot find a function on any of the relevant pdg/hou classes that will force the nodes to re- eval.

I am yet to find something that replaces a shift+v on the output node.

Hi, as I mentioned I yet have to test this workflow, but isn't dirtyTasks() function what you need for it?

Link to comment
Share on other sites

2 hours ago, Andr1 said:

Hi, as I mentioned I yet have to test this workflow, but isn't dirtyTasks() function what you need for it?

Yeah, I thought so too but if you change the parameters on the hda, then use either dirtyTasks or dirtyAllTasks with or without the remove all argument, the graph will still not recognize the new paameter changes, This is also true of the pdg dirty functions. 

However this may be isolated to my file/machine/os so I would still say it's worth checking out

Link to comment
Share on other sites

9 hours ago, Andr1 said:

Hi, as I mentioned I yet have to test this workflow, but isn't dirtyTasks() function what you need for it?

Scratch all that. It turns out I wasn't saving my hip file and pdg pulls from a hip and not the current session.

Just stick a little dialogue box asking to save before you do your top cook. :)

  • Like 1
  • Thanks 1
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...