0

I am trying to put class in function in order to select severals objests each with its own box for re select again

        import maya.cmds as cm


        obj = selection = cm.ls(selection=True)
        print(obj)
        cmds.select(obj)


        class Person:
          def __init__(self, name,  obj):
            self.name = name
            self.obj = obj

          def sel_obj(self):
            cmds.select(self.obj)

        p1 = Person("John", obj)


        p1.sel_obj()

        p1.obj = obj


        from maya import cmds as cm
        newWindow = cm.window(title="Move Object", bgc=(121,136,117))
        cm.columnLayout(cw=100, cat=('both', 10))
        cm.separator(height=15, style='none')
        cm.text(obj, fn='boldLabelFont')
        cm.separator(height=10, style='none')
        cm.button(label='Select_Control', command=('sel_obj()'))
        cm.separator(height=10, style='none' )
        cm.showWindow()
Matthew Wilcoxson
  • 3,432
  • 1
  • 43
  • 48
  • 1
    i don't really understand your question, you seem to try something really complex for nothing. Why not appending your selections into a list ? – DrWeeny Nov 19 '19 at 19:01
  • Wait.. It's going to create a NEW window every time a new selection occurs? If I select 100 objects, should 100 windows appear? You might be better off using something like a listview instead so you can see the history of objects selected. – Green Cell Nov 20 '19 at 02:12
  • Yes because I thing when you are working is faster to select with one clip in each window. – arkalex Dec 20 '19 at 21:01
  • actually I only select three objects at most. Thank you – arkalex Dec 20 '19 at 21:07

0 Answers0