set Initial the selection when enter the selecton mode in sceneViewer

   1488   2   0
User Avatar
Member
42 posts
Joined: Aug. 2016
Offline
How could I possibly enter the selection mode with point “1 2 3” is selected when I press a button on HDA ?

I have the code below, but it didn't select anything when selection mode is entered.

import toolutils
selection = toolutils
selection.sceneViewer().selectGeometry(use_existing_selection=True, initial_selection = “1 2 3”,)
User Avatar
Member
8525 posts
Joined: July 2007
Online
you need to be more specific than that, what is “1 2 3” you expect points, but how does houdini know?

import toolutils
toolutils.sceneViewer().selectGeometry(use_existing_selection=False, 
                                       geometry_types=[hou.geometryType.Points], 
                                       allow_obj_sel=False,
                                       initial_selection="1 2 3", 
                                       initial_selection_type=hou.geometryType.Points
                                       )
Edited by tamte - March 20, 2018 12:44:23
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
42 posts
Joined: Aug. 2016
Offline
yes. it works. great. Thanks
  • Quick Links