On 01/11/2015 at 16:14, xxxxxxxx wrote:
Cinema 4D Version: R13-R16
Platform: Mac ;
Language(s) : C++ ;
I'm trying to collapse/uncollapse some videopost effect groups based from a tag, so when the user go to edit settings, will see the options available already open, and the ones that doesn't matter closed.
I found some ways to do it but I think none of them is what I need, because no success yet.
> bool groupIsOpen = true;
> BaseVideoPost *post = GetMyVideoPost();
> BaseContainer *postData = post->GetDataInstance();
> postData->SetBool( VP_GROUP_ID, groupIsOpen );
> post->SetParameter(DescLevel(VP_GROUP_ID), groupIsOpen, DESCFLAGS_SET_0);
> post->SetParameter(DescLevel(VP_GROUP_ID), GeData(groupIsOpen), DESCFLAGS_SET_0);
> post->SetParameter(DescID(VP_GROUP_ID), groupIsOpen, DESCFLAGS_SET_0);
> post->SetParameter(DescID(VP_GROUP_ID), GeData(groupIsOpen), DESCFLAGS_SET_0);
How do I do it??
On 01/11/2015 at 18:51, xxxxxxxx wrote:
I'm not sure if it will work, try to set it to -1
On 02/11/2015 at 02:28, xxxxxxxx wrote:
if a group is opened of not has nothing to do with the "value" of the "parameter". For example, you can open multiple Attribute Manager windows. And in each of the windows the state of a group may be different. So if a group is open or not is not stored with the "parameter" but only in the GUI element. The Render Settings window is using that GUI element.
But in your resource file you can define a "default value" of "DEFAULT -1;" that will make sure that a group is open every time it is created in the GUI.
On 02/11/2015 at 04:18, xxxxxxxx wrote:
I tried setting DESC_DEFAULT of DTYPE_GROUP, but it behaves like setting DEFAULT 1 on the res file.
Using -1 on the res file won't work, because I want to choose which one is open and which one is closed depending on the tag properties.
My tag has 3 camera types to choose from, (A, B and C), and each type has it's own settings group.
If the user is using camera type A, when he goes to the plugin settings, would be nice to have type A group open, and type B and C closed, because they are useless now.
Same for cameras B and C.
I still don't understand how to set DESC_DEFAULT using just the BaseVideoPost.
I can set it only from VideoPostData::GetDDescription()
On 02/11/2015 at 04:51, xxxxxxxx wrote:
what about a better approach.
you can do something like this in GetDDescription()
//add code to create group a descriptions
and so on
On 02/11/2015 at 09:52, xxxxxxxx wrote:
as said before, the state of the group is stored in the GUI element, not in the object. So you can't the description properties from the outside. As Mohamed suggested, you could set a parameter that defines how your GetDDescription() acts. If some parameters are useless in a certain situation, you could simply hide the corresponding groups.