On Thu, Aug 9, 2018 at 10:55 AM likage <[email protected]> wrote:
> Hi Justin, > > It does not seems to work. The value returned is the number of attributes > that are keyed. > > sel = cmds.ls(sl=True)[0] > kf = cmds.keyframe(sel, query=True, keyframeCount=True) > print kf > > > Eg. > 1. Create a sphere (no animation keyframe) > run the above code > returns > '0' as the result > 2. Create a sphere (do a single keyframe, or hit 'S' key) > run the above > code > returns '10' as the result > I am not seeing this behaviour that you are reporting. What I am seeing is that the returned value is the total number of keyframes for the objects you pass in as arguments. If you are passing multiple objects, then it is the total for all of them, so you will want to run that for each object individually. When I create a new object, it is zero. When I create a key on tx, it is one. If I created another key on tx at a different time it returns 2. If I hit 's' like you suggested then I am creating keys on all the transform channels which means the first one will be 10. So it is not an attribute count. I assumed since your stated goal is to check if an object has more than 1 red tick mark. And so checking each object individually, the way I had provided, seems like it does what you want? Technically you could have 100 red tick marks but no value change between them, which means the object is static even though it has keyframes. > > -- > 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/65a4c866-3bb5-4e02-9bce-1bee55bef381%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/65a4c866-3bb5-4e02-9bce-1bee55bef381%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA16ekOsZjEhz2%3D2yqgLjZrH6HYdo%3D92UZ2HZ-Ga6iEsuQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
