Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Copy Shader tree from mat1 to mat2

    SDK Help
    0
    14
    1.2k
    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
      Helper
      last edited by

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

      On 02/05/2007 at 09:57, xxxxxxxx wrote:

      Hi all,

      still is not working.

      I tried to send msg to material, to the shaders.. but still   the material preview is without the texture.
      The OpenGL preview and the vray rendering is fine.

      maybe that my material is a custom material?

      Do i set somethings inside it ?

      Cheers
      Renato

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

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

        On 04/05/2007 at 09:37, xxxxxxxx wrote:

        Any Help from SDK support?

        thanks
        Renato

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

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

          On 04/05/2007 at 10:05, xxxxxxxx wrote:

          Remember that Matthias is out for the week (until May 6) at a conference.

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

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

            On 04/05/2007 at 10:28, xxxxxxxx wrote:

            thanks Robert 🙂

            Cheers
            Renato

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

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

              On 11/05/2007 at 19:51, xxxxxxxx wrote:

              Any help?

              Cheers
              Renato

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

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

                On 15/05/2007 at 06:59, xxxxxxxx wrote:

                You have to add an EventAdd() after inserting the shader to refresh the preview. Little piece of working code:

                BaseMaterial *bm = doc->GetFirstMaterial();
                if(!bm) return TRUE;

                BaseContainer *data = bm->GetDataInstance();
                PluginShader *shd = PluginShader::Alloc(1001162);
                if(!shd) return FALSE;

                data->SetLink(MATERIAL_LUMINANCE_SHADER,shd);
                bm->InsertShader(shd,NULL);
                bm->Message(MSG_CHANGE);
                bm->Update(TRUE,TRUE);
                EventAdd();

                this loads the mandelbrot shader from the sdk examples into the luminance channel.

                cheers,
                Matthias

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

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

                  On 15/05/2007 at 23:55, xxxxxxxx wrote:

                  Hi Matthias,

                  i'm sorry but still not workin 😞

                  Cheers
                  Renato

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

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

                    On 16/05/2007 at 00:29, xxxxxxxx wrote:

                    have you called the BaseMaterial Update() function after inserting the shader?

                    cheers,
                    Matthias

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

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

                      On 16/05/2007 at 01:09, xxxxxxxx wrote:

                      Hi Matthias,

                      here my code:

                      Bool TransferShader (BaseMaterial* matStart, BaseMaterial* matDest, LONG shaderIdStart, BaseDocument *doc, LONG shaderIdDest){
                           BaseContainer *bcMatStart = matStart->GetDataInstance();
                           BaseContainer *bcMatDest = matDest->GetDataInstance();
                           PluginShader *tempShader = (PluginShader* ) bcMatStart->GetLink(shaderIdStart,doc);
                           if (tempShader){
                                PluginShader *clonedShader = (PluginShader* ) tempShader->GetClone(NULL,NULL);
                                if (clonedShader){
                                     bcMatDest->SetLink ( shaderIdDest, (BaseList2D* ) clonedShader );
                                     doc->InsertShader(clonedShader,NULL);
                                     matDest->Message(MSG_CHANGE);
                                     matDest->Update(TRUE,TRUE);
                                     EventAdd();
                                }
                           return TRUE;
                           }
                           return FALSE;
                      };

                      Cheers 🙂
                      Renato

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

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

                        On 31/05/2007 at 07:34, xxxxxxxx wrote:

                        Any Help?

                        Cheers
                        Renato

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