On Sat, Dec 22, 2018 at 11:15 AM <unnikrishnan.a...@gmail.com> wrote:

> On Friday, 21 December 2018 12:15:33 UTC-8, Justin Israel  wrote:
> > On Sat, Dec 22, 2018, 7:33 AM  <unnikris...@gmail.com> 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 python_inside_maya+unsubscr...@googlegroups.com.
> >
> > 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 );
>

Yes


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

Reply via email to