[Sidefx-houdini-list] HOM changing geometry selection

Tom Nixon ignivomous at gmail.com
Thu Jul 27 18:18:52 EDT 2017


Looks like you were both right. Andy pointed me to the code that got me
sorted out regarding the selectGeometry function. I had to explicitly
set use_existing_selection=False

Thanks!

On Thu, Jul 27, 2017 at 10:57 AM, Tom Nixon <ignivomous at gmail.com> wrote:

> Hi Chris,
>
> Thanks for the suggestion. I'm afraid toolutils.sceneViewer().selectGeometry()
> doesn't seem to have a way to skip the prompt, and I haven't found a way to
> give it an arbitrary initial selection.
>
> Cheers
>
> On Thu, Jul 27, 2017 at 7:14 AM, Chris Rydalch <crydalch at gmail.com> wrote:
>
>> Not sure if this is helpful, but toolutils has a way to prompt for
>> geometry
>> selection in the viewport:
>>
>> >>> import toolutils
>> >>> toolutils.sceneViewer().selectGeometry()
>>
>> The selectGeometry() method has some arguments for what type of geometry
>> to
>> select.
>>
>> On Thu, Jul 27, 2017 at 3:44 AM, Andy Nicholas <andy at andynicholas.com>
>> wrote:
>>
>> > Hi Tom,
>> > I’ve got half an answer for you. If you create a string parm on some
>> node
>> > and fill it with point IDs, you can use the following python code to
>> load
>> > it as a selection in the current viewer, edit it, and set it back to the
>> > original parameter. It basically works a bit like the “re-pick” button
>> for
>> > group parameters.
>> >
>> > # Set these up to point at your node and string parameter name
>> > this_node = hou.node('/obj/geo1/subnet1')
>> > parm_name = "point_group_str"
>> >
>> > kwargs={}
>> > kwargs["node"] = this_node
>> > kwargs["parmtuple"] = n.parmTuple(parm_name)         # The name of the
>> > parameter to read/write
>> > kwargs["geometrytype"] = hou.geometryType.Points    # The geometry type
>> of
>> > the ids in the parameter
>> > kwargs["inputindex"] = 0
>> #
>> > The input index of the node
>> > soputils.selectGroupParm(kwargs)
>> >
>> > So the code you need is all in the soputils.selectGroupParm() function.
>> > That’s why I’m saying this reply is only half an answer, as you’ll need
>> to
>> > copy that function and reduce it down to the fundamental functionality
>> that
>> > you need. The important call is to “selectGeometry()" at line 300. It’s
>> > undocumented and I’ve not had time to figure out the exact parameter
>> values
>> > you need to pass it to get what you’re after, but I’m fairly sure you
>> > should be able to get what you need.
>> >
>> > Hope that helps,
>> > Andy
>> >
>> >
>> > > On 27 Jul 2017, at 00:20, Tom Nixon <ignivomous at gmail.com> wrote:
>> > >
>> > > Thanks Andy,
>> > >
>> > > I would like to be able to provide a list of points/prims or their
>> > numbers
>> > > and have that change the selection in the viewport (feature request
>> made
>> > > for a tool I have).
>> > >
>> > > Seems the tools stop short of that ability - unless I'm missing
>> something
>> > > staring me in the face!
>> > >
>> > > Cheers
>> > >
>> > > On Wed, Jul 26, 2017 at 11:24 AM, Andy Nicholas <
>> andy at andynicholas.com>
>> > > wrote:
>> > >
>> > >> Check out the second paragraph on this page. I think it explains what
>> > >> you’re after:
>> > >>
>> > >> www.sidefx.com/docs/houdini/hom/hou/Selection
>> > >>
>> > >> Note that you have the constructor functions for hou.Selection where
>> you
>> > >> can create your own selection object and specify the points,
>> primitives,
>> > >> etc.
>> > >>
>> > >> Cheers,
>> > >> Andy
>> > >>
>> > >>
>> > >>> On 26 Jul 2017, at 18:49, Tom Nixon <ignivomous at gmail.com> wrote:
>> > >>>
>> > >>> Sorry, by change, I mean to set explicitly (not grow or shrink an
>> > >> existing
>> > >>> selection).
>> > >>>
>> > >>> On Wed, Jul 26, 2017 at 10:42 AM, Tom Nixon <ignivomous at gmail.com>
>> > >> wrote:
>> > >>>
>> > >>>> Hey all,
>> > >>>>
>> > >>>> I'm just hoping there is now some way to change the geometry
>> selection
>> > >>>> through HOM. I've come up short in the past, but maybe someone out
>> > there
>> > >>>> has come across a way to do it?
>> > >>>>
>> > >>>> Thanks,
>> > >>>> Tom
>> > >>>>
>> > >>> _______________________________________________
>> > >>> Sidefx-houdini-list mailing list
>> > >>> Sidefx-houdini-list at sidefx.com
>> > >>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> > >>
>> > >> _______________________________________________
>> > >> Sidefx-houdini-list mailing list
>> > >> Sidefx-houdini-list at sidefx.com
>> > >> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> > >>
>> > > _______________________________________________
>> > > Sidefx-houdini-list mailing list
>> > > Sidefx-houdini-list at sidefx.com
>> > > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> >
>> > _______________________________________________
>> > Sidefx-houdini-list mailing list
>> > Sidefx-houdini-list at sidefx.com
>> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>> >
>> _______________________________________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>
>
>



More information about the Sidefx-houdini-list mailing list