Up3date icon indicating copy to clipboard operation
Up3date copied to clipboard

Changes to the utils.py file to make Up3date compatible with Blender 5.1.1 and more robust

Open herve-lg opened this issue 6 months ago • 0 comments

Hello,

I just used your add-ons in Blender 5.1.1. I had to modify your "core" > "utils.py" file in two places to be able to read my CityJSON file.


1) On line 17, I had to replace

for custom_property in bpy.context.scene.world.keys():

which causes an error RuntimeError: IDPropertyGroup changed size during iteration

by

for custom_property in list(bpy.context.scene.world.keys):

Why? Blender 5.1.1 (and python) forbids from deleting certain custom properties one after another, without first creating a copy of the list. That’s what my new script does. The error then disappears.



2) On line 48, I modified :

obj[".". join(prefix + [prop])] = value

that generates an error message KeyError: 'the length of IDProperty names is limited to 63 characters'

To integrate a mechanism for truncating names that are too long, here are the 2 lines that should replace line 48 (increment on the same level) :

full_name = ".". join(prefix + [prop]) obj[full_name[:63]] = value

Indeed, The CityJSON file I use has very long property names. The length of IDProperty’s names is an internal limitation of Blender that can hardly be changed.



The two changes are intended to make the utils.py file more robust so that it can read a larger number of CityJSON file types.

In any case, well done for the job. Make sure to keep it tidy, it’s a great tool!

herve-lg avatar May 13 '26 22:05 herve-lg