I've been thinking in general about how to create simple rigs which store values on top of old value.
What i mean is pupil size which starts getting smaller when lids are open, and when i close the eyelids, it starts to get bigger. This i got working quite well.
http://www.cgmill.com/main/?page_id=165&g2_itemId=3210 (link to older test)
I also have a concept of sticky lips with this idea (it could be used to other things too...), but i seem to run into some problems:
I have object with morpher, and one morph target "Open"
Then i have a point, which has a custom attribute which should store the values. When open mouth is more open in current frame compared to previous frame, i add to the value. And when it's the other way, i substract from the value.
I have created variables for both. "openIs" and "openWas". Later has tick offset to measure value in earlier time.
Script itself is not done, since i have tried to isolate the problem... Script is stored in a custom attribute which i added to a point, and "counter" is another custom attribute in that same point.
if openIs > openWas then
$point.modifiers.counter += 1
if openIs < openWas then
$point.modifiers.counter -= 1
The problem is, that "Counter" custom attribute evaluates immediately to value of 16 in the frame 0, not to one?
So far i had the impression that script controllers are evaluated once in every frame? I think i'll run more tests on this thing.
If someone has experience in creating similar kind of scripts, i'd be interested in hearing your solutions.