On 11/10/2016 at 07:02, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 17
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I am trying to make a system to easily add xref files (preset scenes) to a current document.
The xref file should have 'encapsulated' off as on the main null in the xref are user data settings I want to expose directly without having to open the tree.
But running into an odd issue.
I tried setting the 'encapsulated' boolean thru script but that wouldn't work. So I found a workaround. Cinema remembers the last setting, so I open cinema4D and set the 'encapsulated' option off in the 'Add Xref' settings and import a xref. Then close c4d.
Then when I open it again and use my plugin to import an Xref, I end up with 2 xref objects.
One indeed 'encapsulated' and one empty xref object.
Below is the code I am using.
I am rather new to the whole c++ plugin development, any help would be appreciated.
From: http://www.gamelogicdesign.com/Description/Node?containerName=Oxref
BaseDocument *doc = GetActiveDocument();
BaseObject* xref = BaseObject::Alloc(Oxref);
doc->InsertObject(xref,nullptr,nullptr);
EventAdd(EVENT_FORCEREDRAW);
...
xref->SetParameter(ID_CA_XREF_FILE, xrefFile, DESCFLAGS_SET_USERINTERACTION);
xref->SetParameter(ID_BASELIST_NAME, xrefName, DESCFLAGS_SET_0);
xref->Message(MSG_UPDATE);