In short, query the inMesh attribute of the referenced mesh. Here’s some theory behind that.
________________ ______________ _____________ | | | | | | | ReferencedMesh |----| SomeDeformer |----| VisibleMesh | |________________| |______________| |_____________| The referenced mesh will always be in your scene and will always be untouched, with one exception. The manual “edits” you make when pulling vertices by hand or script. The mesh will have an inMesh and outMesh attribute, the inMesh representing it’s original state and outMesh the point at which those edits have been applied. Thus, if you query the inMesh of the referenced mesh, you should be getting the mesh exactly as it was at the time of being referenced. Unless! Unless the mesh already had edits in it’s original scene, in which case those would become lost. In that case, and alternative to the above, I’d create a new reference temporarily, query that, and later discard it. On 18 November 2015 at 12:01, Enrico Losavio <[email protected]> wrote: > Hi Everyone, > > I have a mesh referenced in my Maya file, and I need to get the difference > (vertex position, or deltas) between the actual mesh and the original mesh. > I managed to get a list of the edits via the cmds.referenceQuery() > command, but that returns only a list of MEL commands, and I can't do much > with that data. > What I would like to do is to run a MFnMesh.getPoints() both on the mesh I > have now and also on the mesh as it was before the edits. > One solution would be to read the mesh data, unload the reference, clear > the edits, reload the reference and then read the mesh data again, but I > predict problems. > The reference edits system in Maya is very powerful but also very weak and > unstable, and I don't trust in loading and unloading edits without > something breaking (un)expectedly. > I believe that this information must be saved somewhere in Maya's memory, > but I really can't find a way to access it. > I looked into the the MFileIO class, but I couldn't find any function that > matches my needs. > Obviously I googled it, but it's not something easy to research on the > internet, so... > > ...does anyone have any idea how to do this? > > Any advice is more than welcome. > > # Enrico > > -- > 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/811b9658-2558-40d2-9981-fe668bca5811%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/811b9658-2558-40d2-9981-fe668bca5811%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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/CAFRtmOAU-q6Cfb-9p%2BbnhUVJrU%3DsfEsz5eOKY4Y51Hd_ie-PSw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
