On Friday, 21 December 2018 12:15:33 UTC-8, Justin Israel  wrote:
> On Sat, Dec 22, 2018, 7:33 AM  <[email protected]> wrote:
> I have an animation that’s being generated in Maya. This animation cause 
> attributes under a node to change over time. I want to access the attributes 
> (about 200 of them) for each frame and write that into a file. I’m currently 
> using the OpenMaya MFnDependencyNode to find the required node and then using 
> dependencyNode.findPlug on each frame to access the values.
> 
> 
> 
> This works but its very slow and I was wondering if there’s a better way to 
> go through the timeline and fetch attributes. Currently, for a 10 second 
> animation (60 fps), it takes about 18 seconds to access this data. Is there a 
> faster way to do this? Thanks.
> 
> 
> 
> Are you advancing the timeline frame by frame and getting a new plug each 
> time? Have you tried just getting the plug once and then passing an 
> MDGContext(MTime(...)) with the next frame as MTime to get all the values 
> across time? That should be what getattr(time=...) does under the hood. 
> Should be way cheaper than advancing the scene and getting a new plug each 
> time. 
> 
> 
> 
> 
> 
> -- 
> 
> 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/18ff8520-27a1-47a8-9b5f-3d2bf2d04744%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

I' not aware of MDGContext(). Let me take a look at what the api looks like. Do 
you mean something along these lines:

MTime t( 10. );
MDGContext ctx( t );
plug.getValue( oInput, ctx );

-- 
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/0bd5ad76-5d23-4ec5-9ff9-2026efd54444%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to