Maya seems to parse info from referenced MayaAscii files into the current scene apparently randomly.

218 views
Skip to first unread message

Juan Moraga

unread,
Mar 12, 2020, 7:51:03 AM3/12/20
to Python Programming for Autodesk Maya


Hello all,

I usually try to find answers in already created posts, but this has been giving me a massive headache for a long time now and I don't know how to look for the answer, so maybe you guys can help me out or point me into the right direction.

At my animation studio we work with maya ascii files that contain other referenced maya ascii files.
So imagine this reference hieachy:

MayaAsciiSceneA.ma (20Mb)
   |
   |___MayaAsciiReferenceA.ma (500Mb)
   |
   |___MayaAsciiReferenceB.ma (250Mb)
   |
   |___MayaAsciiReferenceC.ma (250Mb)

Sometimes when we save MayaAsciiSceneA after working a little bit in it, we save the file and everything looks fine and it weights 20Mb, so no problems.
Some other times instead of doing that, Maya seems to parse the info within MayaAsciiReferenceA into MayaAsciiSceneA.ma and it ends up weighting 520Mb.

Our current work around is to remove that reference (MayaAsciiReferenceA.ma) and import it again, and it seems to work just fine.

I understand that if when working on MayaAsciiSceneA.ma, the artist does many reference edits, the file can get heavier, but there is no way they do as many reference edits as those.
We do have scripts that automatize loading and unloading references, but this has been happening only recently and I don't think our scripts trigger this, but it could be the case.

Do you have any idea about why this could be happening or how can I spot this?

Right now I have added a callback that checks weights of files before and after saving, but again, this only show that this error seems to be random.


Kind regards,

Tim Fowler

unread,
Mar 12, 2020, 11:07:25 AM3/12/20
to python_in...@googlegroups.com
.ma files are just text files that you can open with any editor. Have
you taken a look at what exactly is in there when it gets large? When
you mention reference edits it sounds like you're still guessing as to
what might be in there.
> --
> 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/164f1612-3c50-4833-b883-060819bbc185%40googlegroups.com.

Chad Fox

unread,
Mar 13, 2020, 11:23:00 AM3/13/20
to Python Programming for Autodesk Maya
Scenes with referenced geometry can increase in size if deformers are added to referenced geometry. Adding a deformer to referenced mesh creates a new local shape with the name suffix "shapeDeformed".

The actual referenced shape becomes a pre-deformed intermediate shape. Because Maya cannot rename the reference shape to what you typically might see renamed as "shapeOrig", it instead adds the shapeDeformed name to the new local deformed shape. 

Because this new shape is a duplicate of the reference, it exists in your scene now and maybe the culprit of your problem.

If this is the case there are several things to be aware of when working with shapeDeformed mesh. First, and best practice, is to avoid deforming referenced assets where possible.

Second, if you need to work with deformers on reference objects, apply all deformers before end of chain. This will instead keep the visible shape (end of chain) as the reference shape and create local intermediate shapeOrig's instead. This will still increase your file size, but it avoids several problems that can manifest from the visible shape no longer being referenced. 


It seems likely that this is the cause of your file size increasing. However, it can also depend what is in those reference files. I have seen instances where referencing files with Alembics and VDB files in them caused the creation of thousands of nodes and connections under specific conditions.


Take care,


Chad Fox


Marcus Ottosson

unread,
Mar 13, 2020, 1:13:20 PM3/13/20
to python_in...@googlegroups.com
Adding to Chad's points, some attributes when edited duplicate the data they contain from the referenced scene. When you edit topology for example, changes are typically stored in a `tweak` node, to store just the changed you've made. That's slim. But edits to e.g. skin weights won't do that. If your weights are heavy, e.g. 1,000,000 points, and an edit is made on them, then that data would get copied into the referencing scene and bloat the size. In some cases, tweak nodes aren't made, in which case the topology is duplicated as well.

Juan Moraga

unread,
Mar 16, 2020, 10:26:12 AM3/16/20
to python_in...@googlegroups.com
Hello all of you,

Thank you very much for your insightful answers.
We do have shape edits in the referencing scene, we typically use Shape Animation Tool to edit some intersections (i.e. a knee going through the trousers in a highly bent pose), but this wasn't a problem in the past, and even if it was a problem, it wasn't much of a hassle because files didn't get too big.
Almost always the referencing file gets way bigger than the addition of all the referenced files + referencing file, so it is not fully true what I said at the beginning.

What is really driving me crazy is that whatever triggers the bug it doesn't do it in a consisten fashion. Many times I replicate what I just did in the same file and the Maya file won't get really big.
We do work with Redshift Proxies and MASH instances, I don't know how much of a big problem would this be.

Anyway, I will have a look again with all your nice advices and update you if there are any news!!

Kind regards and thank you again!



--
Reply all
Reply to author
Forward
0 new messages