Maya attribute Template and 32k limit

Maya string attribute limit!

Well I seem to have found the limit to Maya’s string attribute handling, it’s clamped by the attribute template at 32k. I’m trying to store some internal data onto our new rig setup, basically taking a big ass dict and serializing it via json to a string attr. Been doing this for years at Eurocom but I’ve only just hit this issue.

So, you store this big ass json encoded string, which in this case was 35000 long, Maya handles it and stores it. All is good and the data comes back correct via the json decoder. BUT should you happen to select the string in the attribute editor itself, then Maya runs something in the background and re-evalutes that string, clamping it to 32k, now json barfs as the data being decoded is invalid!

Anybody had similar problems? I know if I just lock the attr after it’s been made then the data is preserved correctly.

Doesn’t it treat the .notes attribute differently? I could be mistaken, but you might want to try…

Nope, just tried it and it does exactly the same thing, truncates the data to 32767 characters. Locking the attr when first setting the data seems to maintain it, but it’s kind of worrying what else that hard limit is doing under the hood. Shit