0

Recently I am working on some projects that I want to control blender modeling outside blender. Currently, I am able to do this with the UI version, and running on a computer with X-window, so the UI is totally fine. Here is a simple description of what I am doing right now: say I have a python process, randomly decide what action to take, e.g., move a vertex, do the subdivision, and so on, on an existing mesh.

The question is, I now have access to a server that does not have X-window, I am wondering how I can do the thing in background mode. Since until so far, I am aware most of the headless mode is for rendering. If I did not ask blender to render something, it just quit right after. Following is the screenshot: enter image description here

Is there any good approach that I can load the blend file, and then keep the blender up (not quit immediately), so that my script can send the follow up action to it?

thx a lot

ics
  • 1
  • Probably use Blender as Python module: https://blender.stackexchange.com/a/117213/19156 and https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule – lemon Mar 21 '20 at 07:47
  • thx for the quick response, I think blender as a python module is definitely one of the possible solution. But the worrying thing is that based my understanding, there will be no area, context and so on right? – ics Mar 21 '20 at 07:52
  • 1
    as is also the case when running in bg mode. ie no UI elements eg area, region, does have context. – batFINGER Mar 21 '20 at 07:54
  • thx for the reply, do you guys know if Blender as Python module allow me access the context? E.g., do something like select_box in Blender 2.8? something like https://docs.blender.org/api/current/bpy.ops.view3d.html#bpy.ops.view3d.select_box – ics Mar 21 '20 at 08:22

0 Answers0