Skip to content

Instantly share code, notes, and snippets.

@Theverat
Last active March 4, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Theverat/985f1948bd934187eaa7444d0dbbd2f8 to your computer and use it in GitHub Desktop.
Save Theverat/985f1948bd934187eaa7444d0dbbd2f8 to your computer and use it in GitHub Desktop.
import bpy
roughness_sockets = 0
textured_roughness_sockets = 0
for node_tree in bpy.data.node_groups:
if not "luxcore" in node_tree.bl_idname:
continue
for node in node_tree.nodes:
if node.outputs and not node.outputs[0].is_linked:
continue
for input in node.inputs:
if input.enabled and "roughness" in input.name.lower():
roughness_sockets += 1
if input.is_linked:
textured_roughness_sockets += 1
if roughness_sockets:
print("%d roughness sockets, %d are textured (%d%%)" %
(roughness_sockets, textured_roughness_sockets,
float(textured_roughness_sockets) / roughness_sockets * 100))
else:
print("No roughness sockets")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment