copy user data from one group to another
-
On 25/01/2017 at 08:21, xxxxxxxx wrote:
Hi, I am trying to copy data from a user group that has 22 user data fields into another group that has the same number of fields when the user presses a button. Basically it allows the user to store changes he has made to the first group in his own preset. How would I go about doing this? Thanks.
-
On 25/01/2017 at 11:36, xxxxxxxx wrote:
By copying you mean copying value or recreate them into another object / group?
Anyway a good read for you http://www.cineversity.com/wiki/Python%3A_User_Data/
-
On 25/01/2017 at 16:27, xxxxxxxx wrote:
I will take a look at that. No, copying the values from one user data group to another within the same null.
-
On 26/01/2017 at 01:24, xxxxxxxx wrote:
If they got the same order or you will be sure user will not change / remove user data then you can simply do
my_second_object[c4d.ID_USERDATA,1] = my_first_obj[c4d.ID_USERDATA,1]it's not the proper way but it can do the job and it's pretty easy to write.
Or you can check the name by listing all userDatas(BaseList2D.GetUserDataContainer()), checking his parent if it's the good one (with c4d.DESC_PARENTGROUP) and then doing a string comparaison with his name with c4d.DESC_NAME and then apply the userData. -
On 26/01/2017 at 03:56, xxxxxxxx wrote:
I want to set it up so the user can change the preset at the push of a button. All the user data is on one object, a null. It controls various objects in the OM with user data presets whose values can be altered. These presets are chosen through a dropdown. When the user chooses one of these presets from the dropdown, then customizes those values, I want him to be able to then store those values in his own user preset. Make sense?