neumicha / Blender2Helios

Blender addon to convert a blender scene to a Helios scene (LiDAR simulation, 3D point clouds)
GNU General Public License v3.0
17 stars 7 forks source link

Run as a standalone script #7

Closed awur978 closed 1 year ago

awur978 commented 2 years ago

Hi, thank you for such an amazing addon. I have a question Can blender2helios be run as a standalone python script? I.e. input will be the blender scene and the output will be the xml?

Regards

neumicha commented 2 years ago

Hi @awur978. As the addon uses Blender for reading the input file, doing translations/rotations, etc. it relies on Blender. But it is possible to run Blender (portable?) via CLI without GUI which should be more efficient. Use the -b parameter to achieve this. However, I always used the addon with GUI - so maybe the script needs some minor tweaks to run without GUI. You should first try running blender2heliosHelper.export2Helios(). See execute() function for usage example. See also: https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html https://blender.stackexchange.com/questions/1365/how-can-i-run-blender-from-command-line-or-a-python-script-without-opening-a-gui https://janakiev.com/blog/blender-interactive-console/ https://blenderartists.org/t/run-blender-script-from-command-line-need-help/552608

I hope this is helpful to you. Feel free to share your findings here.

Best regards Michael

awur978 commented 2 years ago

Hi Michael, thank you for your prompt reply. I will look into this and share any useful findings!