Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Inserting shader into Shaderlink [SOLVED]

 Post Reply Post Reply
Author
Message
salozo View Drop Down
Member
Member


Joined: 2014 Mar 26
Online Status: Offline
Posts: 109
Post Options Post Options   Quote salozo Quote  Post ReplyReply Direct Link To This Post Topic: Inserting shader into Shaderlink [SOLVED]
    Posted: 2017 Aug 09 at 2:53am

User Information:

Cinema 4D Version:   14+ 
Platform:   Windows  ; Mac  ;  
Language(s):     C++  ;   

---------

Hello,

In my object generator plugin, I have a shaderlink as a description parameter.
I would like to click on a button that inserts a shader into that shaderlink.

In the button Message, I tried using the following:

AutoAlloc<BaseShader> shader1(Xcolor);
BaseContainer* bc = op->GetDataInstance();
bc->SetLink(MY_SHADER_LINK_ID, shader1);

Obviously it does not work. 
I know how to set a shader in a material, but I would like to be able to set in an independent shaderlink.

Thanks!


Edited by salozo - 2017 Aug 09 at 6:38am
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: France
Online Status: Offline
Posts: 306
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 09 at 6:11am
The shader have to belong to a BaseList2d so you have to insert it using YourObject.InsertShader
For more information take a look at https://developers.maxon.net/docs/Cinema4DCPPSDK/html/class_base_list2_d.html#ab92ca1997b2f1e2b879c1e3f18cd01ed
Technical lover.
Aviable for job in october.
Back to Top
salozo View Drop Down
Member
Member


Joined: 2014 Mar 26
Online Status: Offline
Posts: 109
Post Options Post Options   Quote salozo Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Aug 09 at 6:37am
Thank you for your answer gr4ph0s. I was missing MyObject->InsertShader. 
It works now.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.