Getting dynamically added LONG CYCLE String value
-
On 11/08/2013 at 10:30, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :---------
I used the good solution by Remo, found here, on how to dynamically add items to a dropdown list:
https://developers.maxon.net/forum/topic/6963/7843_dynamically-update-a-dropdowncycle&KW=GetDDescription&PID=32482#32482But how do I read them? I can easily get the index, no problem. And of course I can store an array with the item text strings elsewhere. But is there a way to read out the text directly?
I want to do this in the message method.Bool MyTag::Message (GeListNode* node, LONG type, void* data) { LONG selectedItemIndex = bc->GetLong(MY_DROPDOWNLIST); }
The code is simplified.
-
On 11/08/2013 at 13:08, xxxxxxxx wrote:
You can read them only if you have access to.
Description \*description
-
On 11/08/2013 at 18:48, xxxxxxxx wrote:
GetParameter()
See sticky topic at top of this forum:
https://developers.maxon.net/forum/topic/5284/5286_please-use-getparametersetparameter
You can't read the text directly - you get the enumerated LONG value associated with whatever text you assigned to it.
-
On 12/08/2013 at 02:46, xxxxxxxx wrote:
Yup, you are right. I have to store the values in a basearray, and use the enumerated LONG to retrieve it. By the way, I still use the "old" method it seems, too much.
Another question:
How can I force an update of the dropdown list? (The enumerated list)?
I have a button in the description GUI, when pressing that, a new disc file is created. The enumerated list contains these disc files, and needs to be updated immediately. I haven't found a way to do this, because it seems it only can be done in the implementation of:Bool MyTag::GetDDescription (GeListNode* node, Description* description, DESCFLAGS_DESC &flags)
And I do not know what to do to make C4D call this.
-
On 12/08/2013 at 04:34, xxxxxxxx wrote:
BaseContainer listBC; // This is where you'll loop through your enumerated list for (LONG i = 0L; i <= lastIndex; ++i) { // Add item name to drop-down list (name is a String of the file name, for instance) listBC.SetString(i, name); } BaseContainer comboBC = GetCustomDataTypeDefault(DTYPE_LONG); // - This is the text to the left of the drop down comboBC.SetString(DESC_SHORT_NAME, "List:"); comboBC.SetLong(DESC_ANIMATE, DESC_ANIMATE_OFF); comboBC.SetBool(DESC_REMOVEABLE, FALSE); // - Add your dropdown items comboBC.SetContainer(DESC_CYCLE, listBC); // - LIST_COMBO must be defined in your tag's .h file // - This sets the currently selected item in the list (the first item, by default) tagbasecontainer->SetLong(LIST_COMBO, 0L); // Add your dropdown description to your tag if (!description->SetParameter(DescLevel(LIST_COMBO, DTYPE_LONG,0L), comboBC, DescLevel())) return FALSE;
-
On 12/08/2013 at 06:39, xxxxxxxx wrote:
Robert, thanks!
But I do not know how to make this in a free standing function..?
I have no problems filling up the combo with disc file names, as long as it happens inside this, which is totally under C4D's command:Bool FootFollower::GetDDescription (GeListNode* node, Description* description, DESCFLAGS_DESC &flags)
It is filling up the list when I want, that is the problem.
And in your code, I do not know how to get hold of "description" and "DescLevel".How do I do this in a free standing function (not called by C4D)?
-
On 12/08/2013 at 08:17, xxxxxxxx wrote:
Well, GetDDescscription is called quite often. I think there is a way to 'trigger' it to be called but I'll have to sift through my code to find out. It might be as simple as calling a tag->Message(MSG_CHANGE); when you want to update the descriptions.
-
On 12/08/2013 at 10:07, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Well, GetDDescscription is called quite often. I think there is a way to 'trigger' it to be called but I'll have to sift through my code to find out. It might be as simple as calling a tag->Message(MSG_CHANGE); when you want to update the descriptions.
The combo box contains a list of template files.
I have a button, when the user click this, a new template files is created. The list is not updated. The funny thing is, I have another button, which applies the current selected template in the combo to an object. When this button is clicked, the list is sometime (but not always) updated. It is obvious that I want the list to always be updated according to the current situation, and furthermore, I need the selected item in the list to be the recent, the newly created template file. " is called quite often" is just not good enough.
For my private use, it is ok, I can live with it. But the day it is published, it has to function in a professional way. If you come across code which does what I am after, I certainly would be interested! -
On 12/08/2013 at 23:56, xxxxxxxx wrote:
Hi,
If you are in a TagData plugin you have to call
tag->SetDirty(DIRTY_DATA);
to force the tag to update and its GetDDescription() method to be called.
(See this old thread)
-
On 13/08/2013 at 01:06, xxxxxxxx wrote:
I used DIRTYFLAGS_DESCRIPTION instead of DIRTYFLAGS_DATA one of my effector plugins and it
worked out fine so far.They're called DIRTYFLAGS_ instead of DIRTY_ since a few Cinema releases but I don't know since
which exactly. -
On 13/08/2013 at 01:28, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I used DIRTYFLAGS_DESCRIPTION instead of DIRTYFLAGS_DATA one of my effector plugins and it
worked out fine so far.They're called DIRTYFLAGS_ instead of DIRTY_ since a few Cinema releases but I don't know since
which exactly.You're right; with R12 renaming changes the DIRTY enum had been changed to DIRTYFLAGS.
And DIRTYFLAGS_DESCRIPTION was added to the API in R13. -
On 13/08/2013 at 03:00, xxxxxxxx wrote:
Works!! Thanks!!
-
On 13/08/2013 at 03:33, xxxxxxxx wrote:
There you go.