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
    • Recent
    • Tags
    • Users
    • Login
    The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.

    SetParameter doesn't work on node

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 427 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

      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 Offline
        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 Offline
          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