Up3date icon indicating copy to clipboard operation
Up3date copied to clipboard

"Clean scene" option breaks in Blender 3.x

Open Sigmoidas opened this issue 2 years ago • 3 comments

I have Blender 3.1.2 and the "Up3date-main" add-on is not able to import CityJSON files from 3D BAG

I keep getting the following error:

Python: Traceback (most recent call last):
  File "C:\Users\HP ZBook 15 G2\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Up3date-main\__init__.py", line 72, in execute
    return parser.execute()
  File "C:\Users\HP ZBook 15 G2\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Up3date-main\core\objects.py", line 138, in execute
    remove_scene_objects()
  File "C:\Users\HP ZBook 15 G2\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\Up3date-main\core\utils.py", line 21, in remove_scene_objects
    bpy.ops.object.delete()
  File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.delete.poll() failed, context is incorrectD

location: <unknown location>:-1

Sigmoidas avatar Jul 19 '22 12:07 Sigmoidas

Hi @Sigmoidas,

I am unable to replicate the issue with the given 3D BAG tile. I use Blender 3.2.1 on Linux. I'd suggest you upgrade as well to 3.2.1, if this isn't a problem.

Oddly enough, this is also just related to trying to delete all objects from the scene. I am wondering if you have any particular objects in the scene. In any case, you can just disable the Clean scene option when selecting the file to import to avoid this error altogether. Just make sure to delete any objects you don't need in the scene before that.

liberostelios avatar Jul 19 '22 19:07 liberostelios

@liberostelios yes, leaving a new blender file scene default (not deleting any of the default objects) resolves the issue on Blender 3.1.2.

When importing 3D BAG CityJSON files I used to create a new Blender file, hit A and Delete all the contents in the scene. That used to work fine in Blender 3.0.1

As you mentioned disabling Clean scene in the import options also resolves this issue.

Sigmoidas avatar Jul 20 '22 07:07 Sigmoidas

Alright. I think I can replicate it, indeed, if I try to load a new CityJSON file without removing the previous one. Probably something is wrong in the part that clean the scene.

I'll mark this as a bug, then. Hopefully we can fix it in the future.

Thanks a lot for reporting this!

liberostelios avatar Jul 20 '22 09:07 liberostelios