Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    COFFEE does not recognize my element id

    SDK Help
    0
    8
    632
    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 28/07/2007 at 12:56, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R10 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;  C++  ;

      ---------
      Hi,
      I have a string element in my SDK ObjectData plugin which I set with:

        
      data->SetString(AIMAP_STRING, "string data");  
      

      but my coffee script does not recognize AIMAP_STRING:

        
      var str = obj#AIMAP_STRING;  
      

      Is it possible to access this element with coffee?
      what do I need to do?

      thanks

      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 28/07/2007 at 14:33, xxxxxxxx wrote:

        Maybe try:

        var data = obj->GetData();
        var str = data->GetString(AIMAP_STRING); //(or maybe obj#AIMAP_STRING).

        I don't use COFFEE often enough to give a definitive answer on that part.

        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 28/07/2007 at 15:07, xxxxxxxx wrote:

          this should work.

          main(doc, op)
          {
          doc = GetActiveDocument();
          op = doc->FindObject("MyObject");

          var str = op#AIMAP_STRING;
          println(str);
          }

          hope I did not make a typo!

          frank

          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 28/07/2007 at 19:30, xxxxxxxx wrote:

            no luck both cause an exception.
            on this code as early as var data = cobj->GetData();
            😞

              
            try{  
                      var data = cobj->GetData();  
                      if(data) {  
                           println("data ok");  
                      }  
                      var str = data->GetString(AIMAP_STRING);  
                      if(str) {  
                           file->WriteString(str);  
                      } else {  
                           println("empty string");  
                      }  
                      println("aimap data found");  
                 }  
                   
              
                 catch(ExLastException){  
                      println("aimap data not found");  
                 }  
            
            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 29/07/2007 at 10:07, xxxxxxxx wrote:

              This worked well 🙂

                
              var AIMAP_STRING = 10001; // container id in SDK  
              var bc = cobj->GetContainer();  
              var str = bc->GetData(AIMAP_STRING);  
              
              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 29/07/2007 at 11:48, xxxxxxxx wrote:

                I think the problem is that your plugin ids are private - not general resources from c4d_symbols.h - which is how it's suppose to be. But that means that a COFFEE script won't have any idea what your plugin id enums are. So you'll probably have to do what you did or #include the resource header in the COFFEE script.

                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 30/07/2007 at 05:12, xxxxxxxx wrote:

                  It seems there is a problem with the COFFEE symbol cache. What happens if you delete the "coffeesymbolchache" from the prefs folder? It should read your custom ID names then.

                  cheers,
                  Matthias

                  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 31/07/2007 at 09:02, xxxxxxxx wrote:

                    thanks so much both solutions worked, just that the header file solution needs modification e.g remove C++ compiler directives which coffee does not understand.

                    but the real solution was to clear the coffeesymbolchache. 🙂
                    coffeesymbolchache does not seem to be present on R9 so in that case the header should work.

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