Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on scene cleanup due to Python 2 remnant #1054

Closed
stiansel opened this issue Jan 29, 2024 · 1 comment · Fixed by #1055
Closed

Crash on scene cleanup due to Python 2 remnant #1054

stiansel opened this issue Jan 29, 2024 · 1 comment · Fixed by #1055
Labels
bug Something isn't working

Comments

@stiansel
Copy link

Describe the issue

The remove_custom_properties function in the _Initializer (link) causes a crash if any scene keys exist when cleanup is called. The error is "RuntimeError: IDPropertyGroup changed size during iteration". This happens in Python 3, as unlike Python 2, the keys-call no longer creates a copy of the keys.

Simple fix: Change for key in bpy.context.scene.keys() to for key in list(bpy.context.scene.keys()).

Minimal code example

import blenderproc as bproc
# Then import a Blender addon which adds any scene keys on import, like HumGen3D:
from HumGen3D import BatchHumanGenerator, human

def _main():
    bproc.init(clean_up_scene=True)  # crash with the above RuntimeError

if __name__ == '__main__':
    _main()

Files required to run the code

No response

Expected behavior

For the init to not throw an error.

BlenderProc version

Github main 2dc7d68

@stiansel stiansel added the question Question, not yet a bug ;) label Jan 29, 2024
@cornerfarmer cornerfarmer added bug Something isn't working and removed question Question, not yet a bug ;) labels Jan 29, 2024
@cornerfarmer
Copy link
Member

Thank you, should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants