[Sidefx-houdini-list] Creating a shelf tool for custom otl

Tony Atherton tony_atherton at hotmail.co.uk
Wed Jul 12 06:57:43 EDT 2017


I have a feeling I should be able to use the hou.SopNodeType.addSelector() in a before first create script on my otl. Then I should be able to just use the boiler plate code:


import soptoolutils

soptoolutils.genericTool(kwargs, [node name])


and let Houdini handle the rest.


Anyone have any experience doing this?



Cheers,

Tony


________________________________
From: Sidefx-houdini-list <sidefx-houdini-list-bounces at sidefx.com> on behalf of Sam Swift-Glasman <glassman3d at gmail.com>
Sent: 12 July 2017 10:34
To: sidefx-houdini-list at sidefx.com
Subject: Re: [Sidefx-houdini-list] Creating a shelf tool for custom otl

Shouldn't be too bad in python

A few thoughts:
hou.ui.displayMessage()
hou.ui.selectNode() - selcet node

hou.selectedNodes() - returns an orderd list of the selected nodes in your
scene

createInputNode(input_index, node_type_name, node_name=None,
run_init_scripts=True,load_contents=True, bool exact_type_name=False)
is a handy function for setting input nodes to the current node by index

when i get home later can give you a more detailed response
cheers


On Wed, Jul 12, 2017 at 11:07 AM, Tony Atherton <tony_atherton at hotmail.co.uk
> wrote:

> Hi,
>
>
> I've got a custom otl which has 3 inputs. I want to create a shelf tool
> which displays custom prompts to the user and gets them to select three
> different sop nodes, which I can connect as inputs in to a new instance of
> my otl. I've managed to get this to work using the OPbindings file, but if
> I put just my otl information in an OPbindings file in my ~/houdini16.0
> directory it breaks things in Houdini (various handles for nodes etc), so
> unless I take a complete copy of this file from the install directory to my
> ~/houdini16.0 directory and append my otl information to it, it doesn't
> work . This method is not ideal as I'm in a production environment and I
> don't really want to have to update this file every time there's a new
> build installed.
>
>
> I know there's got to be a python way of doing this and I have found the
> hou.sceneViewer.selectGeometry function, which seems like it will do a lot
> of the work. I would still need to build some code around this though to
> connect the nodes, check for errors etc., so I'm wondering if anyone could
> offer any advice before I spend an afternoon writing lots of code which I'm
> guessing someone from sidefx must have already written somewhere and I'm
> just missing.
>
>
> Cheers,
>
> Tony
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
Sidefx-houdini-list Info Page<https://lists.sidefx.com/mailman/listinfo/sidefx-houdini-list>
lists.sidefx.com
To see the collection of prior postings to the list, visit the Sidefx-houdini-list Archives. Using Sidefx-houdini-list: To post a message to all the ...



>
_______________________________________________
Sidefx-houdini-list mailing list
Sidefx-houdini-list at sidefx.com
https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
Sidefx-houdini-list Info Page<https://lists.sidefx.com/mailman/listinfo/sidefx-houdini-list>
lists.sidefx.com
To see the collection of prior postings to the list, visit the Sidefx-houdini-list Archives. Using Sidefx-houdini-list: To post a message to all the ...






More information about the Sidefx-houdini-list mailing list