SetMaterial



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/10/2010 at 12:59, xxxxxxxx wrote:

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

    ---------
    Hello, bit of a newbie question but I'm trying to take a material and apply it to a texture tag. I can only seem to get it to apply and empty texture.  Here is how I'm going about it:

      
      var p = doc->FindObject("qPlane");  
      var m = doc->GetFirstMaterial();  
      
      
      var mTag = new(TextureTag);  
      var mMarker = m->GetMarker();  
      
      mTag->SetMaterial(mMarker);  
      p->InsertTag(mTag);  
      
    

    thanks



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 27/10/2010 at 05:13, xxxxxxxx wrote:

    This seems to work:

      
    var op = doc->GetFirstObject();  
    var mat = doc->GetFirstMaterial();  
    var marker = mat->GetMarker();  
    var ttag = AllocTag(Ttexture);  
      
    op->InsertTag(ttag,NULL);  
    op->Message(MSG_UPDATE);  
      
    ttag->SetMaterial(marker);  
    ttag->Message(MSG_UPDATE);  
      
    EventAdd();  
    

    cheers,
    Matthias


Log in to reply