I'm having issues wrapping my head around how to change an FBX Importer preference via Python. Any help would be appreciated, below explains my approach and what I was able to figure out so far. Please note that I am fairly new to the C4D Python API.
The specific goal is to change c4d.FBXIMPORT_NORMALS of the FBX Import.
First I need to figure out what the plugin ID is. I used the below approach to do. Please let me know if there is a better way to do this -
for p in c4d.plugins.FilterPluginList(c4d.PLUGINTYPE_ANY,True):
print (p.GetID(), " = ", p.GetName())
The above output gives me -
1026370 = FBX (*.fbx)
1026369 = FBX (*.fbx)
1026370 = FBX (*.fbx) Export
1026369 = FBX (*.fbx) Import
1026371 = FBXExportReferenceTag
The FBX Import Plugin Id is 1026369 . I now can return the BasePlugin object and SHOULD be able to set the parameter from here -
plug = c4d.plugins.FindPlugin(1026369, c4d.PLUGINTYPE_SCENELOADER)
>>> <c4d.plugins.BasePlugin object called FBX (*.fbx) with ID 15 at 2429143389120>
plug[c4d.FBXIMPORT_NORMALS] = c4d.FBXIMPORT_NORMALS_NORMALTAGS
I run the above without any changes to the Preferences/FBX Import UI. Following the same concept for the "Units" plugin I get the expected results when modifying it's parm Units[c4d.PREF_UNITS_AUTOCONVERT] = False
Units[c4d.PREF_UNITS_AUTOCONVERT] = False
Am I doing something incorrectly? Is this access via Python just not supported? Any help would be great. Thank you.
@ferdinand - Thank you! Apologies about not following forum protocol. I wanted to consolidate to avoid duplicate posts, but understand the desire to have separation between Python / C++ conversations.
I will reference the C++ material you linked for additional background. Thank you for the straightforward explanation between database and repository.
I had a moment of clarity after my previous post...
The "otherOrDbUrl" flag used to init a new "AssetDatabaseStruct" is a maxon.Url object...
This is not specified in the documentation from what I saw. Probably would be advantageous to include the types that are being passed as arguments.
At any rate, answered my own question. Database vs Repository clarification would still be useful if you're game!
@ferdinand - Would you be able to provide any additional guidance on how to do this using Python? Specifically, the appropriate way to define a new "AssetDatabaseStruct" so it can be added as an argument for "AssetDataBasesInterface.SetDatabases(newDataBases)"?
The documentation shows-
AssetDatabaseStruct.__init__(otherOrDbUrl, active=True, exportOnSaveProject=True, isBuiltin=False)
Which I'm trying to use in this manner -
dbStruct = AssetDatabaseStruct(otherOrDbUrl="C:/path/to/pre-existing/database/dir", active=True, exportOnSaveProject=True, isBuiltin=False)
But printing out the dbStruct yields -
_dbUrl: relative:///otherOrDbUrl, _active: True, _exportOnSaveProject: True, _isBuiltin: False
The path isn't taking. I'm assuming "otherOrDbUrl" is a string unix path to the database folder.
Now contrast this to what prints out after collecting AssetDatabaseStructs from -
_dbUrl: file:///C:/path/to/pre-existing/database/dir, _active: True, _exportOnSaveProject: True, _isBuiltin: False
I can't seem to find any examples on this and the documentation is a bit light (or I'm a bit dense, one of the two). Also I'm still a bit muddy on the differences between an asset database and an asset repository (bonus points if you can shed some light).
Very good. Thank you for the response and guiding me towards the appropriate channel of communication for this.
For my own curiosity, is Cinema4D leveraging a third party SDK for it's CAD meshing / translation? If so, does anyone know which one?
For example, Rhino utilizes Datakit for it's backend CAD translation process. I'm assuming Cinema4D uses a third party SDK as CAD translation is a very complicated subject matter, but Maxon may also be using something custom built at the kernel level instead. A mystery.
@m_magalhaes - All good! Just wanted to make certain that the issue hasn't been fixed yet (since 2018..).
In the future I'll write a python class, extending a group that is collapsible using the workaround you mentioned.
Thank you for getting back to me and looking into this! Cheers.
@m_magalhaes - Most definitely!
This is a section of a general c4d.gui.GeDialog class inheritance under the "CreateLayout" class method.
First attempt, only one that yielded a dropdown arrow -
self.GroupBegin(id=101, flags=c4d.BFH_CENTER, cols=1, rows=1,
groupflags=c4d.BFV_BORDERGROUP_FOLD, title="Group", initw=200, inith=100)
self.AddButton(102, flags=c4d.BFH_SCALE | c4d.BFH_FIT | c4d.BFV_SCALE | c4d.BFV_FIT, name="das_button")
However, docs note that the "BFV_BORDERGROUP_FOLD" flag is deprecated. This example above was what the video in the original thread shows with the fold arrow icon disappearing w/ the group contents.
From there I experimented with the "BFV_BORDERGROUP_FOLD2" and "BFV_BORDERGROUP_FOLD_OPEN" flags. Together, soloed, in different orders. None of which gave me a fold arrow icon.
Let me know what you think. I'm only a month into C4D in general (API included), so I'm still getting a general foundation established.
Appreciate you time and input. Thank you.
Howdy everyone. First post, great to be here! I'm running on Windows w/ vR26
I'm trying to get a group to fold, but seem to be unable to get it working. After poking around in the forum, I'm finding multiple posts about how this feature has been broken since ~2018.
Would someone be able to provide confirmation that this is still a bug ~5 years later?
This is as far as I was able to get - https://www.screencast.com/t/XntK6IqSS49
Clearly not the intended functionality if my group is just going to zap out of existence.
I have not attempted the suggested work around referenced here. I wanted to make sure it was still broken before sinking more time into it.