Created
March 15, 2017 15:10
-
-
Save zeffii/21f1d403d44cbd998a808928ad5a5dc1 to your computer and use it in GitHub Desktop.
reverse lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def get_socket_from_input(idx, NodeGroup, parent_material): | |
for n in parent_material.node_tree.nodes: | |
if n.bl_idname == "ShaderNodeGroup" and n.node_tree == NodeGroup: | |
return n.inputs[idx].links[0].from_socket | |
custom_ng = bpy.data.node_groups['NodeGroup.001'] | |
t = get_socket_from_input(0, custom_ng, bpy.data.materials['Material']) | |
print(t) |
Secrop
commented
Mar 15, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment