On 05/05/2015 at 03:11, xxxxxxxx wrote:
Hi Joey,
thanks for your help!
To keep it simple, I wrote a small pseudo code.
At the validation point inside the Plant class c4d assigns a hexadecimal index to the instances.
I want to assign those indices by myself according to their position in space, age and other attributes,
in order to store them in a hyperfile.
Later on I want to access the hyperfile and modify the Instances.
For example bend them if the wind is blowing from the west, that the "west plants" are more influenced.
Hope you can catch the drift?
Please let me know if you need more information.
Thanks in advance
Martin
#______________________________________
Pseudocode plant distribution:
Plantclass:
def init: with plant specific attributes(e.g. index, is valid, place to be, next possible places[npp])
def TestSpace() :
return if plant is placed or not valid
testing the next possible places to live in
for next possible places:
if place is valid:
place actual plant
built Plantclass instances for next possible places
instance.TestSpace() #recursively call
Forestclass:
placedplants = []
def init: with calling TestSpace from a certain start point plant.
with calling Collect(start point plant)
def Collect(self,spp) :
if plant is placed:
Forestclass.placedplants.append(plant)
for n in spp.npp:
if n != None:
Forestclass.Collect(n)#recursively call