How to get from Maya event of a change highlight objects in the scene?

后端 未结 3 1469
北荒
北荒 2021-01-17 02:39

I\'m using: Maya2014 + pyqt4.8 + python2.7

I\'m doing an application which allows you to speed up and simplify the selection of items in Maya. Is a selector which th

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 02:54

    You can use scriptJob command for this.

    scriptJob let's you specify code or perform some action(s) when specified condition is met or a specified event is triggered.

    For selection change, you'd use the event flag with "SelectionChanged" as parameter:

    myScriptJobID = scriptJob(event=["SelectionChanged", your_function])
    
    # You can later use this scriptJob's id to modify or delete it like so:
    
    scriptJob(kill=myScriptJobID)
    

    Check out the docs for more options.

提交回复
热议问题