_GetDescription

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/04/2009 at 10:46, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R11 
Platform:   Windows  ; Mac  ;  
Language(s) :     C++  ;

---------
Hello,

i wrote my own datatype and therefor i had to overwrite the function

> virtual Bool \_GetDescription(const CustomDataType \*[RED]data[/FONT],Description &desc;,LONG &flags;,const BaseContainer &parentdescription;,DescID \*singledescid)

I wrote the function as shown in the datatype example of the sdk.
Additional to the "standartattributes" my datatype has list (called addtionalAttributes), where GeData can be saved. Now i want to read out these attributes and want to enlarge the description dynamically.
Therefor i have to cast the Customdatatype to my datatype (as in the CopyData-function for example). But the data is empty rather NULL..why???

The function looks like this:

> Bool AixPointClass::\_GetDescription(const CustomDataType \*data,Description &desc;,LONG &flags;,const BaseContainer &parentdescription;,DescID \*singledescid){ \>      //Load description \>      Bool res = desc.LoadDescription(GetId()); \>      GePrint("\_GetDiscription"); \>       \>      //cast to AixPoint \>      [RED]AixPoint\* source = (AixPoint\* ) data;[/FONT] //THIS IS NULL ?!? \> \>      //Basecontainer for dynamic description \>      BaseContainer dynamic; \> \>      [RED]if(source != NULL)[/FONT]{ \>            \>           LONG index = AIXPOINT_ADDITIONALATTRIBUTE_START; \>            \>           //first element \>           source->additionalAttributes->current = source->additionalAttributes->first; \>            \>           //run over the list \>           do{ \>                 \>                //determine datatype \>                dynamic = GetCustomDataTypeDefault(source->additionalAttributes->current->GetType()); \>                 \>                //set name \>                dynamic.SetString(DESC_NAME, source->additionalAttributes->current->GetName()); \>                 \>                //set value \>                dynamic.SetData(DESC_DEFAULT, source->additionalAttributes->current->GetValue()); \>                 \>                //write description \>                if(!desc.SetParameter(DescLevel(index, source->additionalAttributes->current->GetType(), 0), dynamic, DescLevel(0))){ \>                     //No attributes \>                     break; \>                } \>                 \>                //Check the end \>                if(index < AIXPOINT_ADDITIONALATTRIBUTE_END){ \>                     //next attributeID \>                     index++; \>                      \>                     //next attribute \>                     source->additionalAttributes->current = source->additionalAttributes->current->GetNext(); \>                } \>                else{ \>                     //leave the loop if the maximum is arrived \>                     break; \>                } \>                 \>                 \>           }while(source->additionalAttributes->current->GetNext() != NULL);//End of do-while \>            \>      } \>       \>      if(res){ \>            \>           flags |= DESCFLAGS_DESC_LOADED; \>      } \>       \>      //Description zurueckgeben \>      return SUPER::\_GetDescription(data,desc,flags,parentdescription,singledescid); \> }//End of \_GetDiscription \> \>

I'm so confused because in the other functions "data" is not NULL.
I hope anybody can help me.

Thanks for your replies

Oliver

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/04/2009 at 06:00, xxxxxxxx wrote:

I think it's a bug.
But i solved the problem. I catch the information i need with an additional pointer at the end of the CopyData-function. So i have
> AixPoint\* source = descriptionPointer; \> //do stuff

Not nice but it works.

If anybody has an other idea i perk up one's ears.

cheers,
Oliver

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 09/10/2009 at 02:54, xxxxxxxx wrote:

A bit late but maybe still of interest. You have to pass the CUSTOMDATATYPE_INFO_NEEDDATAFORSUBDESC flag in RegisterCustomDataTypePlugin() to get a valid data in _GetDescription().

cheers,
Matthias