Sorry Justin, that I am not phrasing myself correctly.
By 'real-time', I mean to say, the colors will be applied with immediate
effect as soon the options in the combobox is changed.
For example, if I select 'red' in the combobox for pCube1, the pCube1 in
scene will be colored red.
And The thing about clicking with button - I mean to say that I am able to
do that but it is not something that I wanted. I apologize if this has
caused confusion...
By the way, I did tried replacing all the combobox to self.combobox and
creating a new function as follows:
def __init__(self, parent=None):
...
self.init_ui()
self.populate_data()
self.connect_signals()
def connect_signals(self):
self.combobox.currentIndexChanged.connect(self.append_color)
def append_color(self):
for row in xrange(self.mesh_table.rowCount()):
color_sel = self.mesh_table.cellWidget(row, 1).currentText()
print color_sel
However it does not seems to be working..
Side-tracking a bit though, if I am to convert the current code I have done
into this 'mode/view/controller' I have done, will it be difficult to do so?
I asked this because when I tried doing the following:
from PyQt4 import QtGui, QtCore
import sys
def get_geos():
all_mesh = cmds.listRelatives(cmds.ls(type = 'mesh'), parent=True)
return all_mesh
class test(QtGui.QWidget):
# Our main window will be a QListView
list = QtGui.QTableView()
list.setWindowTitle('Example List')
list.setMinimumSize(600, 400)
# Create an empty model for the list's data
model = QtGui.QStandardItemModel(list)
all_geos = get_geos()
for geo in all_geos:
# create an item with a caption
item = QtGui.QStandardItem(geo)
# Add the item to the model
model.appendRow(item)
# Apply the model to the list view
list.setModel(model)
# Show the window and run the app
list.show()
As I try editing the name of the nodes that I set in the QTableView, the
changes are not being reflected and I did quite some trial and errors
before I came upon 'QStandardItem' so that the nodes' name will be
inputted, as there aren't many tutorials online for me to reference.
--
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/e97d5f6e-88d6-4c70-bef5-94daba418216%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.