2
$\begingroup$

I'm working on a recursive fractal where a hand splits into 5 new hands, much like this: current fractal

but my node setup looks like this:

crazy mess

each of the 2 huge groups on the bottom is for just 1 level of recursion. Since the addon seemingly doesn't allow objects to be instanced inside subprograms, you can see at the top I have to output each new hand, instance it outside the group and pass it to the next level. That means, if I wanted to add another level, I would have to output all 25 individual hands, and exponentially more each level. Please, someone tell me there's an easier way to do this. Here's the .blend file if you want to take a closer look:

www.mediafire.com/?vso1h3wk68jjmpt (just copy-paste it, my rep isn't high enough for >2 links in 1 post)

$\endgroup$
2
$\begingroup$

You can use a script as workaround, so that AN cannot see that you create object instances in a subprogram:

enter image description here

Using scripts is the same way as all subprograms in AN. For script:

  • Add a text
  • Write the script, identifying the variables that will be inputs and output
  • Set these parameters adequately in the script node

But, a big warning: be careful about the frame changes as it could generate a lot of objects.

If this is happening, you can use some script to apply in Python console, like:

for m in [m for m in bpy.data.meshes if m.users == 0]: bpy.data.meshes.remove(m)

$\endgroup$
0
$\begingroup$

Short Answer: No (or not yet). Currently, this is a known limit.

However, you can try slicing a long list into lists by using tricks in the example setup below:

enter image description here

Actually I tried to make a similar setup for making fractals:

enter image description here enter image description here

(compatible with AN v1.6)

Advantage here is that the iteration is unlimited (depending on your PC performance), while no extra nodes needed.

To use, simply tweak those nodes at the top, which are out of any frames.

$\endgroup$
  • $\begingroup$ Where do the vectors that determine the transformation of the branches come from? $\endgroup$ – Jackson Roberts May 1 '17 at 12:09
  • $\begingroup$ There is an object called "Branch Tips (should better be called Branch Landing Points maybe?)" in the 2nd scene layer. I just separated the five faces at each finger tip apart, then used the face center location as branch loc, and convert face normal vector to branch rotation. Kind of a quick and dirty way though. $\endgroup$ – Leon Cheung May 1 '17 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.