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

    Activate/Deactivate Material Channel

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 645 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 26/03/2008 at 04:51, xxxxxxxx wrote:

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

      ---------
      Hi all.

      I want to generate a material and switch off the specular channel which is on by default. How can I do that?

      > \> BaseContainer \*cont= mat->GetDataInstance(); \> cont->SetLong(MATERIAL_USE_SPECULAR, 0); \> mat->Message(MSG_UPDATE); \> EventAdd(); \>

      The above code does not work, no matter if I use SetLong or Set Bool. When I print the IDs from that container
      using cont->GetIndexId() the ID 2009 (MATERIAL_USE_SPECULAR) does not exist.
      Any ideas? Thanks in advance...

      Yakuza

      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/03/2008 at 05:18, xxxxxxxx wrote:

        Try this:

        > mat->SetChannelState(CHANNEL_SPECULAR, FALSE);

        Oh, and if you want to change parameters of materials:

        > BaseContainer matData = mat->GetData();
        > matData.SetReal(MATERIAL_TRANSPARENCY_REFRACTION, 1.56);
        > mat->SetData(matData,TRUE);
        >
        > mMat->Update(TRUE,TRUE);      //UPDATE THUMBNAIL
        > mMat->Message(MSG_UPDATE);

        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/03/2008 at 05:35, xxxxxxxx wrote:

          omg, that's simple 🙂
          i didn't find this in the documentation because i only looked in BaseMaterial and Channel 😕

          thank you very much!

          Yakuza

          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 19/01/2009 at 08:59, xxxxxxxx wrote:

            i tried using:

            mat->SetchannelState(channel_SPECULAR, FALSE); but got the following

            error C2039: 'SetChannelState' : is not a member of 'BaseMaterial'

            it would appear by yakuza's most recent statement that it is? how can one deactivate the specular?

            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 19/01/2009 at 10:31, xxxxxxxx wrote:

              The 'mMaterial' is of type Material which is a subclass of BaseMaterial. So *downcast* it(if possible and allowed) and try it again.

              If yu take a look at the SDK Documentation, you see that GetChannelState is just a member of Material and not of BaseMaterial.

              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 19/01/2009 at 16:12, xxxxxxxx wrote:

                it seems a little unintuitive for something that affects materials to not be readily available within BaseMaterial. i will look into downcasting, if possible.

                does anyone else have another alternative?

                thanks, shawni

                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 19/01/2009 at 16:37, xxxxxxxx wrote:

                  It is not unintuitive at all. A plugin material for instance can have a completly different structure than Cinema's standard material. In case of a plugin material you work with the material's description elements directly.

                  cheers,
                  Matthias

                  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 19/01/2009 at 16:59, xxxxxxxx wrote:

                    stand corrected.

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