On 03/10/2016 at 02:40, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R18 
Platform:   Windows  ;   
Language(s) :     C++  ;


I have seen that DOCUMENTSETTINGS_DOCUMENT include the project settings which can be found in ddoc.h
But which parameters belong in DOCUMENTSETTINGS_GENERAL group ? 
If I copy the whole document, are the general settings copied as well or only the document settings ?

Thank you for your time.

On 05/10/2016 at 06:37, xxxxxxxx wrote:

Hi Peterakos, thanks for writing us.To browse through the parameters belonging to DOCUMENTSETTINGS_GENERAL you can use the GetData() method to retrieve the BaseContainer and using a BrowseContainer object you can iterate and return the id/value of those parameters and matching the ID to the values found in ddoc.h get an understanding of their purpose.

GeData* dataPtr = nullptr;  
Int32 id = 0;
// Retrieve the BaseContainer where to access the DOCUMENTSETTINGS_GENERAL params
BaseContainer bcGenData = doc->GetData(DOCUMENTSETTINGS_GENERAL);
// Allocate a BrowseContainer object, initializing with the reference to retrieved BaseContainer
BrowseContainer containerBrowser = BrowseContainer(&bcGenData );
// Loop through all parameters stored  
while (containerBrowser.GetNext(&id, &dataPtr))  
 if (dataPtr)
   ... and do something with the data retrieved  

With reference to the second part of the question, I confirm that if you change the value of one of the parameters belonging to DOCUMENTSETTINGS_GENERAL once you copy or clone the document the parameter in the new document is populated with the new value. Please take care of calling the SetData() method after updating the value any parameter stored in DOCUMENTSETTINGS_GENERAL.

// Change the value of the project FPS  
bcGenData.SetParameter(DOCUMENT_FPS, Int32(66));
// Update the values in the document  
GeData docFPSData;
// Allocate a new BaseDocument instance  
BaseDocument* copiedDocPtr = BaseDocument::Alloc();  
if (nullptr == copiedDocPtr)  
 return false;
// Copy the old document on the new document  
doc->CopyTo(copiedDocPtr, COPYFLAGS_0, nullptr);
// Retrieve the BaseContainer for the new document referred to DOCUMENTSETTINGS_GENERAL  
BaseContainer bcNewCopyGenData = copiedDocPtr->GetData(DOCUMENTSETTINGS_GENERAL);
// Populate the GeData object with the values belonging to param DOCUMENT_FPS  
bcNewCopyGenData.GetParameter(DOCUMENT_FPS, docFPSData);
// Print the value  
GePrint("FPS in copied doc is: " + String::IntToString(docFPSData.GetInt32()));
// Deallocate the new doc  

Best, Riccardo