I created a terrain in blender (using Blender 2.78 cause I’m poor and my system was made around the time of Christ lol). I created a bunch of empty dupli nodes and now I want to fill those nodes with my tree models…keeping it simple and using just one model.
Here is my issue. Besides being new to programming in general( I’m a systems engineer did mostly server scripting and a few small programs to work with AS/400 and the such) I am not sure how to run a loop to check for each empty node since they are names like empty.001, empty.002…etc. I know Im going about this wrong or least proficient way but this is how I have added the trees before:
treePos= self.environ.find ("**/Empty.001").getPos()
tree = loader.loadModel("env/trees/simplepine")
tree.reparentTo(render)
tree.setPos (treePos)
treePos2= self.environ.find ("**/Empty.002").getPos()
tree2 = loader.loadModel("env/trees/simplepine")
tree.reparentTo(render)
tree.setPos (treePos2)
But I really dont want to add the other 76 this way lol. How do you code it to check the .egg file for each instance of the empty and the add the object to the empty node? Been cracking my head over this for a bit.