THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/11/2008 at 08:36, xxxxxxxx wrote:
Cinema 4D Version: 9.1+
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
OK, I've done a search to get an understanding of how to access User Data parameters and found a few posts showing how to browse, retrieve and set User Data parameters.
But, now what I want to do is store the User Data parameter settings in several sets so they can be called later with a click of a button and the values restored to the User Data parameters from a selected set of values. The stored sets also need to be managed so that if a user deletes a User Data, the values in the stored sets that correspond to the deleted User Data also need to be deleted. Then to top it off, this needs to be done for a list of objects.
How would I go about storing all this data? Should I create structures and arrays, or use BaseContainers with sub-containers? If there are large amounts of data, will BaseContainers slow things down dramatically? If it's better to use arrays, what kind of structure would it need to store User Data values?
I hope I haven't bitten off more than we all can chew, here. :o(
On 29/11/2008 at 09:16, xxxxxxxx wrote:
For my UserData presets I use the try() / catch() to prevent problems
if the user deletes a UserData slider.
You are awere that, afaik, UserData ID's are set as they are created.
So if a user deletes several UD's and then add them again, they more
than likely will have different ID.
Also, there is a (bug) difference if the user edit UserData from the
newer "Manage UserData" or via the older "Edit Entry...".
On 30/11/2008 at 17:30, xxxxxxxx wrote:
Ah, thanks for the info. ;o)
I notice that the UserData's that are left after deleting, still have the same ID, so that's a plus. ;o)
Also, the function op->IsDirty(DIRTY_DATA) returns TRUE every time a change is made to the User Data, so I can poll for EVMSG_CHANGE and then check to see if an object's data is dirty and adjust the stored data.
But the question still remains as to the best way to store the value sets. :o(
On 08/12/2008 at 00:24, xxxxxxxx wrote:
I still have to look into this myself. Meanwhile if you not already have check out the DynamicDescription class.
Storing the data in containers seem to me the best way.
On 08/12/2008 at 09:12, xxxxxxxx wrote:
Yeah, I'm familiar with the DynamicDescription class.
Well, I tried using structs and arrays, and got way too many crashes, especially when trying to free data, so I switched to BaseContainers and so far it's a lot more stable. I just need to work on managing the containers so that they always reflect the changes that the user makes. ;o)