How could I get items in Operator List, using Python ...?

   2780   3   0
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi;

I create a button in my digital asset that runs a function called “myBtnPressed()”. I also add a “Operator List” to select some geometries from my scene. Now I would like to retrieve items in my “Operator List”, using Python script, but I don't know what how…

Thanks for helping
Edited by Masoud - May 1, 2018 02:03:19

Attachments:
1.JPG (465.2 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
I wrote these codes :
print hou.evalParm("refObjSelection")

Now it show my selected object like this :

/obj/grid_object2 /obj/grid_object1

But I want separate each item by index, something like :
print hou.evalParm("refObjSelection")[0] 
Edited by Masoud - May 1, 2018 02:07:19
Masoud Saadatmand (MSDVFX)
User Avatar
Member
69 posts
Joined: Nov. 2016
Offline
I'm unsure if you want to further manipulate the refObjSelection list or print the list on every separate line.


Not sure if this is what you're looking for but you can get an idea from the sample above.

Attachments:
python_print.PNG (101.6 KB)

User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi “huey-yeng”
I found these codes to solve the problem :

print  hou.evalParm("refObjSelection").split()[0]
Edited by Masoud - May 1, 2018 03:21:30
Masoud Saadatmand (MSDVFX)
  • Quick Links