Exemplo n.º 1
0
 def _showUI(self):
     
     reportData=self.SceneReviewer.getReportData()  
     allowEdit=False
     sceneName=None
     date=reportData['date']
     if reportData.has_key('sceneName'):
         sceneName=reportData['sceneName']
     author=None
     
     if not reportData['author']:
         #new sceneReport
         author=getpass.getuser()
         allowEdit=True
     elif reportData['author']==getpass.getuser():
         #current author of comment == you
         author=getpass.getuser()
         allowEdit=True
         date=time.ctime()
     else:
         #current author != you
         author=reportData['author']
     if not date:
         date=time.ctime()
     if not sceneName:
         sceneName=self.getSceneName()
         
     if cmds.window(self.win, exists=True): cmds.deleteUI(self.win, window=True)
     window = cmds.window(self.win, title=self.win, s=True, widthHeight=(260,300))
     cmds.scrollLayout('reviewScrollLayout',rc=lambda *args:self.resizeTextScrollers())
     cmds.columnLayout(adjustableColumn=True,columnAttach=('both',5))
     cmds.textFieldGrp('author',label='Author', ed=False, text=author)#, tcc=partial(self.updateInternalDict))
     cmds.textFieldGrp('date', label='Date', ed=False, text=date)#, tcc=partial(self.updateInternalDict))
     cmds.textFieldGrp('sceneName', label='SceneName', ed=False, text=sceneName)
     cmds.separator(h=15,style='none')
     cmds.text(label='Comment')
     cmds.scrollField('comment', text=reportData['comment'], ed=allowEdit, h=200, wordWrap=False,
                      kpc=partial(self.updateInternalDict),
                      cc=partial(self.updateInternalDict))  
     cmds.button(label='New Comment',bgc=r9Setup.red9ButtonBGC(1),c=partial(self.addNewComment))
     cmds.separator(h=15,style='none')
     cmds.text(label='History')
     cmds.scrollField('history', editable=False, en=True, wordWrap=False, h=200,text=reportData['history'])
     cmds.separator(h=15,style='none')  
     cmds.rowColumnLayout('SceneNodeActivatorRC',numberOfColumns=2,columnWidth=[(1,200),(2,200)])
     cmds.button('setReviewActive',label='Activate Live Review',bgc=r9Setup.red9ButtonBGC(1),c=lambda x:self._setReviewStatus('active'))
     cmds.button('setReviewInActive',label='Disable Live Review',bgc=r9Setup.red9ButtonBGC(1),c=lambda x:self._setReviewStatus('inactive'))
     cmds.setParent('..')
     cmds.separator(h=15,style='none')  
     cmds.iconTextButton( style='iconOnly', bgc=(0.7,0,0),image1='Rocket9_buttonStrap2.bmp',
                              c=lambda *args:(r9Setup.red9ContactInfo()),h=22,w=200 )        
     cmds.showWindow(window)
     
     if self.SceneReviewer.exists():
         self._setReviewStatus('active')
     else:
         self._setReviewStatus('inactive')
Exemplo n.º 2
0
 def _setReviewStatus(self,status='active',*args):
     if status=='active':
         if not self.SceneReviewer.exists():
             self.SceneReviewer.addScriptNode()
         cmds.button('setReviewActive', e=True, bgc=r9Setup.red9ButtonBGC(2))
         cmds.button('setReviewInActive',e=True,bgc=r9Setup.red9ButtonBGC(1))
     else:
         if self.SceneReviewer.exists():
             self.SceneReviewer.deleteScriptNode()
         cmds.button('setReviewActive', e=True, bgc=r9Setup.red9ButtonBGC(1))
         cmds.button('setReviewInActive',e=True,bgc=r9Setup.red9ButtonBGC(2))