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

    basecontainer no access

    SDK Help
    0
    4
    512
    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
      Helper
      last edited by

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

      On 07/02/2003 at 10:41, xxxxxxxx wrote:

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

      ---------
      Man, last thing worked out new problems occur...
      Is it possible that a basecontainer is "full"? I cannot get access to some basecontainer entries.
      i.e. Have ten elements with IDs TREE_THICK_1, TREE_THICK_2 etc.
      I iterate thru them like for(i=0;i<5;i++) { x = data->GetReal(TREE_THICK_1+i); }
      I did this with other elements before too. It worked without any problems. Now I have problems and cannot get access to them somehow. I am passing the basecontainer to my main function and access some basecontainer settings when I need them. And even direct access doesn´t work! In the Init function everything still seems to be fine. 😕 Any ideas?
      Samir

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

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

        On 07/02/2003 at 11:27, xxxxxxxx wrote:

        Have you ever changed the data type of the container entries? Don't know exactly what will happen, but if you one time e.g assign a LONG to a specific ID, then save the c4d-scene and later you decide that under that ID should be a Real, this may cause what ever.
        Try to make a new scene with fresh objects...
        You may try to read the container values with a coffee expression using "println (data->GetData(ID))" and see what data type (or nil) will be printed in the console.

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

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

          On 07/02/2003 at 13:05, xxxxxxxx wrote:

          1> A container can not be "full", unless you run out of memory, and that is -very- unlikely.
          2> a bit more information might help us 😉 how are you passing your container, when do you set the data, where are you reading it and how. A quick example test:

              
              
              
              
              Bool MenuTest::Execute(BaseDocument *doc)  
              {  
               BaseContainer bc;  
               LONG i;
              
              
              
              
               for (i=1000;i<1005;i++)  
                bc.SetReal(i,i);
              
              
              
              
               for (i=1000;i<1005;i++)  
                GePrint(RealToString(bc.GetReal(i,i)));
              
              
              
              
               return TRUE;
              
              
              
              
              }
              
              
              
          

          or another example:

              
              
              
              
              void Fred(BaseContainer *bc)  
              {  
               LONG i;
              
              
              
              
               for (i=1000;i<1005;i++)  
                GePrint(RealToString(bc->GetReal(i,i)));  
              }
              
              
              
              
              Bool MenuTest::Execute(BaseDocument *doc)  
              {  
               BaseContainer bc;  
               LONG i;
              
              
              
              
               for (i=1000;i<1005;i++)  
                bc.SetReal(i,i);
              
              
              
              
               Fred(&bc);
              
              
              
              
               return TRUE;  
              }
              
              
              
          

          Also check your IDs, use GePrint() or step over the code to check what it is -really- doing.
          3> Changing data type won't cause any problems, all it means is when you read it back GetLong() etc. you'll end up with nothing (empty string, or 0), using Long/Real seem ok, but generally avoid changing types with the same ID.
          4> No need to read using COFFEE for debugging 😉 just use the debugger, C4D Console, or the debug console, or a file if you have lots of data to log 🐵

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

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

            On 08/02/2003 at 01:37, xxxxxxxx wrote:

            1> A container can not be "full", unless you run out of memory, and that is -very- unlikely.
            --------------------------
            good. 🙂
            --------------------------
            2> a bit more information might help us 😉 how are you passing your container, when do you set the data, where are you reading it and how. A quick example test:
            --------------------------
            No, already checked the passing. Everythings correct.
            -------------------------

            Also check your IDs,
            -------------------------
            Boom, here it is. I somehow did change the IDs before in my resource files! It works now. Had another copy in my external dependencies that was already correct, but in my pluginfolder it was wrong...tzztzztzz 🙂
            -------------------------
            3> Changing data type won't cause any problems, all it means is when you read it back GetLong() etc. you'll end up with nothing (empty string, or 0), using Long/Real seem ok, but generally avoid changing types with the same ID.
            -------------------------
            Well, when you asign another type like Real and read it back with GetLong you will end up with a Long value instead of a Real. i.e. 1.367 will give you just 1. But that was clear before.
            -------------------------
            4> No need to read using COFFEE for debugging 😉 just use the debugger, C4D Console, or the debug console, or a file if you have lots of data to log 🐵
            -------------------------
            Always the debugger. It´s the best way for me to develop.
            Thanks guys.
            Best
            Samir

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