You also need to set the plug or data handle clean.

matrixOutDataHandle.setClean()
or 
pDataBlock.setClean(pPlug)

On Monday, October 30, 2017 at 12:43:06 PM UTC-7, Chad Vernon wrote:
>
> Try getting rid of some of your constructors which are unnecessary:
>
> Instead of 
> matrixOutDataHandle = om.MDataHandle(pDataBlock.outputValue(
> TransformHistory.matrixOutputAttribute))
> just write
> matrixOutDataHandle = pDataBlock.outputValue(TransformHistory.
> matrixOutputAttribute)
>
> Instead of 
> inputMatrix = om.MMatrix(matrixInDataHandle.asMatrix())
> just write
> inputMatrix = matrixInDataHandle.asMatrix()
>
>
>
> On Monday, October 30, 2017 at 11:28:18 AM UTC-7, Alec Fredericks wrote:
>>
>> Hi there.
>> I wanted to finally start writing plug-ins for Maya using Python. To 
>> start, I created a template for myself that just takes a matrix as an input 
>> and outputs the same matrix -- basically, a compute devoid of any computing.
>> When I plug the matrix of one object into it and connect the output of 
>> the matrix (via a decompose matrix node for the time being -- I'll output 
>> constituent transform data later) to the translation of another object, I 
>> get the expected output. Object 2 follows object 1.
>>
>> The problem is that after wiggling object 1 around for a little bit, Maya 
>> crashes eventually, giving me an error similar to this: undo of command 
>> caused reentrant call to undo manager
>>
>> I guess it could be that I need to add some undo code in there.
>>
>> I threw my code up on pastebin if anyone has a moment to look at it to 
>> see what I did wrong. I'll keep poking at it, too, and maybe adding a 
>> debugger to the mix.
>>
>> https://pastebin.com/vMeaJME5
>>
>>
>> Thanks,
>> Alec
>>
>

-- 
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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/431dbce1-e408-4560-9397-4aa6e3d17c29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to