How could I get items in Operator List, using Python ...?
2985
3
0
Masoud
Member
414 posts
Joined: 8月 2015
Offline
2018年5月1日 1:44
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 - 2018年5月1日 02:03:19
Attachments:
1.JPG (465.2 KB)
Masoud Saadatmand (MSDVFX)
Masoud
Member
414 posts
Joined: 8月 2015
Offline
2018年5月1日 2:06
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 - 2018年5月1日 02:07:19
Masoud Saadatmand (MSDVFX)
huey_yeng
Member
69 posts
Joined: 11月 2016
Offline
2018年5月1日 2:55
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)
Masoud
Member
414 posts
Joined: 8月 2015
Offline
2018年5月1日 3:20
Hi “huey-yeng”
I found these codes to solve the problem :
print hou . evalParm ( "refObjSelection" ) . split ()[ 0 ]
Edited by Masoud - 2018年5月1日 03:21:30
Masoud Saadatmand (MSDVFX)