Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 06/03/2017 at 08:08, xxxxxxxx wrote:
I am having problems filling both channels of the fusion shader with python.
What I am trying to achieve is: - Take the existing shader, if any, from the colour channel. - Create a fusion shader - Insert a colour shader in the blend channel - Insert the original shader in the base channel - Insert the fusion shader into the colour channel
I can add the colour shader & update the material with the fusion shader but when I try to add the original shader to the base channel I get the message:
"AssertionError: Found next objects. Please add them seperately"
I guess it is a syntax problem.
Here is a synapsis of my code:
existing_shader = mat[c4d.MATERIAL_COLOR_SHADER] col_shader = c4d.BaseList2D(c4d.Xcolor)
fusion_shader = c4d.BaseList2D(c4d.Xfusion)
fusion_shader[c4d.SLA_FUSION_BLEND_CHANNEL] = col_shader fusion_shader.InsertShader(col_shader) fusion_shader.Message(c4d.MSG_CHANGE)
if existing_shader: fusion_shader[c4d.SLA_FUSION_BASE_CHANNEL] = existing_shader fusion_shader.InsertShader(existing_shader) fusion_shader.Message(c4d.MSG_CHANGE)
mat[c4d.MATERIAL_COLOR_SHADER] = fusion_shader mat.InsertShader(fusion_shader) mat.Message(c4d.MSG_CHANGE) mat.Update(True, True)
The error is for th eline:
fusion_shader.InsertShader(existing_shader)
On 07/03/2017 at 01:11, xxxxxxxx wrote:
Hello,
any GeListNode can only be part of one single list. Before insertion into a new list, you need to remove it from the old list (existing_shader.Remove()).
On 07/03/2017 at 01:41, xxxxxxxx wrote:
Thanks Andreas, works perfectly, I understand better now.