I’ve run into a curious thing - I think converting metaballs to mesh is broken, but only when running it from background mode (change the save location to whatever you want first):
Its close to impossible to get some of blenders functions working iun BG mode. in general Id avoid BG mode for complex data manipulation and only use it for batch rendering.
Iv tried to get Object.join for eg working in background mode but its quite tricky and blender relies on having a screen, layers, etc to do some of these operations.
rocketship, the problem is that some datablocks are not initialized when running in BG mode. the ‘screen’ is not, therefor theres no active layers, therefor theres no user context - GetSelected fails.
instead of messing about with different workarounds perhaps its better just to initialize all that data and that should allow user context to exist even when running GUI’less
Its becoming clearer - I’m guessing the mesh conversion function for metaballs is getting the mesh as a byproduct of the screen renderer? I even looked into somehow redirecting X/OpenGL output to /dev/null (not running in backround mode), but that’s beyond my abilities…
The datastructures for ‘screen’ are not initialized when in background mode.
I think they possibly could be and that might solve the problem.
Worth posting on bfcommiters about this
if you povide a script and/or blend that creahes blender, Ill see if I can make blender initialize the data in a way that makes it work.