I have no experience creating new node types, but I would suspect you could
achieve what you want via a callback connected to a script making the
connections as per my last reply, or however you were doing it previously
via your ui.

http://download.autodesk.com/global/docs/maya2013/en_us/CommandsPython/scriptJob.html

You can use a scriptJob with attributeChange set to monitor any attribute
of a node.


On 10 January 2014 09:35, Dilen Shah <[email protected]> wrote:

> Hey Marcus,
>
> Thanks for the reply, the thing is my script already works using UI but I
> wanted to do something without it just creating a node and storing the
> parents in them as MFnEnumAttributes and then when attribute is changed the
> matrix info is tapped into the locator. The problem is I dont know where to
> start.
>
> D.
>
>
> On Friday, January 10, 2014 7:28:57 AM UTC+1, Marcus Ottosson wrote:
>>
>> Not in front of Maya at the moment, but if you're having trouble doing
>> this via maya.cmds or OpenMaya you could instead use an intermediate node
>> to store your matrix. Any node with a matrix attribute would do, such as
>> addMatrix or decomposeMatrix.
>>
>> To store it, simply connect it to the intermediate node and read its
>> value (this is important, otherwise Maya may not take the time to actually
>> write any values). Then you can disconnect.
>>
>> To read it back, simply connect your intermediate node to the target (and
>> make sure it reads. either by being visible in the viewport, or via the
>> cmds.getAttr() command), then you can disconnect and remove the old node.
>>
>> That way, you could potentially store your history of transfers with the
>> scene itself, without any extra hassle.
>>
>>
>> On Wednesday, 8 January 2014 14:31:46 UTC, Dilen Shah wrote:
>>>
>>> Hey guys,
>>>
>>> Need some help with something, I have written a script with UI for
>>> parent switching, but I wanted to know if its possible to create a node
>>> that takes in values and stores the matrix values of the child and once the
>>> parent attribute is changed, its applies the matrix values to the child.
>>>
>>> D.
>>>
>>  --
> 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/f8068b4d-fab8-4cd3-8c04-67be6d9e1ad1%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
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/CAFRtmOCtN3Cq6%3DF79vC8BPREhBP0YqRiKJ-W1%3DTZ74tSAW0MbA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to