Shape Widget Maker Script


(guitargeek) #1

You may have read about my shape widget script on the orange blog

http://orange.blender.org/blog/shape-slider-driver-update

I came up with the idea after trying to dissect Bassam’s shape driver controls

http://orange.blender.org/blog/licence-to-drive

I wanted a way to make these controller quick and dirty :slight_smile: Soooo here is a link to the script

http://guitargeek.superihost.com/widgetmaker

This will work only with the current CVS build. (or the forthcoming Alpha 2 prerelease)

Let me know what you think :slight_smile:


(BigBlend) #2

I have to say something… awsome :o


(womball) #3

Can you layer different shapes into one control? So say you have a shape key for and opening of the mouth and one for the opening of the mouth sac, another for a tongue movement and another for lower jaw movement, all into one action?


(guitargeek) #4

Well, what you would need to do in this case is use the script for the first shape, and then manually add the other shapes drivers to the same controller. But there is nothing stopping an object from driving more than one key, since the driving assignment happens at the driven end, not the controller end.

Another trick is to dial up both shapes with the slider in the Shapes Panel, click “add shape” and then you will get a new shape that is the combination of the 2 you just dialed up :slight_smile:


(womball) #5

The shape drivers are the keys? I thought the widgets where the drivers? I was thinking of setting up a widget for the L sound, one point the tongue hits the roof of the mouth, the second point the tongue goes down.

Is this the work flow for creating the actions?

First you create your shape keys(blend shapes), create a widget and assign the main blend shape to it. Than you layer on the additional blend shapes for different parts of the mouth into one controller. I have to see if this works, it would make my life so much easier if it does.

Also a very noobish question, i want to split the screen vertically, I can do it horizontally no with no problem, and I got it once to split vertically. Any tuts for screen splitting that you know of? I want a dedicated window for the widget controllers.


(guitargeek) #6

Ah ok, here is where agreeing on terminology can help :slight_smile:

a Given Shape set at a given value is a key

a Driven Key is when a key’s value is determined by an outside effector like another objects position or rotation (an upcoming feature will let a line of python code be this driver) also not just shapes can be driven, any ipo channel can have a driver added to it. So you can drive the Size X of an object with the Loc Z of another.

The Shape widgets are really just objects that have been set up as the external effector for a shape’s driven key.


(womball) #7

A given shape is say a postiion of an object keyed at a certain value, like say .5 on the slider? So at .5 you have a partially opened mouth swung out a bit, and at 1 you have it open all the way stretched back a bit? And somehow you can set up driven key so this controls motions of the mouth, the tongue (bone controlled) and teeth? Also how do you set up Driven keys?

My goal is to set up easy to use controls that essentially controll lip sync postions and facial expressions. I would like to be able to change these easily, and from the test blend file with the project orange dude it seemed you could.


(guitargeek) #8

Ah, to set them up, do this…

  1. Have your Object with shapes in one window and also add an empty that we will use as a controller for the driver

  2. split your window have your object in the 3d window in one and the IPO editor in the other

  3. Select your object with shapes and go to the IPO window, select “Shapes” from the IPO type window

  4. In the IPO window, Click on the key you wish to drive from the right hand list.

  5. Press the N key, a transform properties box should appear

  6. Click the Add Driver Button

  7. In the OB: button, put the name of your empty and choose what attribute of the Controller you wish to drive the channel

  8. If there is no curve in the IPO window already for that Shape, it will work on a one-to-one basis. Otherwise, you can add a curve there that defines what the relationship of the controller to the shape channel is with the X direction being the controller value and the Y value being the shape channel mapped to value, (you can press I in the IPO window to get an option to add a 1-to-1 curve.

You can repeat these steps for other shapes as well

One problem with a single object as a controller is that is uses global space as its vaule, The Better thing to do is add 2 objects parenting one to the other, then using the child object at the controller, It will then use its relative transformation to the parent as its value rather than it global position.

Hope this helps a little


(dienben) #9

Superb!

Congratulation! It help me a lot for animation.

Dienben


(dienben) #10

Hello,

I built a basic exemple of what you can to with your script:
http://afn.dalmont.free.fr/ben/suzanne_driven_shape_1.blend

Congratulation for your work!

Dienben


(guitargeek) #11

Yup, that is the idea.


(womball) #12

I got it to work! Now I need to figure out how to set up easy lip syn. If you ever update this script could you add more 1 to 1 shapes(not enough options for that I think) and layering of shape keys into one section of the widget. I really hope this is incorporated into the official blender 2.40 release. Its a great script, makes it easy to set up widgets.


(TroutMask) #13

fantastic script.

i was able to set up a controller to affect a shape.

however, when i created a second shape and then ran the script, there was no shape to choose in the drop down box - it was blank.

i had my object selected before i ran the script. any idea as to probable cause?

and thanks for the script. this is a very important contribution to the blender community, and i hope it is included with the 2.40 blender release.


(guitargeek) #14

I would select your object again, do “back” then “next” and see if the lists populate.


(TroutMask) #15

i just figured it out. if more than one 3D window is visible the script can get confused. i had set up my windows like the orange team example. ie., one window shows the 3d model, and other shows the UI elements on a different layer.

i created a new screen with only one 3D window and it works perfectly.

edit: guitargeek, to address your comment, i had tried pressing forward and back but the lists did not repopulate.


(dienben) #16

Hello,

I just release a new version of my Lip Synchronisation script:
http://www.elysiun.com/forum/viewtopic.php?p=506127#506127

If it could help you…

Dienben


(guitargeek) #17

I’ve made a small update to the Widgetmaker script (0.7) this update makes the controller object and the range object get the same name. So if you make a widget with the name smile, you get a range object called “smile” and a controller called “smile.ctrl”

http://guitargeek.superihost.com/widgetmaker/

Johnny


(guitargeek) #18

I’ve updated the script here

http://guitargeek.superihost.com/widgetmaker/

To version 0.8 which now takes your idea and locks the controller part of the widget in either Y or Y+X directions depending on the widget type. It also locks Rotation and Size of the Controller object so those transforms are only effected by changing the range.

Enjoy!

Johnny