Getting a shader



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

    On 31/05/2003 at 09:40, xxxxxxxx wrote:

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

    ---------
    How can I get what type of shader is being used inside any channel? I wrote this code (1) and it does return me the name of the shader, the name of the bitmap or nil (if no shader nor bitmap is being used). But, how can I check for what type of thing is there? How do I know if it is a shader or a bitmap?

    (1)

      
    main(doc,op)  
    {  
    var material,color,channel,shader;  
      
    material=doc->GetFirstMaterial();  
    if(!material) return;  
      
    color=material->GetChannel(CHANNEL_COLOR);  
    channel=color->GetContainer();  
    shader=channel->GetData(CH_TEXTURE);  
    println(shader->GetName());  
    }  
    

    And, if possible, how can I search for all nested shaders (for instance, inside a Fusion shader)?
    Thank you very much in advance.

    Rui Batista



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

    On 01/06/2003 at 10:18, xxxxxxxx wrote:

    Try using getclass(shader) to differentiate the cases.



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

    On 01/06/2003 at 10:19, xxxxxxxx wrote:

    I don't think nested shaders are possible to detect, since Fusion is just a C++ plugin with no public API.



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

    On 01/06/2003 at 11:59, xxxxxxxx wrote:

    Darn!!! So, how is it possible to know what shaders are used in a document?

    Rui Batista



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

    On 02/06/2003 at 01:28, xxxxxxxx wrote:

    That's not possible then.



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

    On 02/06/2003 at 02:43, xxxxxxxx wrote:

    That is a terrible limitation! Can't it be added?

    Rui Batista


Log in to reply