I'm sure you've all had enough of me by now, but I need to get this working, so I'm just going to power through.
Is there a way to get this:
into my addon menu?
Ideally it should be hidden by default, and activate with this bool:
mat = bpy.data.materials["Skin"]
nodes = mat.node_tree.nodes
curve = bpy.data.materials["Skin"].node_tree.nodes["DarkCurve"]
BSDF = bpy.data.materials["Skin"].node_tree.nodes["Principled BSDF"]
mainmix = bpy.data.materials["Skin"].node_tree.nodes["MainMix"]
def dark_switch(self, context):
for tex in bpy.data.materials:
if (self.my_bool == True):
#print ("Property Enabled")
mat.node_tree.links.new(curve.outputs[0], BSDF.inputs[0])
bpy.data.materials["Skin"].node_tree.nodes["DarkLight"].blend_type = 'LIGHTEN'
else:
#print ("Property Disabled")
mat.node_tree.links.new(mainmix.outputs[0], BSDF.inputs[0])
bpy.data.materials["Skin"].node_tree.nodes["DarkLight"].blend_type = 'DARKEN'
# ------------------------------------------------------------------------
# Scene Properties
# ------------------------------------------------------------------------
class MyProperties(PropertyGroup):
my_bool: BoolProperty(
name="DarkSkin",
description="Tick for Dark Skin",
default = False,
update = dark_switch
)
Which I figured out yesterday, and works perfectly for what it currently does.