DESC_DEFAULT not working?



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

    On 28/10/2007 at 05:59, xxxxxxxx wrote:

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

    ---------
    Hi,

    can somebody confirm that in 9.6 (haven´t tried with R10 or 10.5 yet) the DESC_DEFAULT container value is ignored when adding a custom element to the AM description?

    I don´t get my stored default value shown in the AM when my element is created.

    thanks



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

    On 28/10/2007 at 09:06, xxxxxxxx wrote:

    ok, I think I misunderstood. Default is not the default element value but the DEFAULT description attribute. :)



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

    On 07/04/2009 at 03:10, xxxxxxxx wrote:

    hi.

    sry to dig this out again, but i have the same problem now.. how would i set the default value then for a dynamically added description element ?

    ofc i could just set it in the baseContainer of my plugin, but im not sure where, as it should only be set the default value when creating a new description node.

    if i set the default value in GetDDescription, where i dynamically create my description nodes, it will ofc always set the value, and not just initially..

    thanks,
    Daniel



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

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

    For dynamic descriptions, the value should be stored someplace else besides the description itself. If in a BaseContainer or class variable, set the default value in the Init() of your plugin data class using something like:

    //*---------------------------------------------------------------------------*
    Bool MyPluginData::Init(GeListNode* node)
    //*---------------------------------------------------------------------------*
    {
         desc = Description::Alloc();
         if (!desc) return ErrorException::OOMThrow(EE_DIALOG, GeLoadString(IPPERR_MEMORY_TEXT), "IPPBase.Init.desc");

    // Class member variable
         value = 0L;
         // OR
         // Initialize container value
         BaseContainer* bc = ((BaseObject* )node)->GetDataInstance();
         bc->SetLong(MYPLUGINDATA_VALUE, 0L);
         return TRUE;
    }

    Most likely, as you are using a dynamic description, the BaseContainer option will not be possible unless you have, say, a block of ids setup to accomodate the dynamic descriptions wherein you'll need to initialize them all. In some cases, the value may be stored in another class or plugin basecontainer and you should initialize there (in the constructor or Init()).


Log in to reply