AliasTrans



  • 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 ;-)



  • 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?



  • 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.



  • 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?



  • 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();  
        
    


  • 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);


Log in to reply