i have a script request! (Poses)

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Great idea! With Vern's action commander script, he should be able to assign the actions to user input negative keyframes, but then these would need to be accessed through actions only, since negative keyframes are unreachable. I don't see a problem with that, but it would limit it to Pro.


Boy, MC's gonna have to play catch up if he wants to out do our scripter's features. I keep wondering when Genete or Vern are going to get a job offer. :wink:
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Mmm, it appears that to have any convincing interpolation of manual keyframes, it has to be keyed frame-by-frame. At least for adjusting points mid-tween. Any non-keyed frame automatically reverts to the pose interpolations. Don't know if there is any way to help that. :wink:

I'd still like multiple boneselector/pose pairs in one bone layer, but I can work on that one myself if need be. :wink:
DarthFurby
Posts: 510
Joined: Sat Jul 29, 2006 1:34 pm
Location: New York City
Contact:

Post by DarthFurby »

Hey synth, turning off the script will restore the manual keyframe tween, which is like taking keyframed snapshots of the model on the timeline, instead of working with the model live.

But a new issue I've noticed is that when the script is on, it creates keyframes randomly on the timeline regardless of the toggle setting. The script has bugs, but what Genete did today is a major breakthrough. I will have more feedback once I've had a chance to test the script further.

Rest well Genete.
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

it's absolutely amazing. thanks genete! I have to go out now, but when I be back in home I will make a character to share with you.


this script is much better that I thought!
mike HAS to take a look here.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Genete wrote:How about to place the poses at negative frames? would be difficult to edit there?
Would be impossible to edit. Negative keys can't be accessed for editing in the traditional sense. Moving points is weird on negative frames. they don't move the way they should. Same with bones.

The only solution might be a special "negative frame" button to go along with this that copies negative frames to a positive frame for temporary editing and then copies them back to the negative frame.

Click the button, type in the negative frame to copy from and the positive frame copy to. Then when edit is completed click the same button and copy the positive frame back to the negative frame.

That's another problem. If say a few months went by and you open an old file snf you forgot where the keys are or how many there is no way to see how many negative keys there are. This could be put into the button, click to see how many negative keys there.

-vern
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

That's why I think referenced actions are the only thing that'd work for negative frames.
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Here is a little head i adapted for the script. It works great, but I haven't understood how the toggle button works. Even with the script desactivated, I have a lot of keyframes everywhere and no interpolation between which I have created.
Image

PD: I did a little icon for the toggle button, if you want to use it Image
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

I don't know if someone noticed it, but you actually can use normal bones and Poses bones.

- first, prepare your puppet, define the poses and create the bone selector and the poses bones. Run the script on each vector layer.

- on the same bone layer, create a new root bone and many bones as you want, just like if it would be a normal project.

- go to a forward frame and move the boneselector, it will work ok. But if you move it far of the poses bones (where its radius hasn't any influence of poses), the character will jump to take the form of the last pose.

- now you can move the normal bones, they will move the characters as if there wouldn't be any script.


I know it is not too soft and I can't tell you if it has any usefulness, but maybe the amazing scripters we have in the forum think in something :roll:.
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Cool face selgin!

The toggle button is only useful for point motion only.
When using the bone selector you produce keyframes for it self and a point motion (with no keyframe) for all the points. When you toggle off the script it produces a keyframe with the interpolated position instead of a simple point motion without a keyframe. It was thought for two proposes:

1) Create a keyframe in some particular frames with the current interpolated values. I thought it was needed to allow the user modify the position in that small amount of frame (what one user asked). At the beginning I though it was only possible to create and edited an interpolated keyframe just disabling the script and leting the user modify slightly the keyframe value. That's the reason for this script. Then I discovered that although the script was working you can create a keyframe using the normal tools when the script is running, because the script would look if a point motion keyframe exists and would avoid interpolate it.
2) Other use for the toggle keyframe button is to convert a scripted motion into a true point motion. Just toggle the script and export the animation. It would produce a totally keyframed point animation.

