Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    basechannel

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 429 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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);

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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!

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post