I'm still new to coding but I'm trying to convert a test project to python code so that way I can generate a nested geonode tree within an existing geonode.
Test:
Create a new geometry node tree, add another node, (any node will do), then group that node to create a nested node tree within the original geometry node named Main Geo Tree. I'm grateful that I found a way to generated the python script so I understand each line of code better, but I'm trying to figure out how to organize the code given below to allow the script to run. I'm trying to generate this within python to help my workflow a bit more rather than having to rebuild an entire geometry node tree from scratch.
Images above are of the main and sub node tree layouts. The code below is what NodeToPython generated for me based on
my test nodes. If anyone can help me understand this or help solve this issue I'd greatly appreciate the help. Thank you in advance!
I'm still new to coding but I'm trying to convert a test project to python code so that way I can generate a nested geonode tree within an existing geonode.
Test: Create a new geometry node tree, add another node, (any node will do), then group that node to create a nested node tree within the original geometry node named Main Geo Tree. I'm grateful that I found a way to generated the python script so I understand each line of code better, but I'm trying to figure out how to organize the code given below to allow the script to run. I'm trying to generate this within python to help my workflow a bit more rather than having to rebuild an entire geometry node tree from scratch.
Images above are of the main and sub node tree layouts. The code below is what NodeToPython generated for me based on my test nodes. If anyone can help me understand this or help solve this issue I'd greatly appreciate the help. Thank you in advance!
initialize joined_geo node group
def joined_geo_node_group(): joined_geo = bpy.data.node_groups.new(type = 'GeometryNodeTree', name = "Joined Geo")
joined_geo = joined_geo_node_group()
initialize main_geo_tree node group
def main_geo_tree_node_group(): main_geo_tree = bpy.data.node_groups.new(type = 'GeometryNodeTree', name = "Main Geo Tree")
main_geo_tree = main_geo_tree_node_group()