Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    DESC_DEFAULT not working?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 362 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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. 🙂

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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()).

            1 Reply Last reply Reply Quote 0
            • First post
              Last post