Selasa, 11 Februari 2014

Ok, its now time for something that is slightly more "advance", but the resulting effect is going to be pretty cool, I reckon, and you can further expand the idea.

The title of this post is indeed a little bit scary, but the concept is quite simple: "Dynamically trigger an effect (flipping, blinking, jumping, character standing up) by setting up trigger factor".



THE ORIGINAL IDEA
This is the original article/tutorial that inspired me to do similar thing in Blender.
http://area.autodesk.com/blogs/stevenr/making_art_with_python

The article basically talks on how to manipulate image data, transferring that data information to trigger something inside Maya and Softimage (color change, rotation).

The original inspirations:
We can start with something easy first: Flipping Multiple Cards. Maybe you have a grid of cards that you like to flip one by one or in a wave pattern or in other pattern. You can do a manual animation or you can use "happy trigger" method I am going to talk about here.

HOW YOU GO ABOUT DOING THIS
One of my most favourite Modifier in Blender is Displace Modifier. This Modifier really rocks. As you already know, this Modifier can take image data and displace any surface mesh at the Vertex level.

I was thinking... WHAT IF instead of just displacing a surface, it uses that "displace" value information to trigger another effects? At first, my solution was like this:
  • Parent Empty at each vertex of mesh. Track the position of each Empty. 
  • When Displace Modifier displace that vertex (position changes), store that value, then transfer and use it to drive another value
This is kind of possible, but a little bit complex. Liero from Blender Artist Forum is pointing another method: Use Transformation Constraint to read "value changes" and map it into other value.

TRANSFORMATION CONSTRAINT

This is the parameter panel you will see when you create Transformation Constraint for an object:


There is Source and Destination. Source Target is the mesh that will "drive" and remap any value changes into the Destination (the object in which you apply this Constraint). The mapping is limited to Transform (Location, Rotation, Scale), but of course you can always use the value to trigger other thing. We will learn to do this at later stage.

So, we will use this  Transformation Constraint together with Displace Modifier. The idea is, again: if a vertex got push/pull or move from its original position, do something else. In our case, just to flip the mesh object 180 degree.

SETUP THE FLIPPING CARDS
1. Create 5x5 Grid. Because we want 5x5 Cards laid nicely in grid:
This is the mesh in which we will apply Displace Modifier later. Lets call this grid "Template".

2. Next, create a plane, scale it down and do Parent - Dupliverts, and Make Duplicates Real so you end up with something like below:
Duplicates of Plane created at each vertex of the Template.
3. Once you got the 25 cards arranged in 5x5 grid, you can delete the original Plane object that was Parented to the template (to create DupliVerts). What we are going to do next needs to be repeated 25 x times because we have 25 cards grid. Lets to do this ONCE first:
- Select one of the card, apply Transformation Constraint.
- Set the Transformation Constraint setting like below:
That Group.001 is a single vertex that is directly where we born this card. We will have 25 Vertex Group.
What that Transformation Constraint means is:
For every value changes of Location of that single vertex inside Group.001 (between 0 to 1) in Z axis in Local Space, we will map that into value between 0 - 180 degree Rotation in Y Axis in World Space.

Another word:
If that single vertex at Template object got disturbed (pushed/displaced), do rotation on this card object.

4. Check if the effect is working, by moving the Template object up and down in Z axis. To be precise, test by moving up and down that single vertex and see the rotation happening on that single card.


5. Repeat step number 3 to all cards. Its a total of 25 cards. You only have 24 cards to go. Make sure you pick the correct Vertex Group, per card.

NOTE: This part can be Python scripted, otherwise it is really quite exhausting. I will give the script later. Liero wrote the script.

6. If you done it all correctly, you will see each card should now have connection to the vertex below it:

And if you move the position of Template object up and down in Z axis, all cards will rotate.

7. Our card so far is just a flat mesh with a single Material color. Why dont we add Solidify Modifier and apply 3 different Materials to represent the Top part, Bottom part, and Edge Rim part.
In my case, I have Yellow Material for the Rim part, Red and Blue for the Top and Bottom Part.
The setting of the card Solidify Modifier should be something similar like below:

8. At this stage, you can already starting to see the result. In fact we are nearly done. All you need to do is to apply Displace Modifier into the Template object to disturb each vertex position, which in turn will rotate each card separately. Or, even a better way is to ask Dynamic Paint to do it dynamically!

DYNAMIC PAINT IS THE FORCE
We will give  Dynamic Paint, a big privilege to trigger the whole effect via its "Vertex Weight painting".

Set your Template as Canvas and set a dummy Box object as Brush (disable render) that will trigger the displacement which in effect also trigger the rotation of each flipcard.

FINAL EFFECT
Once everything is set correctly, you will now have the Flipping Card Board effects!



FURTHER ON FOR YOU TO TRY:
Use more cards grid. And try not just using grid, use a mesh object and try flipping each face this way. You can create X-Men Mystique changing skin effect using this method. Well, in theory you should be able to.

See what else you can trigger? Material Intensity? Animation Action? Shape Key? Cycles Emission object? (LED effects!)

Have fun!

Related Posts by Categories

0 komentar:

Posting Komentar