DeehrBYU Posted August 3, 2010 Share Posted August 3, 2010 Hi! Been looking through docs and google for quite some time now. I am at a loss for a "current selection" function (ie in maya, "ls -sl" equivalent) I am trying to write a tool that should make guide hair manipulation easier. For my methods anyway.. Thanks! Quote Link to comment Share on other sites More sharing options...
graham Posted August 3, 2010 Share Posted August 3, 2010 From what I can gather by looking it up, hou.selectedNodes() is what you are looking for. Quote Link to comment Share on other sites More sharing options...
DeehrBYU Posted August 3, 2010 Author Share Posted August 3, 2010 From what I can gather by looking it up, hou.selectedNodes() is what you are looking for. Thanks for the reply Graham. I saw that before, but I actually need to be able to call up a point I am selecting, not an entire node. Or is there some argument I can put in selectedNodes() in order to be able to grab the point number? Quote Link to comment Share on other sites More sharing options...
graham Posted August 3, 2010 Share Posted August 3, 2010 (edited) If you are searching for geometry information you'll have to make use of a geometry selection, hou.GeometrySelection, to get that info. For example the following code prompts for a point selection (or uses an existing selection) and returns a space separated list of the points that were selected: import toolutils activepane = toolutils.activePane(kwargs) selection = activepane.selectGeometry(geometry_types=(hou.geometryType.Points,)) points = selection.mergedSelectionString() This code assumes it is called from a tool on the shelf or through the tab menu in viewer pane and the kwargs dictionary is available. If you are doing it another way you'll need to use toolutils.sceneViewer() instead of activePane(). Edited August 3, 2010 by graham Quote Link to comment Share on other sites More sharing options...
DeehrBYU Posted August 3, 2010 Author Share Posted August 3, 2010 Awesome, thank you so much. I am not familiar with most of the stuff you said about activePanel and toolUtils but I love diving in to this stuff. Thanks for the great start. Quote Link to comment Share on other sites More sharing options...
scp Posted August 10, 2010 Share Posted August 10, 2010 I've been trying something similar using the following to grab a the current point selection. activepane = toolutils.sceneViewer() selection = activepane.selectGeometry(geometry_types=(hou.geometryType.Points,)) It seems to work fine in some circumstances eg, off the shelf. But I have been trying to implement it in the Code of a python sop which is executed when a button is pressed which in turn switches a toggle. However the script just hangs and when I go to use the selection tool in the scene viewer houdini crashes with a Segmentation Fault. Any ideas? Thanks, Simon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.