Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    [Python] Alembic Selected Only bug

    Scheduled Pinned Locked Moved Bugs
    3 Posts 0 Posters 647 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 28/09/2016 at 16:38, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   17.053 
      Platform:   Windows  ;   
      Language(s) :

      ---------

      This is a funny bug.  Here's what I do:

      abcExport = op["imexporter"].GetDataInstance()
        
      # Other, unrelated code
        
      abcExport[c4d.ABCEXPORT_SELECTION_ONLY] = True # = 1 seems to work
        
      if c4d.documents.SaveDocument(doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1028082) :
                  print "Document successfully exported to:"
                  print filePath
              else:
                  print "Export failed!"
      

      So, nothing unusual, except the ABCEXPORT_SELECTION_ONLY isn't respected--all of the scene's objects will be in the .abc.  The next time you go to export an .abc by hand, the dialog will reflect the fact that you set that flag to true, you can see the corresponding box will be checked, but it still won't be respected if you export by script instead of by hand (that is, it'll still export all objects in the scene).

      Until you go to export an Allembic manually, but hit Cancel in the settings dialog.  Afterwards, the flag you set in script will be recognized properly in the .abc, and if you manually go to export an Allembic and hit Cancel again, it'll toggle back to not respecting the flag set in script.

      This behavior is confirmed on two of our workstations (didn't check any others) on 17.053.  It wouldn't be much of a concern at all (how often do you hit Cancel on an Allembic export?), except it reverts to this undesired behavior on startup, and we're going to be exporting a lot of .abc's...

      Thanks for looking into this!  Lemme know if anything is unclear, because it is a strange one.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 29/09/2016 at 09:26, xxxxxxxx wrote:

        Hi,

        you are right, there's an issue and unfortunately you currently can't work around it using Python.

        In C++ you could work around by sending a MSG_DESCRIPTION_IMPEXPORT_INIT to the exporter. But that's currently not available in Python. And it also shouldn't be necessary.
        I'll forward it to development.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 29/09/2016 at 11:09, xxxxxxxx wrote:

          Thanks, Andreas!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post