Generally, it's better to create your own setup than trying to modify
Maya's setup. If you look at Justin's cmivfx videos on PyQt, he
actually creates a replacement for the channel box as part of it, you
could probably use that as a starting point.
On 3/13/2015 10:09 AM, Rémi Deletrain wrote:
Hello everyone,
I am trying to change the maya channelBox.
Until now addin PySide window easily.
that is my code:
____________________________________________________________________________________________________________________________________
#===========================================================================
# Import Modules
#===========================================================================
import pymel.core as pmc
from PySide import QtGui, QtCore
from shiboken import wrapInstance
from maya.OpenMayaUI import MQtUtil
#===========================================================================
# My Channel Box
#===========================================================================
class MyChannelBox(QtGui.QMainWindow):
#=======================================================================
# Init and ui
#=======================================================================
def __init__(self, parent_name=None):
parent_name = wrapInstance(long(MQtUtil.mainWindow()),
QtGui.QWidget)
super(MyChannelBox, self).__init__(parent_name)
self.setFixedSize(300, 500)
# Add Widget
self.__masterWidget = QtGui.QWidget()
self.setCentralWidget(self.__masterWidget)
# Add a layout
self.__masterLayout = QtGui.QVBoxLayout(self)
self.__masterLayout.setContentsMargins(0, 0, 0, 0)
self.__masterLayout.setSpacing(0)
self.__masterWidget.setLayout(self.__masterLayout)
# Add ChannelBox
if not pmc.channelBox('myChanelBox', exists=True):
pmc.channelBox(
'myChanelBox',
width=300,
height=500,
attrColor=(1.0, 0.0, 0.0),
attrBgColor=(1.0, 0.0, 0.0),
)
self.__popup = pmc.popupMenu()
pmc.popupMenu(
self.__popup,
edit=True,
postMenuCommand=lambda *x:
pmc.mel.generateChannelMenu(self.__popup, True)
)
channelBox_widget =
wrapInstance(long(MQtUtil.findControl('myChanelBox')), QtGui.QWidget)
self.__masterLayout.addWidget(channelBox_widget)
def main():
windowIS = MyChannelBox()
channelBox_widget =
wrapInstance(long(MQtUtil.findControl('myChanelBox')), QtGui.QWidget)
windowIS.show()
channelBox_widget.show()
____________________________________________________________________________________________________________________________________
I try to do it in pyside with shiboken wrapInstance and
maya.OpenMayaUI. I can trace the differente widget but not change the
items. I wish I could add icons or change the background color.
Has someone already done this exercise with PySide or other?
The objectif is not to transform the functionalities of the channel
box but just to change a little bit the display for my animator
--
You received this message because you are subscribed to the Google
Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/0b39a7de-136a-4328-9de8-b1353bc9cb41%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/0b39a7de-136a-4328-9de8-b1353bc9cb41%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com
--
You received this message because you are subscribed to the Google Groups "Python
Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/55031FB5.1000103%40gmail.com.
For more options, visit https://groups.google.com/d/optout.