I would like to create 3ds or .obj files with python. For example I want to create a cube with python programming and I want to save it in a file like "cube.obj"; how can I do that?
Solutions that I have tried:
1) Blender API for python
2) OpenGl for python - I can create models but I cannot save the model as a file.
If you want to export as OBJ.
import bpy
bpy.ops.export_scene.obj(filepath="", use_selection=True)
filepath
is where you want to export the model
use_selection
is if you want to export the whole scene or just the selected part
There are a lot more you can do with this function via arguments you can read about it here