Hi again.so i have a little thingy i am working on ( a type of node renamer )so far I manage to get everything working. I am on a Model / View GUI compared to the old QListWidget.so my question is, is it doable to get the text of a QStandardItem in the Model pumped from a Pymel object
# a class constant
MayaObjectRole = QtCore.Qt.UserRole + 1
MayaPathRole = QtCore.Qt.UserRole + 2
...
def foo(self):
...
item = QtGui.QStandardItem()
item.setData(pyMelObject, self.MayaObjectRole)
item.setData(dagPath, self.MayaPathRole)
def bar(self, anItem):
pyMelObject = anItem.data(self.MayaObjectRole)
dagPath = anItem.data(self.MayaPathRole)
PasteBin Code:so while I was pasting my pastebin, I had another 2 questions.1. How easy would it be to implement status changes of a rename, %s _object to %s _newobject .... Would i be able to just include it in the selectionchanged status or create a new connection.
2. As far as the renaming goes, it would be nice for the ui to maintain itself on certain changes, One i had in mind was the refresh functionality is it possible to swap its function and text on selecting an item in the model and it changes to rename and uses a renaming connection.
I know they are somewhat advanced subject and may go into metadata contexts but yeah :) you guys are super smart and I am just me haha.Thank you again for your help
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d451ffe9-9f9f-4da4-bfdb-8c40e408a8d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b4ef798e-2b62-4b87-bbd4-81e0611a8ea2%40googlegroups.com.
How would I go about that. I wouldn't have to create a new model for the changes in the renaming would I?
Padraig
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/XC9rqzRjw1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA01Mm1X%2B5hpYGC1iVmJFk%3D7%2B%2BFM%2B2AOJXa5MzzqndLFbw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCyiBREDROsKL0CDiBwYUH-Ej9qKLG6zo-bFjtannRwUFA%40mail.gmail.com.
Ok I'm glad about that. So I've still no idea how to.impliment the name change haha. Sorry all this QT and model view programming
Padraig
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2M2dZN%2BgpXy1DygyEt2O0xXYj863vutBcbb0PVf82LVw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCzu9Ym-DOj9o5FjZqtWVRuT%3DngqqjSfe8DxVGszttGRuQ%40mail.gmail.com.
I tried that one but I keep getting kfailure or other killer errors. From a what I've read about kfailure it says it's due to having a second callback connected up to the one signal. But I've created sperate signals.
I also tried using addattributechanged and addtributeremovedoradded and got the same.
Is there a way I can hook this up to the statusbar successfully?
Padraig
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1x2dGWG0Fx8r%2BF0iZLKUzO7FoYWUS6%2BxV1zxE5FqpBLQ%40mail.gmail.com.
itemRemoved = Signal(list)
def update_statusbar2():
txt = '%s deleted.'
self.statusbar.showMessage(txt)
self.itemRemoved.connect(update_statusbar2)def emit_itemdeleted():
self.itemRemoved.emit( pmc.selected())
OpenMaya.MDGMessage.addNodeRemovedCallback(
Node, update_statusbar2(),emit_itemdeleted())If you don't have specific nodes that you want to monitor (meaning you want to watch any node and not just the ones in your ui) then maybe you want to look at MDagMessage or MDGMessage?
If you look at the signature of the functions, you will see that the client data parameter is NULL by default. That means you don't have to pass anything for that param. It is used to associate some kind of extra data with the callback, and that data will get transmitted later when the callback fires. But if you only want to know the name of the node that was removed, it looks like the callback that you register will receive the information (MDagPath of removed node, etc)
What you are currently doing isn't making much sense. Again you have a signal defined to emit with a list as a param. And yes you emit the signal, passing the current selection with it. But your slot never uses it. It accepts no parameters. So I don't understand the purpose of how you have configured that signal/slot.
You can mostly keep doing what you have so far, but try a different message callback type, and actually accept the callback parameters that Maya wants to pass you for that callback type, so that it can tell you what was removed and you can display it in your status bar.
Justin
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/69c2b96f-644b-4d66-9859-623bc019250f%40googlegroups.com.
If you have specific code that we can look at, we can continue to help. Just please make sure whatever you share is actual code and not a rough approximation.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/xu96ruxm04onurwsjxocnxnn.1451501159444%40email.android.com.