i'm trying to come up with a script here for a game engine... the overall idea is that we have ton of trees that will be instanced throughout the scene from one asset in-game. in order to provide spawn points for the trees to snap to, we want to create a mesh of vertices according to a tree layout scene in maya, then export it to a game asset, and i'm trying to write a mel script to do it for us (just the mesh creation)...
here's the basic pseudocode i think we need to follow:
-select all objects in scene
-ls -sl all trees into an array
-for each tree in trees, find & store world space pivot, create vertex, assign vertex to world space pivot
it sounds pretty simple but the thing that i'm getting stuck on is 1st how to GET the worldspace pivot (is it the same as the tx ty tz if the mesh hasn't had freeze transforms done to it?), and secondly (bigger problem) how to create a single vertex. my idea thus far has been to create a cv for each, assign them all to a group after the for loop completes, then i would have to go back and convert all the cv's to poly. that's not such a big deal but it seems extraneous, is there a way to just create 1 vertex?
thanks for helping in advance.