Jump to content

Is there a viewport selection - Python question


mrhumbility

Recommended Posts

Hey,

I am trying to do some stuff in python with viewport selections. I want to query whether or not the user has anything selected, not necessarily get what is already selected. As far as I can tell the only way to do anything with the viewport is through toolutils. If I use "toolutils.sceneViewer().selectGeometry()" and nothing is selected, it waits until the user hits enter over the viewport before continuing. Is there any way to simply return whether or not any geometry has been selected without having to wait for the user to hit enter?

import toolutils

sv = toolutils.sceneViewer()
geo = sv.selectGeometry()
if geo:
    print "There is a selection"
else:
    print "No geo selected"


Thanks!

James C

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...