in Jupyter notebook i have loaded bpy module :

import bpy

with no problem. But if i load the 3D view :

bpy.context.area.ui_type = 'VIEW_3D'

give me this error :

AttributeError: 'NoneType' object has no attribute 'ui_type'

How to solve this?


bpy as a python module is headless

There is no ui associated with bpy that is compiled as a python module. Objects like screen area and region are part of the UI which being non existent, are given the value None.

| improve this answer | |
  • $\begingroup$ if i need to visualize my model that i create with script into jupyter, how do this? what command i need to use? $\endgroup$ – user77647 Aug 3 '19 at 9:32
  • $\begingroup$ Display how? As a render, in blender, or otherwise? $\endgroup$ – batFINGER Aug 3 '19 at 9:39
  • $\begingroup$ its the same. Visualize like in 3d view in objects or in render mode. For see change of items that i create with script. For see change in real time. $\endgroup$ – user77647 Aug 3 '19 at 9:54
  • $\begingroup$ IMO Not the same, a render is an image, using the 3d viewport involves opening blender, exporting to some other format that has a viewer app is another option. For using blender, perhaps the suggestion by @rob in your similar question re setting up a client server and feeding the opened blender your scripts (especially if you want to manipulate the UI) rather than using the bpy module. $\endgroup$ – batFINGER Aug 3 '19 at 10:00
  • $\begingroup$ I thinking about a trigger that check, inside blender script , a change from jupyter script. I can i do this? I open a new Ask for this? $\endgroup$ – user77647 Aug 3 '19 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy