Does any one know how to rig a plane so that it can be rescaled from one corner similar to a window in any OS
Now I know!
First add a plane and change the rotation in edit mode so it looks like a window. Add an armature. Select the lower right corner vertex of the plane and press shift+s, choose cursor to selection. Next select the armature, change to edit mode (note, edit mode) and press shift+s and choose selection to cursor. The armature will snap to the corner of the plane but the origin will stay at the scene origin.
Next add three shape keys for the plane and call the second one “right” and the third one “down” or something. Select the second shape key, set the value to one and enter edit mode for the plane. Drag the vertices to the right (the two on the right side) one blender unit by entering drag mode and pressing an axis and one. (g y 1) Next do the same for the third shape key but on the lower two vertices (the two at the bottom) by typing g z -1. Note that it has to be negative. (Actually you could just have used snap with increment instead but hey. :p)
Also, go to the shape key settings again and change the Max value to 10 and the Min value to -2 or something.
Add drivers for the second and third shape keys by right clicking the value and choosing Add driver. Drag out a new window and change it to Graph editor. Change the mode from F-Curve editor to Drivers by clicking the drop down thingy in the middle and choosing Drivers. Press n to open the n-panel. Now, select a driver and change the Type from Scripted Expression to Sum Values.
Choose the armature in the Object setting and change the type to Y Location on the driver called (right) and to Z Location on the driver called (down). You should now be able to move the armature in object mode and have the edges follow, but you will notice that the window grows larger when the armature goes in the positive z direction which isn’t what we want.
To fix this, make sure the (down) driver is selected and look at the Expanded Polynomial modifier at the bottom in the n-panel. You should see 1.000 x. Change that to -1.000 x and it will get reversed, giving us the behavior that we want. Now you should be done! Maybe there’s an easier way, but this works I guess.
Actually I noticed now that the Range has an arbitrary max and min range value of 10 and -10 which is a bit strange. Anyway, if you need more scaling, just drag the shape keys further away. Hope this helped.
Thank you Cyaoeu! shape keys, of course,…why didn’t I think of that.