0
$\begingroup$

Intermediate Blender user here. I am trying to create a procedural emission shader that only effects areas of an object of a given range of thickness (i.e. if applied to a character could make the characters fingers glow - because they are thinner, but not the arms)

At the end of this stack exchange someone seems to have developed a script that can vary materals according to thickness (the Uniform Depth, script).

Get Object Width In Cycles as Value

But taking the script into textedit and copy and pasting it into the internal script function on the node doesn’t do anything, and trying to link to the file as external script returns an error! Wondering if there are any general tutorials for implementing external python scripts as nodes in materials. Will be very grateful for any help!

$\endgroup$
1
$\begingroup$

The related post you mentioned is not in Python but in OSL. In order to enable OSL you must set your render device in CPU mode and enable the Open Shading Language Option. I tried the code and it was working quite good (except the last part which crashed my machine).

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.