Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing large Usd files into maya ASCII crashes maya #86

Open
alekamca opened this issue May 15, 2018 · 4 comments
Open

Serializing large Usd files into maya ASCII crashes maya #86

alekamca opened this issue May 15, 2018 · 4 comments

Comments

@alekamca
Copy link
Contributor

We probably shouldn't be storing our data like this, so that's a workflow issue on our end, but I thought I would submit an issue here.

We're generating fairly large edit layers (~10MB of text), and we're running into issues where Maya (currently Maya 2018 Update 3) is crashing when trying to save these files (in batch mode). We've tracked down the issue being the LayerManager trying set the serialized layer into one giant MString attribute. We've run into this bug in Maya in the past, so it does seem to be at its core a Maya problem, not a USDMaya problem.

@alekamca
Copy link
Contributor Author

Python script to reproduce at least in our environment (Maya 2018 Update3):


# from within maya batch mode
from maya import cmds as mc
from pxr import Usd, Vt, Sdf

print 'creating usd stage'
# create usd stage with a large ascii representation
stage = Usd.Stage.CreateNew('tmpStage.usda')
prim = stage.DefinePrim('/prim')
attr = prim.CreateAttribute('doubleArray', Sdf.ValueTypeNames.DoubleArray)
arrayValues = Vt.DoubleArray(1000000, 1.0/3.0)
attr.Set(arrayValues)

# import stage
print 'importing stage'
mc.AL_usdmaya_ProxyShapeImport(f='tmpStage.usda')

# save file
print 'saving'
mc.file(rename='test.ma')
mc.file(save=True,force=True,type="mayaAscii") #crash occurs here
print 'done'

@dbaz
Copy link
Contributor

dbaz commented May 25, 2018

Havn't thought about it too deeply, but you could update the LayerManagerNode to have the option of saving out a sidecar usda file that contains the contents instead of having it inline. The contents could change to being the filepath to this sidecar file and the identifier kept the same.

At this stage I don't think we would use it, we have already had problems with sidecar files where artists would move around their Maya file, or just delete the sidecar files, and essentially breaking their Maya file or losing data.

@murphyeoin
Copy link
Contributor

We're going to look at this one soon - it's important to get this working

@robthebloke
Copy link
Contributor

I'm taking a look at using a custom MPxData attribute type to work around the hard limit. Ideally when in the land of *.mb files, I'd prefer to serialise out as a usdc binary blob, however there doesn't seem to be a way to do this in USD currently. Question asked here....

https://groups.google.com/forum/#!topic/usd-interest/_WVE4tHojdc

I'll give it a go with strings, and put a PR up for you to test....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants