This looks mighty suspicious.
previous_rotation_values = itertools.izip(*channel_values1)
try:
previous_rotations = previous_rotation_values.next()
except StopIteration:
return False
I suspect this is creating a new iterator per iteration, returning the first value each time.
The prior calls are also suspicious.
control_iterator = NodesAnimationIterator([node_name])
channels1 = control_iterator.iterate_animated_channels('rotate')
channel_values1 = list(
channel.iter_values(frame_range) for channel in channels1
)
As a reader, I would have expected control_iterator to be an iterator, such that I could say:
for control in control_iterator:
# Do something with `control`
But instead, it is..
channels1channel_values1previous_rotation_valuesNot to mention this then happens again, over and over in a loop, shortly afterwards. If I was you, I would take a step back, rethink my strategy. :) Also, figure out which line is taking the longest; I suspect those unrolling of iterators.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1814c58b-5136-4b20-bcbc-e15b3ca4a412%40googlegroups.com.