Post #2136: I don’t have AN installed, but judging from your external script you can replace
📋 Metadata
- Author: iceythe
- Date: 2019-03-28 21:03:12
- Type:
answer - Quality Score: 7/10
- Reply to: post_02135
🏷️ Tags
macro scripting intermediate solved
⚙️ Related PME Features
- Python Scripting
- Macro Editor
💬 Content
I don’t have AN installed, but judging from your external script you can replace:
myTree = C.material.node_tree
Then on the rest of the code omit bpy.data.node_groups['Pop ups'] and use:
my_node = myTree.nodes.new('SomeNode')
Edit:
Quick example that adds an image node to the active material:
from bpy import context
ntree = context.material.node_tree
image_node = ntree.nodes.new('ShaderNodeTexImage')
image_node.location.y = 400
❤️ 1 likes