PDA

View Full Version : animating a tree


AroundTheFur
02-11-2003, 08:07 PM
Ok, some theorizing... I want to create a tree blowing in the wind. now the main trunk would move slightly, the large main branches a little more, and the ones attatched to that a little more, and so on. now whats the best way to go about doing this. would it be as simple as skinning the tree, and using set driven key or expressions on the main trunk so that if it tilts in a certain direction, the others follow, and how about adding a slight wave so it looks like its moving, and not just oscillating? any help is greatly appreciated! :buttrock:

Tokenize
02-11-2003, 09:11 PM
Hmm I'm planning on doing the same for my major project, the setup must be pretty long but I think it would turn out worthwhile, it worked for me as a toothbrush setup, I'm sure it can work as a tree. The idea is to rig the entire tree, down to the last twig, then create IK splines on all the joints of the entire skeleton etc. finally making the curves soft, making the soft curves control the joints and setting the goalPP of the particles to get realistic motion in the component editor. So here goes:

-Create your joints, and IK spline.

-Make the curve soft with a hidden goal.

-Select the hidden curve (say it's called curve1) and open the hypershade, press on input-output connections.

(this code does it well, you could assign it as a hotkey

tearOffPanel "Hypershade" "hyperShadePanel" true;
hyperShadePanelMenuCommand("hyperShadePanel1", "showBottomTabsOnly");
hyperShadePanelGraphCommand("hyperShadePanel1", "showUpAndDownstream");

-You'll see a connection between curve1 and ikHandle1, break that connection and plug the soft curve in the IK's inCurve

connectAttr copyOfcurveShape1.worldSpace[0] ikHandle1.inCurve

(I think you can only do it with MEL, tip: when you delete the connection press Undo so you get the code popup "Undo: disconnectCallback....."

-finally grab your particles in component mode and open the component editor, and tweak the goalPP.

And that's it! What's nice about this rig is that the particles can collide with objects which allows you to do all sorts of crazy little things.
Hope this helps.

beaker
02-11-2003, 09:30 PM
http://www.splotsh.com/tutorial.htm

Tokenize
02-11-2003, 09:37 PM
...and automating the entire process using MEL! :) :) rock on.

Wigaru Wiyamoto
02-12-2003, 03:20 AM
beaker, that's totally hardcore. Maybe TOO hardcore. :surprised

AroundTheFur
02-12-2003, 06:19 AM
being new to this scripting business, could someone explain how i would basically have the tree act the same way that one does, which is freakin awesome by the way, but i just want the skeleton to perform like that, not driven by particles but just by the spline ik, and how would i control the 'wind factor' on the tree? thanks fellas this is all really helpful and cool stuff.

edit: Tokenize i sorta followed what you had there, but how do i control the tree? put dynamics on the particles?

Tokenize
02-12-2003, 11:01 AM
Originally posted by AroundTheFur
edit: Tokenize i sorta followed what you had there, but how do i control the tree? put dynamics on the particles?

Animate the goal curve. But it will only be by setting various goalPP attributes in component mode (select them and edit their goalPP value in the component editor window) that you'll start getting some dynamic looking results.. The way around I suggested is pretty myticulous... you'd have to create these ik curves, change the connections, set the goalPPs etc. for every single branch, twig, leaf etc. so once again you'd probably be looking at automating the whole process using MEL.

Anyway I'd suggest going through the tutorial that was proposed. Either just blindly and faithfully or every time you bump into a command that you don't know the function of you could go check the MEL command ref to see what it does. Even if it takes you a week to grasp that thing you'll be pretty proficient in the MEL and particle business by then, there's no quick way around it.
Good luck.

AroundTheFur
02-13-2003, 03:57 PM
I followed it but it didnt come out with the results im wanting. is it possible to just put the spline ik onto the tree joints, soft body the curves, then add a turbulence to those particles in a given direction, and because i could change the goalpp on each to affect it the way i want, it would look right. i really didnt get much out of the mel scripting in that tutorial and i dont need it to be that complicated, just a tree skeleton lightly blowing in the wind. so you guys think this would work?

AroundTheFur
02-13-2003, 04:15 PM
well the method stated above does work for those newbs lookin to make a tree sway in the wind, granted it wont have leaves but you dont have to copy and paste a bunch of scripts.

Tokenize
02-13-2003, 06:55 PM
if you correctly followed the steps in my original post, yes adding a turbulence to the particles will work (I'm talking on a technical side that is, now you've got the power of making it look good or making it look rubbish).

AroundTheFur
02-24-2003, 10:27 PM
is there a script out there or if someones up to the challenge to make one, that will make a cylinder and bind it to each joint in a tree, so essentially i have a tree of cylinders? this would be very helpful because you cant hardware render joints, they wont show up, and the playblast isnt giving me results i can use. thanks!!!

bugo
02-25-2003, 12:14 PM
TOO much complicate!
but its a very great tutorial!

:rolleyes:

dwalden74
02-25-2003, 12:48 PM
is there a script out there or if someones up to the challenge to make one, that will make a cylinder and bind it to each joint in a tree, so essentially i have a tree of cylinders? this would be very helpful because you cant hardware render joints, they wont show up, and the playblast isnt giving me results i can use. thanks!!!



I'm pretty sure someone scripted a tool like this (which BTW would be pretty esay to do if it's not done already). It renders cubes or something around joints in a hierarchy. Should be avail at highend.

:beer:
David

AroundTheFur
03-12-2003, 05:57 PM
Ok so i got my skeleton to work perfectly(well damn close) with the method of just applying a gravity to the particles created by the soft body creation and fiddling around. but now i have to start over cuz im not happy with the results of the final render, so i built a tree, built the skeleton, soft binded it, and then created the iks, soft bodies, and now i have the particles. but when i apply the field to it nothing happens! i created a few dummy particles and applied the field and they react, but not the ones from my curves. any idea why? if i have to post the file i will. thanks

bambam
03-13-2003, 08:17 AM
does the tree have to be geometry
you can get some nice effects using paintFX and its built in turbulence type-> tree wind

just i thought

AroundTheFur
03-14-2003, 02:52 AM
and how do i do that? =)

bambam
03-14-2003, 06:53 AM
you could start by tring some of the preset brushes from the visor under trees
Try the birchBlowingLight brush
and in the AE under Turbulance type change it to Tree wind
stretch your time line out alot and hit play

the tree wind turbulance type is made to effect the brush based on the width and lenght of the tubes

CGTalk Moderation
01-14-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.