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

    SetParameter doesn't work on node

    SDK Help
    0
    3
    419
    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

      On 29/08/2017 at 03:27, xxxxxxxx wrote:

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

      ---------
      Hello.

      I have a ShaderData plugin in which user can click a button to add dynamically shaderlink parameters to it:

      BaseContainer texture_cont = GetCustomDataTypeDefault(DTYPE_BASELISTLINK);
      texture_cont.SetString(DESC_NAME, "Texture");
      texture_cont.SetLong(DESC_CUSTOMGUI, CUSTOMGUI_TEXBOX);
      texture_cont.SetBool(DESC_SHADERLINKFLAG, TRUE);
      description->SetParameter(texture, texture_cont, group );
      

      This one works fine.

      I have another button that allows to add Xnoise shader parameters.
      I create an Xnoise shader and I insert the shader in the document doc->InsertShader(xnoise_shader);
      I do that in the button's MSG_DESCRIPTION_COMMAND on Message call.

      The problem is that I don't see the shader. 
      It appears that I cannot set the link to a dynamically added shaderlink parameter (I have tested the same code in a static shaderlink parameter defined in a description res and it works fine).

      Thank you for your time.

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

        On 30/08/2017 at 01:50, xxxxxxxx wrote:

        Hello,

        could you please post the complete code you use to insert and link the shader?

        In your message above you mention that you insert the shader into the document. This is not how you handle shaders. A new shader instance is typically inserted into the host material (or in your case the host shader). You find examples on how to create and insert shaders in the BaseShader Manual.

        best wishes,
        Sebastian

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

          On 30/08/2017 at 23:54, xxxxxxxx wrote:

          Hello.
          Adding the shader in the parent shader solves the problem.
          Thank you for your help.

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