I’ve created a character programmatically using Python and would like to export or save it in .obj format. However, I’m unable to do so — the export only works in .fbx format. Could you please let me know if there’s a sample code snippet or any workaround to enable .obj export? Thank you!
Try running the code from within Blender’s internal scripting.
If you have created and compiled your own libraries,
find the source code and try to insert them as classes in text format.
Once you have the character visible in Blender, you can export it to obj.
from RLPy import *
export_path = "F:\\test.obj"
avatar = RScene.GetAvatars()[0]
obj_options = (EExport3DFileOption_FullBodyPart |
EExport3DFileOption_AxisYUp |
EExport3DFileOption_TextureMapsAreShaderGenerated |
EExport3DFileOption_GenerateMeshGroupIni)
# Reset to bind pose (leave out to export current pose)
obj_options |= EExport3DFileOption_ResetToBindPose
# Include clothes
obj_options |= EExport3DFileOption_AllClothes
# Include OBJ Key
obj_options |= EExport3DFileOption_GenerateDrmProtectedFile
# Include materials
obj_options |= EExport3DFileOption_ExportMaterial
obj_options |= EExport3DFileOption_ExportExtraMaterial
# Export
RFileIO.ExportObjFile(avatar, export_path, obj_options)
There’s more options, look in RLPy.py for the complete list.
1 Like