[Python] Alembic Selected Only bug
On 28/09/2016 at 16:38, xxxxxxxx wrote:
Cinema 4D Version: 17.053
Platform: Windows ;
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.
On 29/09/2016 at 09:26, xxxxxxxx wrote:
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.
On 29/09/2016 at 11:09, xxxxxxxx wrote: