Hide/Show Description Top Level Groups
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/07/2003 at 08:18, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.100
Platform: Windows ;
Language(s) : C++ ;---------
Hi,here is a cosmetic problem concerning descriptions ...
I'm using descriptions for the user interface of a cartoon renderer, a video post effect. It offers several brush tools for the outlines. It should show only the top level group which belongs to the currently selected brush. The parameters of the other brushes should be invisible. This is very similar to the behavior of the standard material when you switch on/off some of its channels.
Up to now, I'm using VideoPost::Message to catch the MSG_DESCRIPTION_VALIDATE message. There, I retrieve the Description of the node and iterate through its DescEntrys. With GetDescEntry I fill a BaseContainer with the data of the Description. In this BaseContainer, I use SetBool(DESC_HIDE, ...) to hide or show a top level group.
This works so far. Groups appear and disappear controlled by the program. But: The group heading buttons above the description appear in a wrong state. Though the newly visible groups are shown fully unfolded, the respective button is shown on gray background, not white.
Any ideas? (How is this implemented in the standard material editor?)
Thank you very much!
Regards,
jl -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/07/2003 at 09:28, xxxxxxxx wrote:
Sorry, I don´t really understand. Could you exactly show what you mean? What is meant by "wrong state" and white background? Even screenshots would help.
Some lines of code you have narrowed down to show the problem would surely help. (Darn, I sound like Mikael *g* )
Btw. There already was a thread here in the forum when Mikael Sterner showed some code to hide Description elements that works fine. Maybe you first want to start the search function of the forum and have a look at his code. There are dedicated functions for the description resources like GetDDescription and similar to handle Description changes.
Best
Samir -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/07/2003 at 02:54, xxxxxxxx wrote:
Hi Samir,
thanks for refering me to the previous thread. (Indeed, before my post I did only search for "Descriptions" in the subject lines, not in the message bodies. Oops.)
I've tried the solution Michael Sterner has pointed out. But the cosmetic problem remains. Here is a screenshot:
You can see the group "Creases: Ink Brush" being fully open, but its button in the heading is gray, which _should_ mean the group is closed, not open.
In addition to SetBool(DESC_HIDE, TRUE) I've tried to force the opening with SetBool(DESC_DEFAULT, TRUE), but without success.
Regards,
jl -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/07/2003 at 03:44, xxxxxxxx wrote:
Hi,
ah I see. Hmm, I´m not sure if DESC_DEFAULT is really for the default state. Have you set the default state in the resource file for this group to 1 ?
Best
Smir -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/07/2003 at 05:37, xxxxxxxx wrote:
Hi,
> not sure if DESC_DEFAULT is really
Yes. The group will not be open initially if there is a DEFAULT 0 in the description resource and I don't set DESC_DEFAULT to TRUE in the program.
Whether a group is opened or closed seems to be a boolean parameter which is not part of the description itself (unlike DESC_HIDE) but stored with the other, regular parameters. In the description, one can only change the _default_ value of this open/close parameter. This obviously works fine, because the group _is_ opened/closed accordingly. But it doen't help with the wrong appearance of the button (see screenshot in my previous posting). This looks like an UI update done only halfway.
Did your plug-in suffer from the same problem as mine?
Regards,
jl -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/07/2003 at 08:42, xxxxxxxx wrote:
Yes. The group will not be open initially if there is a DEFAULT 0 in the description resource and I don't set DESC_DEFAULT to TRUE in the program.
I just tried it and it seems that setting this value will only have affect at the very beginning when the first instance is created. Means the user chooses your plugin out of the VP list, then the state you have set will be used. But not while having it open.
(if the quicktab is selected when you are hiding it, it should still be selected when you unhide it again)
I don´t see a way to select the quicktab at the moment. Maybe if you can find out the description ID of the quicktab entry itself you could use FindCustomGui_(ID,QUICKTAB_CUSTOMGUI) and then use qt->Select(SUBID,TRUE); but I spontaneously I have to say I don´t know if this is possible to get the Quicktab ID...
Will have a look when I find the time.
Best
Samir -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/07/2003 at 15:01, xxxxxxxx wrote:
To hide/unhide groups overload 'GetDDescription':
Bool MyVPData::GetDDescription(GeListNode *node, Description *description,LONG &flags) { > \> \> \> if (!description->LoadDescription(my_videopost_id)) return FALSE; \> \> \> \> \> \> \> \> BaseContainer *param = description->GetParameterI(DescLevel(id_of_group_to_hide),NULL); \> \> \> \> \> if (param) param->SetLong(DESC_HIDE,TRUE_or_FALSE); \> \> \> \> \> flags |= DESCFLAGS_DESC_LOADED; \> \> \> \> \> \> \> \> return SUPER::GetDDescription(node,description,flags); }
This lets C4D dynamically update the descriptions!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/07/2003 at 04:10, xxxxxxxx wrote:
The problem was not the hiding, he did overload GetDDescription (see Mikael Sterners thread I pointed to) but the quicktab wasn´t selected.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/08/2003 at 05:25, xxxxxxxx wrote:
Ummm.. my bad.