On 08/11/2017 at 09:38, xxxxxxxx wrote:
MAXON's SDK Team can't do any development for you (maybe I should have mentioned earlier on).
So I can only provide you with some hints and starters, where to look in the SDK, but I can't deliver answers on algorithmic questions, like your tree distribution or scaling. But on the other hand I'm sure someone in our community might be able to help here.
You might get pretty far with a Python Generator, at least for a proof of concept. An even better solution would be implementing your own ObjectData plugin. So maybe you want to prototype with a Python Generator and then later on port it into an ObjectData (basically the main function of the Python Generator maps to GetVirtualObjects() of an ObjectData plugin).
The trees, are they hard coded or is there some kind of parameter (e.g. link to an object or a filename parameter and loaded from a file, in ObjectData case maybe as input object)?
In any case, in main() (Python Generator) or GetVirtualObjects() (ObjectData) you will create a Null object as parent and then clones of the tree template object will be inserted under the Null object. Finally the parenting Null object gets returned.
Scaling and positioning of your trees is just a matter of modifying the global matrix of your tree clones.
The Python Generator has the drawback, that you only have the "GetVirtualObjects() part" of an ObjectData plugin. So you need to do the parsing of your input data directly in there, whereas in a dedicated plugin you could implement SetDParameter() and do the parsing only as a reaction to the user setting a different data set (well, even in the Python Generator there's a way to achieve something like this by implementing Message() but that probably leads to far for now). Definitely something to consider for performance reasons.
Parameters, like filename of your data set: For a Python Generator User Data will do the trick (see for example this thread on how to access user data), for an ObjectData plugin you certainly want to take a look at resource files (link to C++ docs, but really all about parameter description resources, no C++ knowledge needed).
To get an idea of an ObjectData, which can probably quite easily be modified for your needs, take a look at the Py-RoundedTube example.