Skip to content

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

Description

@herve-lg

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions