Ah thanks, that's good to know. I was misinterpreting dag. I put it there
because the node I was struggling with had no cycles of its own, but its
ancestors had some (dozens, if you believe cycleCheck). Without dag=True, I
got nothing, and with it, I got a page of text. Still, if this node doesn't
have any problems with cycles then I've found a significant bug and I'm not
willing to jump to that conclusion yet.

I need to come up with an example that's not as complex as the rig I'm
looking at (thousands of nodes, completely unmanageable output) but complex
enough to be meaningful. I'll keep trying...


On 5 April 2018 at 16:06, Marcus Ottosson <konstrukt...@gmail.com> wrote:

> That dag argument looks suspicious, how come you include it?
>
> dag (dag) | Also look for cycles due to relationships in the DAG. For each
> DAG node, the parenting connection on its children is also considered when
> searching for cycles. - Reference
> <http://help.autodesk.com/cloudhelp/2018/ENU/Maya-Tech-Docs/CommandsPython/cycleCheck.html>
>
> It sounds like it’s being a little more loose on what is considered
> cycles, especially since the parentConstraint is part of the dag and even
> parented to the driven object per default.
>
> I found two cases whereby it didn’t output any cycles, but it’s hard to
> say whether it’s conclusive without an example with an actual cycle warning
> too. Would it be possible to share one?
>
> from maya import cmds
>
> cmds.file(new=True, force=True)
> cube, _ = cmds.polyCube()
> cone, _ = cmds.polyCone()
>
> constraint = cmds.parentConstraint(cone, cube)
> assert cmds.cycleCheck(cube + ".r", dag=True, list=True)assert not 
> cmds.cycleCheck(cube + ".r", dag=False, list=True)
>
> cmds.parent(constraint, world=True)
> assert not cmds.cycleCheck(cube + ".r", dag=True, list=True)
>
> ​
>
> On 4 April 2018 at 23:13, Michael Boon <boons...@gmail.com> wrote:
>
>> If I create a cube and a cone, and parent constrain the cube to the cone,
>> then do
>> cmds.cycleCheck('pCube1.r', dag=True, list=True)
>> I get
>> # Result: [u'pCube1.rotateY',
>>  u'pCube1_parentConstraint1.constraintRotateY',
>>  u'pCube1.rotateX',
>>  u'pCube1_parentConstraint1.constraintRotateX',
>>  u'pCube1.translateZ',
>>  u'pCube1_parentConstraint1.constraintTranslateZ',
>>  u'pCube1_parentConstraint1.constraintRotatePivot',
>>  u'pCube1_parentConstraint1.constraintRotateTranslate',
>>  u'pCube1_parentConstraint1.target[0].targetWeight',
>>  u'pCube1.rotateZ',
>>  u'pCube1_parentConstraint1.constraintRotateZ',
>>  u'pCube1_parentConstraint1.constraintRotateOrder',
>>  u'pCube1_parentConstraint1.pCone1W0',
>>  u'pCube1.translateY',
>>  u'pCube1_parentConstraint1.constraintTranslateY',
>>  u'pCube1_parentConstraint1.constraintParentInverseMatrix',
>>  u'pCube1_parentConstraint1.constraintTranslateX',
>>  u'pCube1.translateX'] #
>> This is (I assume) a red herring. The parent constraint is working as
>> intended, and I'd like a script that will ignore it.
>>
>>
>> On Wednesday, 4 April 2018 16:39:51 UTC+10, Marcus Ottosson wrote:
>>>
>>> Are you able to post an example or reproducible of one of the cycle
>>> check problems you are seeing?
>>>
>>> Looking through the results, the first one is a parent constraint on a
>>> joint. This is just how parent constraints work - the constraint outputs
>>> the rotation and translation to the joint, while the joint outputs its
>>> rotation order, joint orient, and parent inverse transform to the
>>> constraint. This cycle is necessary and does not cause problems.
>>>
>>> I don’t think this is a cycle. Cycles happen per attribute, not per
>>> node, so the parentConstraint itself isn’t to blame. In that case, one node
>>> (the joint) has incoming connections (rotation and translation) which
>>> doesn’t affect the outgoing connections (the rotation order, joint orient
>>> and parent inverse transform). For a cycle to happen, an incoming
>>> connection must be affected by one of its outgoing connections.
>>> ​
>>>
>>> On 4 April 2018 at 01:10, Michael Boon <boon...@gmail.com> wrote:
>>>
>>>> I've just started looking into the cycleCheck, and this warning:
>>>> // Warning: Cycle on '<node name>' may not evaluate as expected. (Use
>>>> 'cycleCheck -e off' to disable this warning.)
>>>>
>>>> This has become more important in Maya 2018 because getting transforms
>>>> using MDGContext can now give different results than the viewport in cases
>>>> that used to work.
>>>>
>>>> If I look at a node that I know has problems, a simple
>>>> cmds.cycleCheck(nodeName)
>>>> returns False, because I guess the cycle is somewhere in its history.
>>>> cmds.cycleCheck(nodeName, dag=True, list=True)
>>>> takes several seconds and returns an enormous number of results.
>>>>
>>>> Looking through the results, the first one is a parent constraint on a
>>>> joint. This is just how parent constraints work - the constraint outputs
>>>> the rotation and translation to the joint, while the joint outputs its
>>>> rotation order, joint orient, and parent inverse transform to the
>>>> constraint. This cycle is necessary and does not cause problems.
>>>>
>>>> I'm not keen to go through hundreds of fake cycles to find the real
>>>> ones that are causing problems. In addition, I doubt the problem cycle is
>>>> even in the list, since most joints in our rig get their transform from
>>>> nodes in a different hierarchy via constraints (ie via DG connections, not
>>>> DAG connections).
>>>>
>>>> So my question is, is anyone aware of a script that does a better job
>>>> of this? Something that can follow history, and ignore the places that
>>>> cycles are expected, and only return the interesting ones? Or does anyone
>>>> have a different approach?
>>>>
>>>> --
>>>> 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/ms
>>>> gid/python_inside_maya/3526bc39-5f56-4e73-a64e-182396c8a12f%
>>>> 40googlegroups.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/3526bc39-5f56-4e73-a64e-182396c8a12f%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 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/ms
>> gid/python_inside_maya/3dc98ae1-8a87-4226-95e6-815866b9e1f4%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/3dc98ae1-8a87-4226-95e6-815866b9e1f4%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/FCBpdbA8I9Q/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAFRtmOADhP3VkSQz8Mo5CdRH1G2vn
> w2DxaxvwHHx6WOOEV3XEw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOADhP3VkSQz8Mo5CdRH1G2vnw2DxaxvwHHx6WOOEV3XEw%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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAA27_yJ_kG5fq6HtmWnXybTUnTTw8ze_-gZRpsApaWi6cWLEYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to