Bonsai - Error when activating drawing view

Hi all,
I have been playing around with Bonsai and was having some success - I was following IFC Architect's floor plan tutorial and was able to create a plan view. But at some point it just stopped working and I get an error every time I try to activate a drawing view. I tried a bunch of stuff and I think it is being caused by having the Blender properties panel in a separate window on another monitor. If I add a properties panel on my main monitor with the 3d viewport it seems to work fine. I also just tried adding a 3d viewport on the second monitor and that caused blender to crash and close immediately.

I have gotten used to using Blender this way with 2 monitors, so hopefully this is something that Bonsai can support in a future release.

Traceback (most recent call last):
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 1791, in invoke
return self.execute(context)
^^^^^^^^^^^^^^^^^^^^^
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 1806, in execute
core.activate_drawing_view(tool.Ifc, tool.Blender, tool.Drawing, drawing=drawing)
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\core\drawing.py", line 492, in activate_drawing_view
drawing_tool.activate_drawing(camera)
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\tool\drawing.py", line 1824, in activate_drawing
with bpy.context.temp_override(area=next(a for a in bpy.context.screen.areas if a.type == "VIEW_3D")):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
Error: Python: Traceback (most recent call last):
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 1791, in invoke
return self.execute(context)
^^^^^^^^^^^^^^^^^^^^^
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 1806, in execute
core.activate_drawing_view(tool.Ifc, tool.Blender, tool.Drawing, drawing=drawing)
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\core\drawing.py", line 492, in activate_drawing_view
drawing_tool.activate_drawing(camera)
File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\tool\drawing.py", line 1824, in activate_drawing
with bpy.context.temp_override(area=next(a for a in bpy.context.screen.areas if a.type == "VIEW_3D")):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration>

Comments

  • Can you share the .ifc here? It helps troubleshooting things.

  • Not an Ifc error. This is an assumption in the code that the properties panel is attached to a window containing a 3D View panel.When there isn't one Python tries to iterate over an empty list object and tosses the error. There's at least seven other uses of this iteration in the Bonsai code., and another six which access the bpy.context.screen.areas, but aren't specifically looking for a 3D View - those would need looking into too. Raise a bug in the issue tracker.
    In the meantime what you can do is split the window containing the properties pane, set the other half to a 3D View, then shrink it down to a tiny sliver. Activating the camera will then work. If you're running a heavy model on a weaker machine this might have some performance impact. Try it and see.

  • I posted the issue on github. I also added the following:

    When I add a 3d viewport to the second window with the properties panel, activating the camera works, but I get the following error when I try to go back to the model view by clicking the "activate model" button.

    Python: Traceback (most recent call last):
    File "D:\Documents D\BIM Projects\blender for bim\portable\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 1738, in execute
    with context.temp_override(**tool.Blender.get_viewport_context()):
    TypeError: Area not found in screen

  • Hmm. Looks like you'll have to wait until a dev can look into fixing it. Bit above my non-paid, non-existent, pay-grade.

  • Ok. Thanks for taking a look.

Sign In or Register to comment.