I have an object which is formed of different layers of mesh. I want to show it open up , with smooth animation, and then close again. I have tried what some people suggested on here before, which was to use manipulate center points and scale. However i get a little problem with this, which you can see in the image. If anyone knows how to fix this, i'd be really happy :)
Driver controls Delta Transformation Location X value
The red object location relative the to yellow object location controls the final locations of the blue planes via a driver. The red object is useful for the Blender python script driver described below.
A red delta mesh object controls the Blender Object [Delta Transformation] Location X value of the two flanking light and dark blue planes relative to the yellow middle plane. A Delta Transformation Location value is added to the regular Location value to see a final location on the screen. Simple Addition. A python script driver allows us to use the distance between the red cube and yellow plane to offset the blue flanking planes. The red cube can be animated. Multiple locations for the the red cube and controlled movements of flanking planes are shown in the animated .gif file above.
Many of the images below are composed from multiple Blender screen captures to reduce time, produce single size images. Keep that in mind when inspecting the images. Click on images below for larger version and to read the text.
Flanking planes final placement is controlled by red object. Outliner windows shows objects involved. Composed image above emphasized by black divider.
Flanking Planes left and right. The tool tip on the Delta Transform X Location show a simple python formula. The purple coloring of the value and the tool tip indicate a python script driver is used. Add Single Driver was selected from value pop-up menu.
The driver windows show the driver values for the moving planes. The arrows indicate the Graph Window and the Editing context. A Composed image to compare formulas .... emphasized with black areas. Click image to see larger view.
You must select one plane and add a driver. Then you must select the second place and add a driver.
The two simple names and text formulas you must type into the respective windows below and are visible in the screen capture as well.
(delta - middle) ... and ... -(delta-middle)
All other values come from the menus.
Simplified sequence of steps. Inspect and Improve.
This proposed answer is not a tutorial for beginners.
Please search [Blender Driver Tutorials] and you will find many matches for free on the famous video website. If you need a tutorial see a video tutorial, this is an efficient use of time. Many videos will show you how to create a driver in general.
A recent video on Blender Driver Tutorials on a video website will provide a better visual tutorial. The video will not have the simple formulas stated below. Video tutorials often work better than text tutorials for Blender. Recommended for people who state they are beginners. You can even search here at BSE with the keywords provided. I am sure I and many others here at BSE learned about drivers by searching on the very famous video website. This is not intended as a tutorial on drivers in general. This site has claimed not to be about tutorials.
The 4 objects placement is indicated above. Red cube is controller. 3 planes have initial separation. Select a flanking blue plane. Locate and Know the Delta Transformation values are listed below the regular Transformation values. I am using the X location for this example. Mouse over Delta Transformation X value, alternative mouse click brings up the menu indicated above.
Add Single Driver. Purple indicator appears.
Create a new window or reuse window. Change to Graph Window. Select [Drivers] editing context. Make driver info appear by click the + sign faintly visible on the right side of window if necessary. Add variables and create your variables to match the values in the screen captures above. Note the object names I use may not be the same as your object names. Thus use the object names in this proposed answer or translate with awareness.
The red cube need not be rendered.
Make sure User Preferences allows scripts to be executed ... if a related error message appears.
Copy Location Constraint
For certain cases a
[Copy Location] constraint
may work. In the settings above note that the X axis is used, offset used, and one object has invert specified since the objects move in opposite directions. For the current settings we rely on the red DeltaObject being a Location X = 0 for rest position.
Note the image above contains two screen captures. You can read which object is selected on the left and differently on the right sides. The highlight is often difficult to see.
Click to see larger image.