Jump to content
sipi

[SOLVED] Tree Sim Deform

Recommended Posts

Hey everyone,

I'm trying to make a tree simulation. I'm using wire solver, but I can't figure out how to deform the tree geo with the simulated curves.

I tried wire deform and point deform, but the result is strange. Do you have any idea?

image.thumb.png.f0d66025fd4ddb3fd28d8334e845d05f.png

tree_deform.hiplc

Share this post


Link to post
Share on other sites
Posted (edited)

Play with the Capture settings on the pointdeform. Try a radius of 1.0.

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)
23 minutes ago, Atom said:

Play with the Capture settings on the pointdeform. Try a a radius of 1.0.

Not really working, it becomes wobbly. See this attachment. Also it wouldn't work with more dense branches.

radius_1.mov

 

Actually I discovered in the help that they don't recommend to use point deform for wire stuff.

image.thumb.png.c5d985769c40544b9c97cf23042efbaf.png

Edited by sipi

Share this post


Link to post
Share on other sites
Posted (edited)

I tried adding leaves, but the branch connectors dance around. I'm not sure if this set up will work with more branches. When I enabled the secondary branches, the bonecapturebiharmonic goes off into la-la land. You may want to come up with some overall mass concept for the tree and divide the branches into various weights. With more secondary branches, they weigh down the parent branch quickly.

tree_wire_sim.gif

ap_tree_deform(1).hiplc

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)

I think I fixed the leaf problem. Also I tried another method to deform the tree separately per branchlevel to prevent bonecapturebiharmonic from la la land.

tree_deform.hiplc

Edited by sipi

Share this post


Link to post
Share on other sites

To use curves for deform you need to create geometry using sweep from curves and then plug to point deform.

Share this post


Link to post
Share on other sites
14 minutes ago, tamagochy said:

To use curves for deform you need to create geometry using sweep from curves and then plug to point deform.

Oh indeed, it's a more simple and faster solution! Thank you!

Share this post


Link to post
Share on other sites

I wonder why the geometry is not aligning properly along the curves with the Sweep SOP? Any idea?

image.thumb.png.96746785cd8839969acd19e836a31f2f.png

tree_sweep.hiplc

Share this post


Link to post
Share on other sites
Posted (edited)

Ok, here is an attempt at tomogachy's suggestion. Sweep before the DOPNet, then point deform after. The scale along length doesn't really work right, because it needs to know the pscale of the point where the connection occurs, then use that value as the start of the taper. Also, some points just don't mesh well and seem stuck to neighbors?

tree_sweep.gif

ap_tree_sweep.hiplc

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)

I think tamagochy's suggestion was to put the Sweep after the Dopnet and use that geometry to deform the original tree geo using a Point Deform, and I think it would work well if the Sweep SOP would generate proper geo. I just can't figure it out what is the deal with the orient attribute...

The "stuck to neighbors" issue can be solved with deforming the tree separatly by branch_level, or using a for-each with named primitive like this:

image.png

Edited by sipi

Share this post


Link to post
Share on other sites

Sweep used normals along spline and up vector to orient shapes, by default after dopnet you have orient attribute you need to delete. Use foreach per branch to create shapes and then use it in point deform.

In my vol3 tutorial you will find explanation of all aspects of the meshing.

Share this post


Link to post
Share on other sites
Posted (edited)

I did some progress on this, trying to create constraints, but now I just completely lost what is happening :(

Anybody have any idea how to fix this annoying thing?

tree_3.hiplc

Edited by sipi

Share this post


Link to post
Share on other sites
Posted (edited)

Oh I just fixed the previous problem, but it's still far from a "good-looking" stuff. I want to figure out a stable setup, then start to tweak the sim.

Feel free to check out. It seems to me that deformation, and constraints are working now...

image.thumb.png.49155e8471ce0280b21f78a84c42d460.png

tree_4.hiplc

Edited by sipi

Share this post


Link to post
Share on other sites
Posted (edited)

Now the wire sim is realtime, deforming is slower (around 3 fps), but it's getting stable. Still a lot to do...

gif.gif.07ee6215329f56ce75d8fd16e2be40c9.gif

Also, I don't know if I'm overcomplicating it or not...? I'm just happy to find any usable solution.

tree_5.hiplc

Edited by sipi
  • Like 1

Share this post


Link to post
Share on other sites

Well, not long after I post it, I realized that the previous method in tree_5.hiplc is malfunctioning. I improved and simplified it and now it's almost okey!

But I have difficulties with constraining the branches to each other. Right now I actually snap the root points of every branches to the closest point on the closest branch, and fuse them instead of constraining but sometimes the snapping flaws. Constrains would be better I guess, but I couldn't figure out how to do it.

 

Way A is unreliable.

Way B is almost good but with a high number of branches, it becomes unstable.

Anybody could take a look and tell me what would be the bulletproof way?

image.thumb.png.87fc89af3e73d55511ded6cc11f438d4.png

image.thumb.png.954b0b2fed45be1c43bd92255abde173.png

tree_9.hiplc

Share this post


Link to post
Share on other sites

Nevermind, I fixed the previous unconnected pieces issue.

 

At last the skeleton preparing and deforming setup is working fine with as many branches as you want. I still use the fuse method, finally i managed to figure it out the way (unfortunately I couldn't make it with constrains :unsure:).

Now it's time for the leaves! :)

image.thumb.png.93a1e03fa4bb55d00b9d80ca40f7d175.png

Any idea about the leaves? What's the best way to use the Labs Leaf Generator with a deforming tree?

tree_10.hiplc

Share this post


Link to post
Share on other sites
Posted (edited)

Ok, I think I finished this. If anyone is interested, the hip file is available below. I hope it could be instructive for beginners.

 

I added leaves, they can have a general motion (breeze), and you can add another wind based on the tree motion (length of averaged velocity).

I discovered that Bone Deform is way faster than Point Deform (it was realtime for this tree), but Point Deform is more accurate. My setup includes both, I use Bone Deform for previewing, you can just switch. The wire sim is realtime as well, and cooking everything with leaves and with little branches was around 3 fps on my shy laptop without any pre-caching. (I think it's not that bad.)

Actually the leaves part could be better, for example right now leaves don't orient themselfs according to the direction of the wind... so some controlling features like this still would be nice to have. Well, feel free to improve it :)

I would say, theoreatically this setup should work with any tree, bush, plant, etc. created by the Labs Tree tools.

calm.gif.69bd473bcbb3ec8771684bec1709e241.gif

stormy.gif.5e464c0ece879ef00545de7ddfe66954.gif

 

The hipfile includes some notes as well, I tried to explain why am I doing what I'm doing.

image.png.9dd2b97e614d6c795348991f9b49cda7.png

 

Also, I started an attempt to create a non-simulated tree motion, what I saw in nirfse3D's videos about his Simple Tree Tools.

Not really impressive right now... I have no idea how he did it, this approach is getting really slow with more branches :(

non_sim_treemotion.gif.955b1e6ca18274b786c76ab9464f5c43.gif

Anyway.

Best wishes!

bark_01.jpg

tree_16.hiplc

Edited by sipi
  • Like 2
  • Thanks 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×