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

    Terra4D-Terrains: Not enough memory!

    SDK Help
    0
    3
    297
    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 17/06/2004 at 13:25, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hello,

      Terra4D is an open source plugin to combine Terragen with Cinema4D. Unfortunately it's impossible to import terrains from Terragen which are larger than 1024. It seems that there isn't enough memory to create such a big polygonobject.

        
      // procedures  
      ///////////////////////////  
        
      CreatePolygonObject(pointcount, polygoncount)  
      {  
           if (pointcount <= 0 || polygoncount <= 0) return FALSE;  
        
           var obj = new(PolygonObject);  
           var points = new(array, pointcount);  
           var polygons = new(array, polygoncount*4);  
        
           obj->SetPoints(points);  
           obj->SetPolygons(polygons);  
        
           var vc = new(VariableChanged);  
           var bt = new(BackupTags);  
        
           bt->Init(obj);  
           vc->Init(0, pointcount);  
           if (!obj->Message(MSG_POINTS_CHANGED, vc))  
           {  
                bt->Restore();  
                return FALSE;  
           }  
        
           bt->Init(obj);  
           vc->Init(0, polygoncount);  
           if (!obj->Message(MSG_POLYGONS_CHANGED, vc))  
           {  
                bt->Restore();  
                return FALSE;  
           }  
             
           obj->Message(MSG_UPDATE);  
           return obj;  
      }  
        
        
        
        
        
      // main  
      ///////////////////////////  
        
      main(doc,op)  
      {  
           var obj = CreatePolygonObject(1, 2049*2049);  
           obj->SetName("Test");  
           doc->InsertObject(obj, NULL, NULL);  
      }  
      

      The problem is the following command:
      var polygons = new(array, 2048*2048*4);

      I think COFFEE can't handle such big objects. But is there a workaround or something like that?

      Thank you very much,
      Janos Menberg

      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 17/06/2004 at 19:17, xxxxxxxx wrote:

        I don't think you need to set the polygon and point arrays in the function. The VariableChanged step should be enough; C4D will initialize the point and polygon arrays itself.

        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 18/06/2004 at 02:37, xxxxxxxx wrote:

          Mikael, thank you very much!

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