Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. janbiko
    J
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    janbiko

    @janbiko

    0
    Reputation
    4
    Posts
    68
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    janbiko Follow

    Posts made by janbiko

    • RE: Cloner objects missing in Commandline FBX export

      Hi Manuel,

      unfortunately, setting FBXEXPORT_SELECTION_ONLY didn't change anything. I'm trying to run the export as a Plugin for the Command Line, so all of the code is located in a .pyp file in the plugins directory.
      The command I use to start the conversion is as follows:

      Commandline.exe -nogui ExportC4D "src=E:\Users\janbiko\Documents\test.c4d" "format=fbx"
      

      The file contains a PluginMessage method (as described here https://developers.maxon.net/docs/Cinema4DPythonSDK/html/misc/pluginstructure.html):

      def PluginMessage(id, data):
      	if id == c4d.C4DPL_COMMANDLINEARGS:
      		if 'ExportC4D' in sys.argv:
                              # parse arguments and initialize exporter object
      

      The exporter class then loads a .c4d file and exports it as an .fbx as described in my last post. As I already mentioned, this works fine for other C4D files that to not contain Cloner objects, so I'd assume the general structure of my plugin to be correct.

      posted in Cinema 4D Development
      J
      janbiko
    • RE: Cloner objects missing in Commandline FBX export

      Hi Manuel,

      Thanks for your response. I'm loading the scene directly from a .c4d file as follows (with src being the path to the c4d file):

      load = documents.LoadFile(src)
      if not load:
      	return False
      
      self.doc = documents.GetActiveDocument()
      	if self.doc is None:
      		return False
      

      Up to this point, everything works as expected. If I print a list of all objects, the Cloner object is there. However, when I export the scene as an FBX, the Cloner object is missing. I had a look at the thread you linked and experimented with the different export flags, but it didn't seem to have any effect regarding the Cloner issue. Here's the full code for my export method:

      FBX_EXPORTER_ID = 1026370 
      
      def Export(self):
      
          objs = GetAllObjects(self.doc.GetFirstObject(), [])
          for obj in objs:
              print obj.GetName(), "-", obj.GetType() # the cloner is still here at this point
      
          plug = c4d.plugins.FindPlugin(FBX_EXPORTER_ID, c4d.PLUGINTYPE_SCENESAVER)
          if plug is None:
              return
      
          # Get a path to save the exported file
          filePath = self.dst
          if filePath is None:
              return
      
          op = {}
          if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
              print op
              if "imexporter" not in op:
                  return
      
              # BaseList2D object stored in "imexporter" key hold the settings
              fbxExport = op["imexporter"]
              if fbxExport is None:
                  return
      
              # set export flags
              fbxExport[c4d.FBXEXPORT_CLONE_OBJECTS] = True
              fbxExport[c4d.FBXEXPORT_LIGHTS] = True
              fbxExport[c4d.FBXEXPORT_SPLINES] = True
              fbxExport[c4d.FBXEXPORT_LIGHTS] = True
              fbxExport[c4d.FBXEXPORT_TRACKS] = True
              fbxExport[c4d.FBXEXPORT_TRIANGULATE] = True
              fbxExport[c4d.FBXEXPORT_INSTANCES] = True
              fbxExport[c4d.FBXEXPORT_SUBSTANCES] = True
              fbxExport[c4d.FBXEXPORT_SAVE_NORMALS] = True
              fbxExport[c4d.FBXEXPORT_EMBED_TEXTURES] = True
              fbxExport[c4d.FBXEXPORT_TEXTURES] = True
      
              # export without dialogs
              return documents.SaveDocument(self.doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, FBX_EXPORTER_ID)
      

      This works fine for other c4d files that do not contain any Cloner objects. I'm on R21 Trial at the moment, by the way.

      posted in Cinema 4D Development
      J
      janbiko
    • Cloner objects missing in Commandline FBX export

      When I'm exporting a c4d file from the Cinem4D GUI as FBX, I get the correct output. But if I load the file in the Commandline and then export it as fbx, all of the cloner objects are missing. Has anybody a solution to this?

      This is how i load the file:

      load = documents.LoadFile(src)
      if not load:
          return False
      
      doc = documents.GetActiveDocument()
      

      and this is how i export:

      FBX_EXPORTER_ID = 1026370 
      documents.SaveDocument(self.doc, self.dst, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, FBX_EXPORTER_ID)
      
      posted in Cinema 4D Development
      J
      janbiko
    • Melange with Assimp

      Im trying to build assimp with the Melange SDK on Mac and get the following error:

      "C4D is currently only available on Windows with melange SDK installed in contrib/Melange"

      Is there any workaround for Mac users?

      posted in Cineware SDK Development
      J
      janbiko