all cards on the table, i'm using chat gpt to write this script. :)) It was very helpful at modifying existing scripts, but seems to be failing here.
after some reading i found some info about loading a plugin 1026370. so i got it to write a new script:
import os
import c4d
from c4d import documents, gui
def main():
# Get the active document and the current path
doc = documents.GetActiveDocument()
doc_path = doc.GetDocumentPath()
doc_name = doc.GetDocumentName()
# Get the selected objects
selected_objects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN)
# Check if there are any selected objects
if not selected_objects:
gui.MessageDialog('No objects selected. Please select at least one object and try again.')
return
# Set the FBX export path and name
first_obj_name = selected_objects[0].GetName()
fbx_name = '{}_{}.fbx'.format(doc_name, first_obj_name)
fbx_path = os.path.join(doc_path, fbx_name)
# Initialize FBX export settings
fbx_export_settings = c4d.BaseContainer()
fbx_export_settings.SetBool(c4d.FBXEXPORT_ASCII, True)
fbx_export_settings.SetBool(c4d.FBXEXPORT_EMBED_TEXTURES, False)
fbx_export_settings.SetBool(c4d.FBXEXPORT_SELECTION_ONLY, True)
# Get the FBX exporter plugin ID
fbx_exporter_id = c4d.FBX_EXPORTVERSION_7_5_0
if fbx_exporter_id == 0:
fbx_exporter_id = 1026370 # Use the plugin ID directly for Cinema 4D 2023.1
# Export the selected objects to an FBX file
result = documents.SaveDocument(doc, fbx_path, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST,
fbx_exporter_id, fbx_export_settings)
if result:
gui.MessageDialog('FBX export successful: {}'.format(fbx_path))
else:
gui.MessageDialog('FBX export failed. Please check the file path and try again.')
if __name__=='__main__':
main()
but now i get an error: TypeError: function takes at most 4 arguments (5 given)