Regaring to the use of bones meanwhile the script is running you can do it meanwhile it is interpolating (don't need to go to far away from an extreme pose). You can use the skeleton in the middle!!!!!!!

Now imagine this new situation:
Would it be possible to define also skeleton pose positions, pose angles and pose scales in the poses frames? then if the script ALSO interpolates bones motion, angle and scale then you can make a bone poses script!!! (useful? I don't know, but hey! that's cool!")

I'm thinking also in a way to avoid the "step" interpolation when you insert a point motion keyframe. I believe that when the script is doing an interpolation it can look for the next (if any) and the previous (must be one at last) point motion keyframe and produce a double interpolation: the one given by the pose bones motion (scripted) and the one given by the two keyframes and add them in a differential way...

But this is other story. Please play with this version and let me know if it stills failing with those random keyframes that Darthfurby and I noticed.

Greetings.
-G
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Genete wrote:Now imagine this new situation:
Would it be possible to define also skeleton pose positions, pose angles and pose scales in the poses frames? then if the script ALSO interpolates bones motion, angle and scale then you can make a bone poses script!!! (useful? I don't know, but hey! that's cool!")-G
I had thought that, Vern would love it! (and me too :D).
thanks for the explanation, I'll check soon to see where is my mistake. This script is so fun (and useful for those who wants to sell a complete reusable and animatable character).
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

A bone pose script might actually be easier than the point pose script.

I had played with a similar concept for "blending" constraints. A new type of constraint that would have two or more bones controlling one bone and the values of the controlling bones would be averaged.

So if bone A's position is controlled by bones, B and C, the position of B and C would be 50% of each added to bone A. If the poses are set on frames similar to this script you would get those values and average them or normalize them and add the result to the bone weighting the numbers based on the boneselector bone.

This could be in the same script as the point motion script since the parent bone layer is accessible from there.

-vern
slice11217
Posts: 279
Joined: Thu Mar 30, 2006 6:12 pm
Location: Verona, New Jersey

Post by slice11217 »

Hi again guys,

Great work Genete! It took me a little while to follow what was going on but eventually I read through the posts and found where you described how to move points -it worked for me!

The only thing though, is that the toggle didn't work. I keep getting an error in my lua console, something like: 44: attempt to index global 'Me' (a nil value) -I don't know what that's about but I can't toggle the script off and the whole project goes all wonky after attempting the toggle. I'm on a Mac and I noticed I had to do one thing in order to get ASP to recognize the script: I had to "get info" on the script, then in the 'name and extension' field remove a tilde (~) that was after the ".lua" part. Before that, ASP wouldn't show the script in the menu.

You guys are gonna hate me after this next part :twisted::

So as some of you may know, I work for a company in New York called Animation Collective and I currently work on 'Speed Racer: The Next Generation'. I've been there for a while, and just about every time I do a freelance gig with ASP, I try to show it to as many of the bigwigs in the office as I can in an attempt to get them to start using ASP for their upcoming projects. I figure that it benefits them (less overhead, faster output, higher quality for their clients and therefore greater credibility for the company I work for), benefits me (more work, higher visibility, upward mobility), and benefits my co-workers (more character animation gigs that stay in-house rather than getting outsourced).

I'm finally starting to get some headway in this area, and I've been fortunate enough to hear about a project that's still in its infancy of development. The director has seen some of my freelance projects and so I asked him if he'd mind if I took a crack at animating one of the characters, and if it worked out then I could build the other characters in ASP. If everything works out then this would, of course, mean more jobs for ASP users when the project finally goes into production!

So the reason I'm bringing all this up on this thread is this: I think this script is a fantastic idea for production since it would be far easier for a newbie to simply move the boneselector around to get a character's head to rotate than it would be to try to do it all with actions. I mean, as a GUI, the pose array script is far superior to actions!

The thing is: lipsync.

I tried a couple of things out tonight and alas, not being a scripter/programmer/coder, I'm at a little bit of a loss, especially since I couldn't get the toggle to work on my machine at home. One of the things I tried (remember I'm mostly coding-illiterate), was to save a copy of the posearray script, but this one had the scripting for fa_meshinstance preceding it. In other words, I tried to mix the two. The hope was that if it worked, I'd be able to create a switch layer with all the mouth phenomes inside it, and all those phenomes would be referencing a duplicate layer outside the switch which would be affected by the posearray script. -Boy, I wish that worked!

Then I tried lipsyncing with actions while the posearray script was running. This kind of worked, except that there was no interpolation between action instances.

So I wonder, Vern you once said:
I've been thinking of something CRAZY. You can get the bone info from a parent layer. With vectors inside a switch you get the parent of a parent. The transformation matrix of a skeleton could technically be applied to the vectors inside the switch. No duplicate needed... I had been thinking about this since discovering how cool the Meshinstnace script is. The original intention of it was to duplicate vector motion. We are using it in a very roundabout fashion to duplicate BONE MOTION.
Wouldn't this be a good or appropriate usage of this idea? To have some kind of duplicate of the bone motion that operates INSIDE a switch layer on the child vector layers, thus enabling lipsyncing with a switch layer while the posearray script is running to rotate the head?

... I told you that you'd hate me after this! :D
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

slice11217 wrote: Wouldn't this be a good or appropriate usage of this idea? To have some kind of duplicate of the bone motion that operates INSIDE a switch layer on the child vector layers, thus enabling lipsyncing with a switch layer while the posearray script is running to rotate the head?

... I told you that you'd hate me after this! :D
Okay... need to give me some time to run this through my head. It's still spinning around and I have all these little stars and birdies flying around over it. My eyeballs are kind of bobbing up and down too... ;)

---------

Seriously though... I think I understand what you are driving at. A version of Meshinstance to distort the switch layers with bones in the parent layer that ALSO are driving pose motions in layers not in the switch...

... or maybe they are in the switch... or maybe all the poses including phonemes are controlled by bones that are controlled by this version of meshinstance which is actually a "hybrid" of the pose script and meshinstance script... phew!

Does that make sense? My head hasn't stopped spinning yet but I don't see birdies and stars flying around it anymore.

I haven't even tested the idea of transferring the bone influence to a switch layer. It would require using some areas of scripting I'm not 100% comfortable with and haven't done much with (bone/point influence matrices). I know bones... but this would require transfering the influence matrix and converting it and then applying it to the points of the switch layers. It might be easy.. it might be hard... it might be impossible. ;)

Combining two different scripts is not easy. You have to figure out exactly where and when something is happening in both scripts, then figure out how to combine or average all the motion taking place.

I applaud your efforts to "sell" AS but doing so based on a "non-existent" or "work in progress" script to "make it better" makes me a bit nervous. What if half way through production a bug with the script pops up? Just my opinion.

If I get some time to play with it I will see what I can do.

p.s. I have to agree a little with you that this idea sounds wicked cool. ;)

-vern
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Post by chucky »

This is all sounding very exciting, I must be a little slow, I couldn't get the new version to work for me, But then again I just blank out reading Genetes posts, I get completely lost in the technical detail,:oops: I could never be a programmer I guess.
Awesome suggestions from Slice and I hope what Selgin is saying about the second bone layer works, that sounds like an excellent feature- cool example BTW. :D
Great to have you scripting AS again Genete.
User avatar
Víctor Paredes
Site Admin
Posts: 5815
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Image
Just another test. I have an idea, tell me if it's too silly.
what if we had two or more bone selectors and separated poses for parts?

for example, I want to create poses for the mouth of a character for lipsync, but I want to create other independent poses for the rest of the head. I know I can create another bone layer and work both separately, but when the shapes share points there is no way to make it wedge. Sometimes they must to have in just one vector layer.

What if you attach the points you want to pose to each boneselector. So some points will move with boneselector1 (and poses called poses1) and the other with boneselector2 (and poses2)?

- boneselector1
- pose1 1
- pose1 2
- pose1 3

- boneselector2
- pose2 1
- pose2 2
- pose2 3
Post Reply