SOLVED SaveDocument Unexpected Behavior in R23

Hello there,

I tried to export the OBJ file using c4d.documents.SaveDocument(). The return value always be true, but I cannot find the exported file.

I can reproduce this issue using the script from the official repository:
https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/master/scripts/03_application_development/files_media/export_obj_r13.py

This issue only appears in Cinema 4D R23, and I also found that the API works after I export an OBJ file using GUI. If I reset the user data by deleting the preferences folder, it doesn't work again.

Cinema 4D version: R23.110
System: macOS 11.2.3

Thanks,
Kon

hi,

you have to add this line if you don't want animated object.
At least for now, I'm going to check with the devs if it's our code (conditions) or the "default" parameters that are missing

    objExport[c4d.OBJEXPORTOPTIONS_ANIMATION_TYPE] = c4d.OBJEXPORTOPTIONS_NO_ANIMATION

or one of those if you want animation :

''' 
can be on of those if animation is wanted.
OBJEXPORTOPTIONS_MANUAL_RANGE
OBJEXPORTOPTIONS_LOOP_FRAMES
OBJEXPORTOPTIONS_PREVIEW_FRAMES
OBJEXPORTOPTIONS_ALL_ANIMATED_FRAMES
	
'''
objExport[c4d.OBJEXPORTOPTIONS_ANIMATION_TYPE] == c4d.OBJEXPORTOPTIONS_ALL_ANIMATED_FRAMES

Cheers,
Manuel

hi,

you have to add this line if you don't want animated object.
At least for now, I'm going to check with the devs if it's our code (conditions) or the "default" parameters that are missing

    objExport[c4d.OBJEXPORTOPTIONS_ANIMATION_TYPE] = c4d.OBJEXPORTOPTIONS_NO_ANIMATION

or one of those if you want animation :

''' 
can be on of those if animation is wanted.
OBJEXPORTOPTIONS_MANUAL_RANGE
OBJEXPORTOPTIONS_LOOP_FRAMES
OBJEXPORTOPTIONS_PREVIEW_FRAMES
OBJEXPORTOPTIONS_ALL_ANIMATED_FRAMES
	
'''
objExport[c4d.OBJEXPORTOPTIONS_ANIMATION_TYPE] == c4d.OBJEXPORTOPTIONS_ALL_ANIMATED_FRAMES

Cheers,
Manuel

@m_magalhaes

Thank you so much for the help! The script works fine after adding this line.

Cheers,
Kon