Tree Editor… now with save and load!

I was set to work a bunch on this tonight but then remembered I have to be up early in the morning to take my wife to chemo… so I won’t be making any real progress.

However… I thought I might upload a build for you guys to play with, wiggly the little slider things, tweak the buttons, and so on.

Here are the download links:
http://mythruna.com/temp/TreeEditor/TreeEditor-Windows.zip
http://mythruna.com/temp/TreeEditor/TreeEditor-Linux.zip
http://mythruna.com/temp/TreeEditor/TreeEditor-MacOSX.zip

The UI may not be the most intuitive and some picking bug sometimes makes a button hard to click… but it can be fun to play around with.

Controls in camera mode:
WASD - moves
QZ - up and down
mouse and cursor keys look
left shift - fly faster
left ctrl + left shift - fly even faster

Space bar toggles from camera mode to editor mode and back.

Here is kind of an overview of the UI:

  1. This is the button used to regenerate the tree after you change settings.

  2. This section controls the radius and height of the main trunk. All other levels are based on these values.

  3. These parameters control things about this level. How many sides the cylinder has, how many times it’s split up along the length, how much randomization to add to those split points, etc.

  4. These parameters control the branching. The count controls how many splits. Angle controls the start angle in how they are distributed… different than twist above because it doesn’t twist the trunk. Inclination controls the angle relative to the parent’s direction. 0 = 90 degrees off the side of parent. Max would be parallel to the branch and kind of ugly. Radius and length scale control how much of the parent’s radius is applied to the children. (Normally radius is automatically stepped down based on branch cross section area but this lets you tweak that up or down.)

  5. Controls whether there is a ‘tip joint’, ie: whether the tree continues to recurse straight. It’s not perfect but it’s ok. You can add some additional rotation into the tip for variation.

  6. The additional branch rollouts. Clicking on the titled expands that rollout and it has similar settings to what’s described above. The difference being is that these all have an “Inherit” checkbox that is on by default. When this is checked, the branch settings are ignored and it inherits those of its parent. Note: there is no way to copy settings from one branch level to another which is kind of a pain… but it’s kind of not a real app either.

  7. These checkboxes enable/disable a particular branching level.

I forgot to mention the “Show wireframe” and “Show Test Pattern” check boxes at the top but hopefully they are obvious.

So, it’s all very far from done but maybe you have as much fun playing around with the settings as I do. Hopefully I get to add a “leaf” panel soon. :slight_smile:

10 Likes

Works like a charm, even on my mac :wink: Good stuff!

I would like to see a “auto generate” option, to automagically generate a new tree whenever a param changes. Or at least a hot key for it =)
Also a “spit-out-my-tree-as-a-j3o” button would be handy, though I realize this is just demo and not a full-blown editor atm.

Also works on Kubuntu with no problems.
I really enjoyed playing around with the attributes (and it’s cool to see your UI in action).

@benkibitzer said: Also works on Kubuntu with no problems. I really enjoyed playing around with the attributes (and it's cool to see your UI in action).

Thanks!

@kwando said: Works like a charm, even on my mac ;) Good stuff!

I would like to see a “auto generate” option, to automagically generate a new tree whenever a param changes. Or at least a hot key for it =)
Also a “spit-out-my-tree-as-a-j3o” button would be handy, though I realize this is just demo and not a full-blown editor atm.

Yeah, I’m not sure how I will do a save yet. Right now it goes straight from parameters to mesh and could be saved as a .j3o but ultimately I want an intermediate “tree” object that can then be used to generate this full LOD version or lower LOD versions. Then it might be better to treat the “tree” object as the data format saved in .json or something.

@pspeed Yeah, I'm not sure how I will do a save yet. Right now it goes straight from parameters to mesh and could be saved as a .j3o but ultimately I want an intermediate "tree" object that can then be used to generate this full LOD version or lower LOD versions. Then it might be better to treat the "tree" object as the data format saved in .json or something.

True, it would be even more awesome to have a intermediate format.

And +1 for something human readable like JSON/YAML =)

@pspeed said: The UI may not be the most intuitive and some picking bug sometimes makes a button hard to click... but it can be fun to play around with.

First off… awesome work! Not sure why you put “sort of…” in the title. Looks pretty solid to me!

Secondly, can you elaborate on the “picking bug”. I’ve been trying to track this down forever and am wondering if it JME specific or me specific, as I can’t seem to force a repro of the issue ever. It either happens or it doesn’t.

Unfortunately, it crashes for me :frowning: Screenshot looks awesome though!

*EDIT: it crashes if I just double click on the monkey icon, but I was able to get it to run by showing package contents, and running the TreeEditor.jar file directly. This thing is awesome!

@t0neg0d said: First off... awesome work! Not sure why you put "sort of..." in the title. Looks pretty solid to me!

Heheh. Thanks. Well, an editor that doesn’t support saving and loading… or even using the trees… isn’t really an editor. It’s just a toy. :slight_smile:

