Melange: Materials, Channels, Texture Names



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

    On 18/10/2011 at 03:53, xxxxxxxx wrote:

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

    ---------
    Hey!

    Edited because of curiosity reasons:

    I'm writing an importer for C4D files for our tool. These C4D files can have channels for COLOR, SPECULAR, NORMAL and REFLECTION. I am not sure however what the best way is to get the name of these texture files, and their accompanying type.

    I can test all shader types and get, whatever maps are defined, a number of different textures. However, i can't match the file names and their desired channel. I am probably doing something wrong here... thus i don't now if asdf.png is a normal map or a spec map (for example)

    Ah, and when i e.g. test for the Normal channel that is enabled in C4D - i  get a false result. All other checkboxes are returned correctly.

    Really looking for pointers.... :(

    Thanks!



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

    On 19/10/2011 at 03:07, xxxxxxxx wrote:

    Textures (bitmaps) are handled through the bitmap shader in C4D materials. Retrieve the bitmap shader with the Material class' GetShader method (pass the ID of the channel). Check if it contains a path to the bitmap with the BaseShader class' HasContent method. If so retrieve the path with GetFileName.

    cheers,
    Matthias



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

    On 20/10/2011 at 01:45, xxxxxxxx wrote:

    Matthias,

    thanks for your help. So i basically pass the shader according to the channel i need, and get all data? that's like i did it. I was a bit confused however, as GetChannelState(CHANNEL_NORMAL) is false, but a normal map is present....

    Thanks



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

    On 17/11/2011 at 07:35, xxxxxxxx wrote:

    Hello,

    I have a same problem. I have a BaseShader where a texture is inside. And I like to know the filename of this texture. But I don't see a function to get the filename. With shd->GetName() I got always "Bitmap" back ?



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

    On 17/11/2011 at 08:04, xxxxxxxx wrote:

    The filename of the texture is in the shader's container. So if you have a BaseShader 'shd':

    BaseContainer *shddata = shd->GetDataInstance(); 
    Filename fname = shddata->GetFilename(BITMAPSHADER_FILENAME);
    

Log in to reply