Message 1 of 4
String attribute size limit when saving to maya ascii file?

Not applicable
08-20-2018
10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm saving data from a maya session as a json string, in a node attribute. It's a large-ish string (generally a few MB). Setting and retrieving the value in a string attribute with the value is no problem. But when I save the file in maya ascii format (which we want for production), maya crashes if the string is larger than about 2,750,000 bytes. If I run this code and then try to save an ascii file, it reproduces the crash:
import maya.cmds as cmds cmds.file(f=True, new=True) node = cmds.createNode("transform") cmds.addAttr(node, ln="strang", dt="string") bigString = "$" * 3000000 cmds.setAttr(node+".strang", bigString, type="string")
Saving as maya binary works fine, as does splitting the string over multiple attributes.
Is this a known limitation? Is there a better way to save a large python dictionary in a maya ascii file?