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. https://developer.blender.org/T96967

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 bpy.data.materials: 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 = mat.node_tree.nodes.new('ShaderNodeValToRGB') ramp.location = from_node.location ramp.color_ramp.elements[0].color = (0.0001, 0.0001, 0.0001, 1) mat.node_tree.links.new(ramp.inputs['Fac'], from_socket) mat.node_tree.links.new(node.inputs['Subsurface'], ramp.outputs['Color'])

```

(I've also added the above code to the blender bug report in case your email mangles up the formatting https://developer.blender.org/T96967)

Cheers
Michael

0 comments

Current user avatar

Previous email regarding the time saving script.

Turbo Tools Updated to version 2.1.2

Turbo Render update to 2.1.0

Turbo Tools V2 - TURBO RENDER - 2.0.6 Update available

Turbo Tools V2 - TURBO RENDER - Addon for Blender 3d. Cycles Renders up to 960x faster!!!! - updated!

See all posts from 3d illusions

Powered by