Core: Increase MAX_ID_NAME length from 66 to 258 (Blender 5.0)

Change the maximum data-block name from 64 to 256 bytes by increasing MAX_ID_NAME value.

Also increase a few related non-ID data name max size, essentially the action slots identifiers, as these are the primary key used to match an Action's slot to an ID by name.

Other sub-data (bones, modifiers, etc.) lengths are not modified here, as these can be made actual dynamic strings in the future, while keeping (a reasonable level of) forward compatibility, during the course of Blender 5 release cycles.

Implements #137608.

Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/137196
This commit is contained in:
Michal Krupa
2025-06-19 16:39:20 +02:00
committed by Bastien Montagne
parent 09af302457
commit fdaaea6328
25 changed files with 179 additions and 70 deletions

View File

@@ -113,6 +113,13 @@ def _read_blend_rend_chunk_from_file(blendfile, filepath):
scene_name = blendfile.read(64)
sizeof_data_left -= 64
if b'\0' not in scene_name:
if sizeof_data_left >= 192:
# Assume new, up to 256 bytes name.
scene_name += blendfile.read(192)
sizeof_data_left -= 192
if b'\0' not in scene_name:
scene_name = scene_name[:-1] + b'\0'
scene_name = scene_name[:scene_name.index(b'\0')]
# It's possible old blend files are not UTF8 compliant, use `surrogateescape`.