Material Keys



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

    On 17/08/2004 at 09:04, xxxxxxxx wrote:

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

    ---------
    Hey
    I'm trying to get my plugin to key frame the changes in a texture tag. I'm just wondering how do I access the "Material" property of a data key on a material track?
    Thanks



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

    On 18/08/2004 at 00:42, xxxxxxxx wrote:

        
        
        GeData d;  
        key->GetParameter(DescID(DATAKEY_VALUE), d, 0);  
        BaseMaterial* mat = static_cast<BaseMaterial*>(d.GetLink(doc, Mbase));
    


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

    On 18/08/2004 at 09:34, xxxxxxxx wrote:

    Thanks a lot for the quick reply. I guess I was hoping for the code to set the material property for the data key. I tried using:

        
        
          
        //material is a BaseMaterial which is parameter passed in  
        GeData d = GeData(material->GetData());  
        key->SetParameter(DescID(DATAKEY_VALUE), d, DESCFLAGS_DONTCHECKMINMAX);  
        
    

    It doesn't appear this works. Any ideas on what's wrong? Or is there a better way of doing this?



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

    On 18/08/2004 at 10:32, xxxxxxxx wrote:

    GetData() returns the data container, not a GeData. You need to create a BaseLink and send in a GeData with that to SetParameter() :

        
        
        AutoAlloc<BaseLink> link;  
        link.SetLink(material);  
        key->SetParameter(DescID(DATAKEY_VALUE), GeData(link), 0);
    


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

    On 18/08/2004 at 10:52, xxxxxxxx wrote:

    Thanks a lot Mikael! Works perfectly after a few small modifications. Here's what I had to change if anyone's interested:

        
        
          
        AutoAlloc <BaseLink> link;  
        link->SetLink(material);  
        key->SetParameter(DescID(DATAKEY_VALUE), GeData(link), DESCFLAGS_DONTCHECKMINMAX);  
        
    

    Thanks again


Log in to reply