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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    AliasTrans

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 617 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 19/04/2005 at 00:37, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.5/9.0 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------Hi everybody,
      Could it be that AliasTrans only works with C++? I'm writting in COFFEE and I'm trying to merge 2 Documents. Merging works, but the Key in the Animations an the links from Material to Object dosen' t work. I read in the forum that I should use AliasTrans. But I didn't find it in the SDK 9. How can merge correktly 2 documents without loosing the links?

      Greetings,
      Tim
      EastWestside Germany 😉

      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 20/04/2005 at 00:19, xxxxxxxx wrote:

        Is there no way to do this with COFFEE? I need this funktion! if i can't do it with coffee i have to wirte my plugin completly new in C++...Can someone help, please?

        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 21/04/2005 at 12:31, xxxxxxxx wrote:

          Unfortunately I'm afraid there is no AliasTrans counterpart in C.O.F.F.E.E.

          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 21/04/2005 at 12:51, xxxxxxxx wrote:

            So, there is no way to merge 2 documents with COFFEE? Can this be?

            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 21/04/2005 at 13:22, xxxxxxxx wrote:

              Fortunately enough it seems like alias translation isn't necessary for merging. All that's needed isn't to remove from one document and insert into another. This code seems to work for me: (It merges the active document with the previous or next.)

                  
                  
                    var rec = doc->GetPrev();  
                    if (!rec) rec = doc->GetNext();  
                      
                    var mat = doc->GetFirstMaterial();  
                    var tmat, pmat=NULL;  
                    while (mat)  
                    {  
                      tmat = mat;  
                      mat = tmat->GetNext();  
                        
                      tmat->Remove();  
                            println(rec); println(tmat); println(pmat);  
                      rec->InsertMaterial(tmat, pmat);   
                      pmat = tmat;  
                    }  
                      
                    var obj = doc->GetFirstObject();  
                    var tobj, pobj=NULL;  
                    while (obj)  
                    {  
                      tobj = obj;  
                      obj = tobj->GetNext();  
                        
                      tobj->Remove();  
                      rec->InsertObject(tobj, NULL, pobj);   
                      pobj = tobj;  
                    }  
                      
                    KillDocument(doc);  
                    EventAdd();  
                  
              
              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 22/04/2005 at 00:03, xxxxxxxx wrote:

                Hi Mikael,
                your code work perfekt! Thank you. Your solution is much more simple than mine. I think my mistake was it to work with Bits and clone. This was my code:
                 
                 objFile->AddLast(derpfad);
                        vDoc1=GetActiveDocument();
                        vBits=vDoc1->GetAllBits();
                        vOK=LoadDocument(objFile);
                vMat=vDoc2->GetFirstMaterial();
                        if (vMat)
                         {
                          while (vMat)
                             {
                              vDoc1->InsertMaterial(vMat->GetClone(),NULL);
                                vMat=vMat->GetNext();
                            }
                         }
                         vObj=vDoc2->GetFirstObject();
                         if (vObj)
                         {   while (vObj)
                              {
                               vDoc1->InsertObject(vObj->GetClone(0),NULL,NULL);
                                vObj=vObj->GetNext();
                             }
                         }
                         vDoc2->Remove();
                         KillDocument(vDoc2);
                         vDoc2=NULL;
                         vDoc1->SetAllBits(vBits);

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