basechannel



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

    On 25/10/2006 at 08:23, xxxxxxxx wrote:

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

    ---------
    Is it possible to retrieve the texture *filename* applied to a material's basechannel? (i.e. the filename of the texture applied in the color channel)

    thanks!



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

    On 25/10/2006 at 09:42, xxxxxxxx wrote:

    Yes:

    // Get Color Channel
    BaseChannel* bchan = mat->GetChannel(CHANNEL_COLOR);
    if (!bchan) continue;
    // Extract full image file path
    Filename suggestedFolder =     bchan->GetData().GetFilename(BASECHANNEL_SUGGESTEDFOLDER);
    String map = bchan->GetData().GetString(BASECHANNEL_TEXTURE);
    Filename fullpath = suggestedFolder + Filename(map);



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

    On 25/10/2006 at 09:51, xxxxxxxx wrote:

    works perfectly ;) thanks!



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

    On 26/10/2006 at 01:52, xxxxxxxx wrote:

    hmm, i've found out that my current code:

    **
    // Extract full image file path
    String map = pChannel- >GetData().GetString(BASECHANNEL_TEXTURE);
    if (map.GetLength() == 0) return FALSE;

    Filename suggestedFolder = pChannel->GetData().GetFilename(BASECHANNEL_SUGGESTEDFOLDER);
         
    if (suggestedFolder.GetString().GetLength() == 0)
    // same as the document
         suggestedFolder = pDoc->GetDocumentPath();

    Filename fullpath = suggestedFolder + Filename(map);
    **

    fails to retrieve the right path when the map is located within a subfolder of the main scene location (i.e. on c4d samples, textures are usually located in a 'tex' subfolder).

    This code nevertheless is working fine:

    **
    Filename path;
    GenerateTexturePath(pDoc- >GetDocumentPath(), Filename(pChannel->GetData().GetString(BASECHANNEL_TEXTURE)),
    Filename(), &path;)               
    **

    cheers



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

    On 26/10/2006 at 04:33, xxxxxxxx wrote:

    I clear the suggestedFolder when the texture is made local (wrt the c4d document). When the texture is elsewhere, suggestedFolder has the path to the texture. Should have mentioned that - sorry. :S


Log in to reply