@t0neg0d said: Secondly, can you elaborate on the "picking bug". I've been trying to track this down forever and am wondering if it JME specific or me specific, as I can't seem to force a repro of the issue ever. It either happens or it doesn't.

I’m not 100% sure as I’m in kind of an odd state with respect to my JME tree.

The symptom is that sometimes areas of some of the enable/disable checkboxs in that UI don’t actually click. Usually the upper left corner works but especially in the bottom branch panels, the lower right corner does not.

It might be a bug I already fixed in the bounding box code because I’m not sure I’m actually running against that and haven’t tracked it down for sure. I’m running against some previous nightly, potentially before I made the change. Because nightly hasn’t gotten updates in a while then I can’t easily tell and I don’t want to go back to stable. I just haven’t tried running it against my local build of JME yet as that would confirm or not whether my fix was relevant to this.

Short answer: I just haven’t even looked into it yet.

@jeremywoertink said: Unfortunately, it crashes for me :( Screenshot looks awesome though!

*EDIT: it crashes if I just double click on the monkey icon, but I was able to get it to run by showing package contents, and running the TreeEditor.jar file directly. This thing is awesome!

Yeah, some Mac versions have a problem with the SDK built executable I guess.

You are extremely talented, i hope to be as good as a programmer as you one day. Well done!

1 Like
@JacobAmaral said: You are extremely talented, i hope to be as good as a programmer as you one day. Well done!

Hopefully you don’t have to work at it as long as I have! :slight_smile:

@pspeed said: Heheh. Thanks. Well, an editor that doesn't support saving and loading... or even using the trees... isn't really an editor. It's just a toy. :)

I’m not 100% sure as I’m in kind of an odd state with respect to my JME tree.

The symptom is that sometimes areas of some of the enable/disable checkboxs in that UI don’t actually click. Usually the upper left corner works but especially in the bottom branch panels, the lower right corner does not.

It might be a bug I already fixed in the bounding box code because I’m not sure I’m actually running against that and haven’t tracked it down for sure. I’m running against some previous nightly, potentially before I made the change. Because nightly hasn’t gotten updates in a while then I can’t easily tell and I don’t want to go back to stable. I just haven’t tried running it against my local build of JME yet as that would confirm or not whether my fix was relevant to this.

Short answer: I just haven’t even looked into it yet.

Interesting. This sounds just like the issue I have been hitting. I take it the fix you put in isn’t in the latest update?

EDIT: And who needs saving and loading… I avoid those at all costs (apparently … lol)

@t0neg0d said: Interesting. This sounds just like the issue I have been hitting. I take it the fix you put in isn't in the latest update?

EDIT: And who needs saving and loading… I avoid those at all costs (apparently … lol)

Heheh… saw that thread.

I believe the fix finally went out in the latest stable update (.9?) but I’m not 100% positive and I hate github’s web interface too much to check right now.

@pspeed said: Heheh... saw that thread.

I believe the fix finally went out in the latest stable update (.9?) but I’m not 100% positive and I hate github’s web interface too much to check right now.

I’ll give this a shot and see if it helps! Thanks so much for the info.

Hopefully I’ll get a chance to try out this, the marching cubes terrain thingy and a game I’ve been meaning to try that someone published recently. I’ve been sleeping more than not. 2(ish) weeks and counting til I’m finally all fixed up. Um… I hope!

This one has my interest peeked the most after my semi-failed attempt :wink:

Note: the screen shot app state is active in this little “editor”. So if you create a cool looking tree and want to share it then just hit the prt scr button.

Might be more enticing when I add leaf support.

@pspeed said: Note: the screen shot app state is active in this little "editor". So if you create a cool looking tree and want to share it then just hit the prt scr button.

Might be more enticing when I add leaf support.

Hey… I know you probably have another solution in mind… BUT! If you can seperate out the branches as a single mesh, you could use the emitter system I put together to create the static leaves mesh for you. Not sure if you ever saw the example I put together, but it works really well. Once the mesh is initially created, it can just be grabbed and the emitter can be trashed.

Anyways… just an idea, as the output was super awesome.

EDIT: In case you are interested in checking out the resulting mesh, the topic has two images that show how it ends up looking:

http://hub.jmonkeyengine.org/forum/topic/results-of-static-mesh-test/

1 Like

I understand that approach… but I’m trying something else.

So far the results are promising. This is without any lighting and with only one cell in the texture atlas:

Still needs some tweaking even aside from that.

Anyway, what happens is that when the tree is generated it spits out the branch tips… which then I use to plop down some leaf quads. That part could be customized by the user of the lib (when released)… if my way turns out unsuitable for some situation.

A little bit of lighting… still some tweaking to do… still just one cell in the atlas:

1 Like

Testing that all of the (currently just 4) cells in the atlas are getting hit. Reminds of a children’s book…

1 Like

Looking reaaaallllly good! Nice job for sure.