Home Technical Talk

Animate a Book - HOW TO ?

Acumen
polycounter lvl 18
Offline / Send Message
Acumen polycounter lvl 18
Well, I'm supposed to model, texture and animate a book within the following animation range:

Open from cover to first page
Open from cover to center page
Flip from first page to center page
Flip from center page to last page
Close book from last page

There's a styleguide of what look needs to be achieved:
http://www.youtube.com/watch?v=9mLR1F4ISmI

[ame]http://www.youtube.com/watch?v=nOXlUWJiOVo&feature=related[/ame]

Using 3dsmax - so it's not too many different animations, but still I'd like to know how I could approach this to work a bit easier than the solutions I found on the internet:
They just make me take the vertices and rotate and move them around manually and set the according keyframes. This kinda works but it would be much easier if I could set up the scene and just take one end point of the page and it'll magically animate from left to right.
Also the tutorials that are out there work just fine when your book literally consists only of thin pages and not the actual body of the book. As soon as that gets more complex and adds volume the technique are rather tricky to incorporate. The book's back bending added and stuff.

Better said, I wanted to have the book's width and the pages length to be consistent, cause they blob around when I do it by hand. The 3D Bookshelf video shows how it can be done super easily, but I guess that's not something one can build in a couple of minutes.
The easiest solution to this scene so far was me modeling the various inbetween frames and have that as a background image to trace it up for the animation.
Like I said, this approach works, but it's not too delicate and modular. Also I'm always interested in learning a second way of doing things. So if anyone has a nifty tipp or direction where to guide me, I'd be glad to know :)

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    2 suggestions.
    1: build a book with the moveable bits you need, then rig it with bones and just rotate them.

    2: make a page. turn it into a cloth object and bind the one edge to the binding, then apply whatever needed forces and or keyframed constraints to get the turning motion. This will take a bit of time to set up and or learn if you don't know the dynamics systems, but it will give natural motion pretty easily, and will keep consistent page size if you set the simulation properties correctly
  • Acumen
    Options
    Offline / Send Message
    Acumen polycounter lvl 18
    Thanks Vailias, Option 1 should be the achievable solution.
    I just can't believe I'm having a similar problem you get when you rig a human knee or ellbow. The edges rotating in a unwanted way so it gets skewed on the outer and inner edges... And I don't think I even understand the entire weighting vertices process. I didn't imagine this being such a challenge, to be honest. Also since 99% of the books pages are one solid model that needs to be morphed into place, doesn't make it much easier at all.
    And with using bones the stuff gets distorted anyways, so I don't know how to achieve the animation without getting these little distortions everywhere. Having the book being displayed at 1024 resolution doesn't leave much space for errors, neither :/

    But I guess with a bit of patience you can figure that out. Also I had a closer look to some of the references I posted and they just got rid of the hard detail to be animated. Taking the easy way is preferred :)
  • tharle
    Options
    Offline / Send Message
    tharle polycounter lvl 9
    Could you do it with blend shapes rather than bones?

    you basically have 4 extreme states: closed, page 1, middle page and last page. If you modelled these 4 and possibly the 4 extreme inbetweens then you could work out 4 formulas for each animation that weights the blend shapes accordingly. Not sure if that's easier than bones though.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    You could try this out.
    http://www.scriptspot.com/3ds-max/scripts/book-rigger
    I had to do this in a previous job. I used a mix of bones and bend modifiers. that maxscript should do it all for you though. I tried cloth and Morphs but both had major disadvantages. Cloth is way to complex and hard to control, and Morphs just arent good at depicting animations where there are arcs involved (A morph moves verts in straight lines between 2 points where as a bone or bend rotates them through an arc, which is what you want for a plausible, nice looking animation )
  • Mark Dygert
    Options
    Offline / Send Message
    r_fletch_r wrote: »
    You could try this out.
    http://www.scriptspot.com/3ds-max/scripts/book-rigger
    I had to do this in a previous job. I used a mix of bones and bend modifiers. that maxscript should do it all for you though.
    Yep thats a pretty good script, I've used it but ultimately found it was limiting for what we needed to do. I'd try it out. If it works, great! If not... well get ready for some fun.

    Cloth, yea I wouldn't even go there.
    Even if you've worked with cloth before there is so much experimentation needed to get it dialed in that it can easily eat up a bunch of time and not give you the results your looking for, its also pretty hard to get it too loop.

    I did successfully use cloth to rig a book and I've used cloth quite a bit before that, and it wasn't easy. I can give you some tips if you go that route, but honestly it's probably faster 1-2 other ways.
    r_fletch_r wrote: »
    and Morphs just arent good at depicting animations where there are arcs involved (A morph moves verts in straight lines between 2 points where as a bone or bend rotates them through an arc, which is what you want for a plausible, nice looking animation )
    A normal morph will linearly blend true but you can target a series of morphs in one channel and have it progressively move from one morph to another. I do this with eyelids all the time. I create the linear morph, copy it, fix the bits that need fixing and add that to the same morph channel. If that is too linear you can do it as many times as you need. until you get smooth flowing motion.

    Also personally for me, I've used the bend modifier only method and its a bit of a pain to animate unless you wire it up to some kind of UI.

    Here's what I would do to animate a page:

    • Position the local pivot by the spine of the book. I turn on 3 snaps set it to vert, go to the hirearchy tab, turn on Affect Pivot Only and snap the pivot to a vert along the spine.
      • This is important if you want to rotate the page as it turns, it will turn from this pivot. Also any modifiers will start at this place so it automatically positions your bend modifiers in the right spot.

    • Apply the bend modifier, probably a few stacked and rotated slightly to give the page a bit of variance. You can copy/paste your bend modifier, go into the sub-object selection click on gizmo and move the bend modifier(s) around.

    • Use the bend modifiers to position the page how you want, when you have the page posed, create a snapshot or just copy the mesh, create a few progressive morphs like this.

    • Then copy the mesh and remove the bend modifiers, apply noise so you can get some subtle motion as the page settles and air escapes, you don't need this but it helps.

    • Then apply the morph modifier and test out your animation. If you want to tweak it, make a copy, nudge and noodle some verts around and pump it back into the morph channel.

    • Apply a push modifier, so your page actually has two sides that you can uniquely unwrap, you do this on top of the morphers so it shouldn't have problems interpenetrating.
    The advantage of using morphs is that you can tweak and push the page around as you see fit and you're not limited to just bend modifiers.

    Tips:
    When you're creating morphs it can be helpful to turn on soft selection or push pull in graphite modeling tools and nudge large sections of the page around, you can get some good drag, as well as a nice corner flip this way.

    You can create several page turn animations this way and load them into different morph channels. Using the same page geometry you can animate it differently using just a few simple sliders.

    If you need different text or images on the pages, you can do simple one frame texture swaps, or animate the UV's. Layout your book in one big image, and shuffle the UV's around as you need.

    Making it loop:
    you can create an end frame morph after the page has settled and blend to it so your end frames always match, unlike cloth which is pretty unpredictable.

    Adding a hand:

    IF you need a hand to connect to the page as if its turning it, use an attachment constraint to place a dummy on surface of the page, then link your hand IK to dummy. The page drives the hand to animate and it looks like the person is turning the page.
  • Acumen
    Options
    Offline / Send Message
    Acumen polycounter lvl 18
    Actually I stumbled over this book rigger script a while ago and thought it could be the perfect fit, but since there was not too much documentation about it, all I manged to come up with was animate the first page of the book and that was it.

    The one page I have to animate, I'm quite satisfied with that. The way Mark Dygert describes it, works really nice, more or less.
    The thing I have the most problem with is the big mass of the book body.
    Lemme illustrate it.
    This is the books outer shell, I actually managed to set it up with bones really quickly and it's really nice to work with. I can open and close it without too much distortion.

    book_body_transformation2.jpg


    However I'm really having a lot of trouble to come up with a clever solution of how to attach the big bulk of the book's body to the outer shell. Here's what I mean. The upper pictures are snapshots from the 3dbookshelf behind the scenes video - they seem to have developed an awesome system. However I'm having a lot of trouble of how to make the books body animate with the shell properly. I think I just can't get my hand around the problem from a logical point of view. I guess the book needs not only to be rotated, but to be transformed in order to achieve the natural flowing look. If I make it one object skinned to the bones it just doesn't give me the result I'm looking for, basically because I want to fake something out of one block that basically involves lots and lots of tiny pieces of paper moving an shifting around. I think the "easiest" solution would still be some sort of manual hacking the vertices in the according positions to achieve the paper sliding and shifting into the right places, don't you think ?

    book_body_transformation.jpg
  • Nysuatro
    Options
    Offline / Send Message
    How about just using cloth ?
  • System
    Options
    Offline / Send Message
    System admin
    Made this quick (15-20 mins) as I've never done it before and thought it would be a laugh.

    book.gif

    Just rotate vertices of one half of the book in 2 stages, keyframes 50% and 100% open. With the pages, just make a few turnable planes sitting on top of a box to fake the rest. That is unless you want to go psycho and make every page turnable!

    Vigs suggestions of adding modifiers will finish off the page turning effects nicely. Cloth and bones really are overkill for this, I mean it's just a book not a transformer or a 3d lovedoll:shifty:
  • Mark Dygert
    Options
    Offline / Send Message
    humm.... never had to animate the book opening, we just had it open and the shot was tight enough that we didn't have to track the bulk of the pages. A simple page flip loop, was good enough.

    Here is one idea I had to control the bulk of the pages.

    BookPagesBulk.gif
    Use 2 morphs you can blend between them to operate the bulk of the pages.
    Transmographier will help with that, do one side and mirror it over to the other (I didn't have it installed so it's a bit uneven).

    Then attachment constrain a dummy to the center spine and have your animated page follow that, maybe have a few copies of the animated page that are slightly different and delayed for when the book is flipped through quickly.

    You would need to animate the UV's of the outer edges of the pages also, which you would probably want to wire to the morph channel or an external slider of some sort.

    For it opening, you could probably just skin the bulk pages to the book bones in their open state then close it, possibly making a morph for the closed state, or progressive morphs if it animates poorly. Or reverting to vertex animation if it really doesn't open/close well at all.

    You MIGHT end up having to do so much poly wrangling while its opening/closing that you just create a snapshot of the bulk pages once you get it opened and do your bulk pages morphs on the new model and swap out the two in a single frame swap by animating the visibility (object properties, or curve editor, add visibility track).

    If you wanted to get fancy and have some of the pages stick and fall back down or follow front cover you can make copies of your animated page and use visibility tracks again.

    If I get some more time and or you haven't taken the ball and ran with it, I'll flesh out those ideas at lunch and see if I can get something working.
  • Mark Dygert
    Options
    Offline / Send Message
    GCMP wrote: »
    Made this quick (15-20 mins) as I've never done it before and thought it would be a laugh.

    book.gif

    Just rotate vertices of one half of the book in 2 stages, keyframes 50% and 100% open. With the pages, just make a few turnable planes sitting on top of a box to fake the rest. That is unless you want to go psycho and make every page turnable!

    Vigs suggestions of adding modifiers will finish off the page turning effects nicely. Cloth and bones really are overkill for this, I mean it's just a book not a transformer or a 3d lovedoll:shifty:
    This works for a binder where the pages stay on one side, then slide over rings to get to the inside back cover.

    But with a flexible spine they are stitched and glued together so the pages follow and deform differently.
  • Acumen
    Options
    Offline / Send Message
    Acumen polycounter lvl 18
    Mark Dygert, you're really taking this to the next level. They don't want it even that sophisticated at all :)

    Considering me, I'm heavily annoyed.
    I was ready to export everything and out of a sudden the keyframing doesn't work the way it used to.

    I animate the opening of the book to page 1 which is 45 frames alltogether.
    Then I move over to frame 50 and change the pages, but instead of animating the frames from 45 to 50 it blends all the way from 1 to 50 resulting in a total mess....
    I don't know why it does this. It worked just fine yesterday. I put Autokey on, move 5 frames forward, move the stuff around, move another 5 frames forward. And that way I animated the book opening, page flipping, it all worked just the way I expected it.

    I'm getting slowly mad at this book **'*
    I tried to select every vertex and set a keyframe but it still goes bananas O_o
    Anyone know if i checked an option or what the general mistake is, I'm doing ? It must be such a tiny/obvious option/step that I forgot to do, it literally freaks me out.

    What I want to achieve:
    At frame 45 make a "freezeframe" and the following animations only take that state into account for interpolating.

    I don't understand why it doesn't work like that anymore.
    I made it 4-5 times just exactly like that. And it never got messy or confusing. It just worked like I expected.
    However, when I copy frame 0 to frame 40 and animate that again. The blending only occurs from frame 40 to 45. The frames before stay untouched.

    Did I do something wrong with the first autokeying ? This is so mysterious to me :/

    edit:
    Basically this thread describes my problem exactly:
    http://www.garagegames.com/community/forums/viewthread/60270
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
  • Mark Dygert
    Options
    Offline / Send Message
    Opps, sorry I missed this when you replied and it slipped off my radar. If you haven't figured it out maybe this will get you rolling again. Your post is a little cryptic too... "move key to frame, have trouble, stuff screwing up, I'm pissed" It's a bit of a mystery as to what's actually wrong.

    Can you post the files? or an example of whats going wrong?
    Acumen wrote: »
    I was ready to export everything and out of a sudden the keyframing doesn't work the way it used to.
    Export to what? In what format?
    If this is for a game, it would of been helpful to have that info upfront. Most games can't handle all the little tricks you can do in 3dsmax and you end up working in highly restrained ways...
    Acumen wrote: »
    I animate the opening of the book to page 1 which is 45 frames all together.
    Then I move over to frame 50 and change the pages, but instead of animating the frames from 45 to 50 it blends all the way from 1 to 50 resulting in a total mess....
    Are you using set key or auto key? Autokey will key whatever changes are made on that frame, set key won't key anything unless you specifically set a key. You can make changes on that frame and if you don't set a key they won't "stick".
    Acumen wrote: »
    I'm getting slowly mad at this book **'*
    I tried to select every vertex and set a keyframe but it still goes bananas O_o
    Anyone know if i checked an option or what the general mistake is, I'm doing ? It must be such a tiny/obvious option/step that I forgot to do, it literally freaks me out.
    You animate the verts in a modifier like edit poly, with it set to "animation" mode not "model" mode. Changes to the geometry or collapsing the stack will seriously screw with your vertex animation. If you have a mix of bones and vertex animation then you should probably create a "point cache" and export that, IF whatever you're exporting will accept that.
    Acumen wrote: »
    edit:
    Basically this thread describes my problem exactly:
    http://www.garagegames.com/community/forums/viewthread/60270
    It looks like that guy having trouble with curves, which if this is your problem, then there are two ways to fix it, either animate with the tangets/curves set to linear so they don't interpolate, change the little red line, to the right of the set key button, to a diagonal line which will set any keys you create to linear (no curves). This however will only work on new keys it won't change the keys you have set already, you'll need to crack the curve editor open, select the keys and set them to linear manually.

    You could also be encountering a problem called gimbal lock
    [ame]http://www.youtube.com/watch?v=zc8b2Jo7mno[/ame]

    Hope that helps! I'm really grasping at straws here I'm not exactly sure what the problem is...
  • Acumen
    Options
    Offline / Send Message
    Acumen polycounter lvl 18
    I'm sorry for the rough explanation :)
    I really need to work on my problem describing skills. I thought I posted, that it was meant for realtime use. Looking back at the explanations and understanding the entire problem a tiny bit better, I'm sorry for not providing the much needed information.

    Basically it will be used in a realtime environment using Unity Engine. It turned out in the end just as you said in your last post, that the MAX magic can't be transferred over via vertex animation. I had to learn that the hard way. FBX Format will be used for this.

    I'll try to explain again, what I had trouble with.
    Like I posted I had to provide different animations and states of the book that can be viewed on the following picture:

    book_states_question.jpg

    What I did was animating the book from state "book_closed" to state B. Then I needed to animate from state B to "book opened to center page".
    But instead of animating from my last autokeyframe on frame 40, the pages were interpolated from frame 1 to 50 all the waythrough, which resulted in all the pages intersecting with the book's "cover open" animation.

    Deep down in the internet I found a "tip" that said, I just need to move the affected vertices of the books pages 1 unit to the left and back to the right and then the transformation won't happen.
    I think it had something to do with the book's pages not being animated yet from frame 0 on. However you can explain it technically, I understood the problem and was able to solve it.
    Well and then there was the tiny little issue with not being able to import vertext animation......

    SO
    the final solution - that actually is working and was tested ingame - was to manually assign single bones to each pair of vertices and trace down the vertex animation. I was hesitant as to whether this was nagging on the performance, but since it will be the main thing on the screen without much more action, they said it was just fine performance-wise for their needs.

    Boy, did I learn a lot from this adventure :poly136:
    Setting up and assiging bones, fbx format in general, point cache files, baking animation, how to install and modify maxscripts, how to not describe animation issues with just words,...

    Most importantly make sure to get as much information about the engine, its features and possible problems coming up on the horizon. Funny fact it was said "to only require some simple animations", yet it took me hours and hours or dirty fun to figure it all out. But it was so worth it. I learned a ton of things about the way formats and animation in general can and cannot work in today's engines.
    Now if only I got paid quadzillion dollars for stuff like this :D

    I want to say thank you, to you guys, for helping me out again. Especially Mark Dygert, of course. This forum is such a great ressource and knowledge station. I really appreciate your ongoing support :)

Sign In or Register to comment.