Profile Picture3d illusions

Turbo Tools - free time saving script

Hi, hope you're well.

I sent out an email a while ago regarding a bug in Blender which in some cases can cause problems if you have SSS materials being fed by a texture or gradient.

The workaround of adding a ramp node between the texture and the principled's SSS inputs, and setting the black level to 0.0001 is pretty straightforward, but I've just had a customer who had too many materials they'd need to amend. Whilst it's not an issue with the addon, it can affect the results the addon produces, so I've written a script to automate the fix until the Blender Foundation are able to fix the underlying bug in Blender.

If you paste the below code into Blender's script editor and press the script editors play button, it will add the ramp with the necessary settings between each principled node's Subsurface input and the connected node:

import bpy for mat in if mat.use_nodes: for node in mat.node_tree.nodes: if node.type == 'BSDF_PRINCIPLED': if node.inputs[3].links: from_node = node.inputs[3].links[0].from_node from_socket = node.inputs[3].links[0].from_socket ramp ='ShaderNodeValToRGB') ramp.location = from_node.location ramp.color_ramp.elements[0].color = (0.0001, 0.0001, 0.0001, 1)['Fac'], from_socket)['Subsurface'], ramp.outputs['Color'])


(I've also added the above code to the blender bug report in case your email mangles up the formatting



Current user avatar

3d-illusions Membership - New content waiting for you!

New file available in the members download area! Avoid re-rendering by quickly adding new textures, dirt, bumps and even shadows AFTER rendering.

Turbo Tools V3 - Updated to Version 3.0.2!

Membership - YouTube Scene files, Paid content for free, Member Exclusives + lots more! - updated!

Turbo Tools V3 - Huge Feature update, now with Temporal Stabilizer and much more!

See all posts from 3d illusions

Powered by