0
$\begingroup$


I want to create a mesh outside of blender, using bmesh module, and save it into an OBJ or whatever, completely through a python script.
bmesh itself is available from outside, but since I don't open blender, there would be no saving options available. How can I do that?

$\endgroup$
9
  • $\begingroup$ bmesh module only works with blender. $\endgroup$
    – Karan
    Commented Mar 17, 2023 at 10:24
  • $\begingroup$ You can run blender in background through the command line docs.blender.org/manual/en/latest/advanced/command_line/… $\endgroup$
    – Karan
    Commented Mar 17, 2023 at 10:25
  • $\begingroup$ bmesh module is accessible without requiring blender running, look this doc link. this module is somehow separate from other blender modules. $\endgroup$ Commented Mar 17, 2023 at 12:12
  • $\begingroup$ yes in order to use it without opening the blender, you have to install it in your system as a python package/module. $\endgroup$
    – Karan
    Commented Mar 17, 2023 at 13:25
  • $\begingroup$ can you import bmesh in your python file? $\endgroup$
    – Karan
    Commented Mar 17, 2023 at 13:26

1 Answer 1

3
$\begingroup$

Late answer, but for anyone who comes across this; use BlenderProc. It allows you to use blender's python api (including bmesh) without ever opening blender. It can be installed as easily as pip install blenderproc. The only nuance is that you'll have to use blenderproc run script.py instead of python script.py, but it works exactly the same way and still runs using your regular python installation. Hope this helps

$\endgroup$
1
  • $\begingroup$ I find using "blenderproc run " very hard to debug. How can I run blenderproc scripts without this? $\endgroup$ Commented Sep 28, 2023 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .