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

    My object import

    SDK Help
    0
    3
    273
    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

      On 31/03/2014 at 09:36, xxxxxxxx wrote:

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

      ---------
      Hi,

      I want my plugin to load, resp. import objects from dxf files. I use LoadDocument() to load the file in a new document and CopyTo to copy the object into the current document. The problem is, that materials get lost. Do I also have to copy each single material? And when, before or after copying the object and how to use then the AliasTrans? Any help is appriciated.

        
      if (fn.FileSelect(FILESELECTTYPE_SCENES, FILESELECT_LOAD, GeLoadString(IDS_L_IMPORT)))   
      {   
          tdoc = LoadDocument(fn, SCENEFILTER_OBJECTS|SCENEFILTER_MATERIALS, NULL);   
          if (!tdoc)   
          {   
              MessageDialog(IDS_FILEERROR, fn.GetString());   
              break;   
          }   
          cp = tdoc->GetFirstObject();   
          if (cp)   
          {   
              AutoAlloc<AliasTrans> aliastrans;   
              if (!aliastrans || !aliastrans->Init(doc)) break;   
              BaseObject *dp = (BaseObject * )cp->GetClone(COPYFLAGS_0, aliastrans);   
              aliastrans->Translate(TRUE);   
              if (dp)   
              {   
                  doc->InsertObject(dp, op, NULL, TRUE);   
              }   
          }   
          KillDocument(tdoc);   
      }   
      

      Btw.: How do you get rid of these space lines?

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

        On 17/04/2014 at 15:07, xxxxxxxx wrote:

        I'm not certain about your question ... there is not a single line regarding the materials in
        your code, of course they will be lost.

        Btw, the extra lines seem to be a problem with Safari Browser. Do you use Safari?

        Best,
        -Niklas

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

          On 18/04/2014 at 06:55, xxxxxxxx wrote:

          Thanks, I've not much experiences with the aliastrans and I was hoping, that it transfers attached tags.

          I'm using all browsers (I'm web developer, also) and all show these extra lines on Windows. The code lines get additional line break tags, which are needless, since the entire code is embedded in a pre (pre-formatted) tag.

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