Everything but the Sapling Tree is generated at the 3d cursor. I need to create and configure the tree at a specific location and I can't move my scene due to it being geo-referenced.

Any ideas?


Blender version: 2.79 Build, 2017-09-11

Sapling version 0.3.3

  • 1
    $\begingroup$ Move the tree afterwards $\endgroup$ Feb 5 '18 at 16:51
  • $\begingroup$ You can't change the properties of the tree after you move it though, no? $\endgroup$
    – yam
    Feb 5 '18 at 17:08
  • $\begingroup$ No you cannot. Only workaround I can think of is to create a group instance of your whole scene and place it such that the place were the tree should stand is located at the world 0,0. Make a separate temporary scene if necessary $\endgroup$ Feb 5 '18 at 17:12
  • $\begingroup$ can you detail which blender version and which addon version? Here I have a 2.76b with "Sapling" addon 0.2.6 and it creates the tree at the 3d cursor, exactly. $\endgroup$
    – m.ardito
    Feb 5 '18 at 20:26
  • 1
    $\begingroup$ @DuarteFarrajotaRamos idk, here it works as said above... never used this addon before, though. I just added an answer to properly share a gif that shows my sapling behaviour... $\endgroup$
    – m.ardito
    Feb 5 '18 at 23:57

This started not as a real and proper answer, but to demonstrate that at least on 2.76b, with Sapling 0.2.6, sapling addon worked as you would expect:

enter image description here

So, I suggested you to detail exact blender and sapling versions you are trying. It could also be a bug or a changed behavior...

Meanwhile, I found a 2.79rc2 lying on my disk, so tried also launching Blender-softwaregl (opengl sw emulation due to my crappy notebook), here the addon is named "Sapling Tree Gen", version 0.3.3, it behave like you said: the tree is always at grid origin, no matter where the 3d cursor is.

It seems that there was a big change from 0.2.6 to 0.3.2 labeled as a "major rewrite", I guess starting just before 2.78 release, see this diffusion page.

But, good news! Browsing the sources on that page, I found a single line that reverts the behavior of sapling 0.3.3 to how it was in 0.2.6

  1. find the file <blender install folder>/2.79/scripts/addons/add_curve_sapling/utils.py

  2. go to line 1604, it should be like

    #treeOb.location=bpy.context.scene.cursor_location attractUp

  3. change it to

    treeOb.location=bpy.context.scene.cursor_location #attractUp

  4. save the file

  5. (if it was open, close and) start Blender
  6. now sapling should behave as it did in 2.76 :)

enter image description here

Note: I've later found a comment by the addon developer stating that he did "Fix Armature, Tree location generation to 0,0,0 (this was causing fails with armature weights & probably pruning)"

So, use this with caution, and revert if necessary...

  • $\begingroup$ Indeed 2.76 does add at the cursor, but 2.79 does not. I don't use Sapling that often, but I suspect most versions I tested ever since stopped adding it at cursor position. Not sure if it is a bug or some intentional change, given the addon received at least one update since then. $\endgroup$ Feb 6 '18 at 0:09
  • 2
    $\begingroup$ @DuarteFarrajotaRamos I found and fixed (see update answer) a single line in the new script that didn't copy the cursor location as starting point for the tree generation... maybe the author made a small mistake commenting that line, who knows... now it works on 2.79 :) $\endgroup$
    – m.ardito
    Feb 6 '18 at 1:01
  • 1
    $\begingroup$ That is great, many thanks for the fixing instructions. Probably worth reporting a bug, or submitting a patch for that, no? Anyway great find. (Made a few edits to improve readability) $\endgroup$ Feb 6 '18 at 1:18
  • 1
    $\begingroup$ Thx for fixing, it was past 2am on my tz :D it is really just a typo probably, but I'll try to submit a report at least. $\endgroup$
    – m.ardito
    Feb 6 '18 at 8:33
  • 2
    $\begingroup$ @DuarteFarrajotaRamos I've found this comment developer.blender.org/T46559#370757 that states that "fixing" the tree generation at 0,0,0 was intentional, due to some possible issues "Fix Armature, Tree location generation to 0,0,0 (this was causing fails with armature weights & probably pruning)"... I guess there could be a workaraound, I'll try to suggest it there maybe, but use the above fix with caution... $\endgroup$
    – m.ardito
    Feb 6 '18 at 12:01

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.