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
On Dec 17, 2015 2:56 PM, "Justin Israel" <[email protected]> wrote:

> I would think an approach would be to add a MNodeMessage callback for each
> selected item you add to your model:
>
> http://docs.autodesk.com/MAYAUL/2014/ENU/Maya-API-Documentation/index.html?url=cpp_ref/class_m_node_message.html,topicNumber=cpp_ref_class_m_node_message_htmld79bc770-85cb-405f-9baf-7aea7840c985
>
> If the node gets renamed in Maya, you will get a callback and can update
> your own model item. This means that you can simply rename a node in your
> UI code, and the callback from Maya will keep your model in sync.
>
> On Fri, Dec 18, 2015 at 11:23 AM Padraig Ó Cuínn <
> [email protected]> wrote:
>
>> 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
>> On Dec 17, 2015 1:29 PM, "Justin Israel" <[email protected]> wrote:
>>
>>> No, you have one model. And that model is meant to track items in your
>>> Maya scene. You would just need to watch for changes in your Maya scene and
>>> update your model accordingly.
>>>
>>> On Fri, Dec 18, 2015 at 10:17 AM Padraig Ó Cuínn <
>>> [email protected]> wrote:
>>>
>>>> How would I go about that. I wouldn't have to create a new model for
>>>> the changes in the renaming would I?
>>>>
>>>> Padraig
>>>> On Dec 17, 2015 1:10 PM, "Justin Israel" <[email protected]>
>>>> wrote:
>>>>
>>>>> You can either take the approach of calling into Maya directly, and
>>>>> letting your model respond to callbacks from Maya when things change, in
>>>>> order to update, which then triggers updates in your views. Or you can 
>>>>> take
>>>>> the approach of only interacting with your model, which will then make
>>>>> change in Maya after updating its own items.
>>>>>
>>>>> Your view can watch for selection changes, of your view items, and
>>>>> provide different visible buttons, or different enabled actions in a
>>>>> context menu. One action could be a rename operation. Another could be a
>>>>> delete operation.
>>>>>
>>>>> On Fri, Dec 18, 2015 at 9:58 AM Padraig Ó Cuínn <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Justin,
>>>>>>
>>>>>> I haven't added any renaming code yet to the script because I am not
>>>>>> sure where to begin with it. My original thought was that I could use the
>>>>>> selection as a base and use that though out the main code for everything
>>>>>> but its proven hard to even find the right start to that end. What I 
>>>>>> wanted
>>>>>> was to be able to grab the listItem and rename it in the model and then 
>>>>>> the
>>>>>> changes update in mayas selected object.
>>>>>>
>>>>>> To Question 1 : Yes just as ive done with the selection change with
>>>>>> the status bar i thought it would be nice to get a feedback message 
>>>>>> saying,
>>>>>> I renames this to this.
>>>>>>
>>>>>> to Question 2:  If i make a selection of the objects (instead of
>>>>>> renaming inside the model) would it be possible to have the button change
>>>>>> state and rename the objects instead of refreshing (once the objects in 
>>>>>> the
>>>>>> model are selected). having just said that i realise that the lineEdit
>>>>>> would have to be used to setText
>>>>>>
>>>>>> --
>>>>>> 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/b4ef798e-2b62-4b87-bbd4-81e0611a8ea2%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/b4ef798e-2b62-4b87-bbd4-81e0611a8ea2%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>>>
>>>> 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
>>>>> [email protected].
>>>>> 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
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA01Mm1X%2B5hpYGC1iVmJFk%3D7%2B%2BFM%2B2AOJXa5MzzqndLFbw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>
>>>>
>>>>> 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 [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCyiBREDROsKL0CDiBwYUH-Ej9qKLG6zo-bFjtannRwUFA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCyiBREDROsKL0CDiBwYUH-Ej9qKLG6zo-bFjtannRwUFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> 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
>>> [email protected].
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2M2dZN%2BgpXy1DygyEt2O0xXYj863vutBcbb0PVf82LVw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2M2dZN%2BgpXy1DygyEt2O0xXYj863vutBcbb0PVf82LVw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>
>>
>>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCzu9Ym-DOj9o5FjZqtWVRuT%3DngqqjSfe8DxVGszttGRuQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCzu9Ym-DOj9o5FjZqtWVRuT%3DngqqjSfe8DxVGszttGRuQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1x2dGWG0Fx8r%2BF0iZLKUzO7FoYWUS6%2BxV1zxE5FqpBLQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1x2dGWG0Fx8r%2BF0iZLKUzO7FoYWUS6%2BxV1zxE5FqpBLQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CALB%2BjCx-RnPLnFZCZyTxzLDTgGVHhORW7aPt45aBGt%2Bi0XWb6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to