Search - User list
Full Version: OnGenerate & SendCommand
Root » PDG/TOPs » OnGenerate & SendCommand
nimnul
Hi,

Suppose, I want to set a couple attributes to use only for this Command Send node. With Python processor I would create them in OnGenerate with NoCopy flag set. To create those attributes I might need to access node's ports.
Or, say, I need to set expected result data for a particular Command Send node, is there a way to do that currently?

What I do now is I create attributes in Python Processor(create attributes) → Command Send → Delete Attributes and wrap it all into an HDA. But there are a few questions/problems with that:
- I need to copy and link parameters on my Python Processor and wrapper HDA in order to access them as ports
- If I want to check spare parameters on the parent HDA I need to use hou.Parm.eval(), I suspect it wont evaluate with respect to current work item unless I have it selected, is that correct?
- I cannot use NoCopy flag as it seems pdgjson does not provide access to upstream items and its attributes
- How do I go about expected result data?

I feel like having an option to expose and edit OnGenerate on Command Send along with Save As HDA button might answer all those questions, does that make sense?
By the way, can I inherit from SendCommand? Or am I risking to create more problems for me than it actually solves?

Thanks,
Pavel
chrisgreb
nimnul
- If I want to check spare parameters on the parent HDA I need to use hou.Parm.eval(), I suspect it wont evaluate with respect to current work item unless I have it selected, is that correct?
You can use a method to ensure the parm is evaluated with respect to your work item.
with work_item.makeActive():
    val = hou.parm("../../tx").eval()

How do I go about expected result data?

This is trickier but makes sense - I'll add an RFE to expose this on the Send Command TOP.

I feel like having an option to expose and edit OnGenerate on Command Send along with Save As HDA button might answer all those questions, does that make sense?
Yes, also makes sense. We'll consider that.

By the way, can I inherit from SendCommand? Or am I risking to create more problems for me than it actually solves?

There's no nice way currently to replace a node implementation. But it's probably less trouble to just copy the code you need to make your own “SuperSendCommand”. The Send Command code is in commandchain.py in $HFS/houdini/pdg/types/..
nimnul
Hi Chris, thank you for the detailed response.

chrisgreb
You can use a method to ensure the parm is evaluated with respect to your work item.
with work_item.makeActive():
    val = hou.parm("../../tx").eval()

Neat, I'll use that!

How do I go about expected result data?

This is trickier but makes sense - I'll add an RFE to expose this on the Send Command TOP.

Great! Also, can Command Chain as a whole have expected result data to avoid firing up command server altogether if everything is in place? Something like expected result data on start server item or a way to check command chain individual nodes for their respective results.


By the way, can I inherit from SendCommand? Or am I risking to create more problems for me than it actually solves?

There's no nice way currently to replace a node implementation. But it's probably less trouble to just copy the code you need to make your own “SuperSendCommand”. The Send Command code is in commandchain.py in $HFS/houdini/pdg/types/..

I see. I'll probably do that for the time being, but gladly get rid of it as soon as I can do that with the stock nodes.
chrisgreb
“Copy Spare Parms to Attributes” and “Expected Outputs From” have been added to 18.0.453.
The command chain as a whole can not cook from cache yet, just the internal nodes. There's an RFE to add that capability but it requires a bit more work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.