morpher hint tool and curve angle tool

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
hothead
Posts: 213
Joined: Mon Apr 12, 2010 10:53 pm

morpher hint tool and curve angle tool

Post by hothead »

1. MR VERN can you create a script to morph shape instead of point like in toon boom and adobe flash the morpher hint tool point b to b and f to f etc

2. also a curve angle tool
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Re: morpher hint tool and curve angle tool

Post by Genete »

hothead wrote:1. MR VERN can you create a script to morph shape instead of point like in toon boom and adobe flash the morpher hint tool point b to b and f to f etc

2. also a curve angle tool
Sure man! SuperVern will do it right now! and for free!!!

(Sorry can't resist)
-G
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Sorry hothead, in my opinion this is not possible based on the way AS works. The vectors are totally different. AS can only morph points on a single vector layer. Those points stay the same and it is a "linear" movement from one key frame to the next.

In Flash and I assume TB, the shapes are based on many many many points. If you look at the points of a shape in Flash you can see they have a LOT of points... LOTS AND LOTS of points. That is WHY they REQUIRE "hinting". It would be impossible to do point to point morphing in those programs with complex shapes without some type of "hinting". In Flash "shape points" are almost as complex as "raster" or pixel based images. The type of morphing done in those programs is very very different.

The only type of morphing possible in AS is based on exact point counts in a vector layer. The number and order of points must be the same. Each point moves to a new location to create a morph. If you need to have more precise or specific point motion in a shape morph then you can key frame each point individually to tweak the transition.

Just my thoughts on it.

-vern
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Post by madrobot »

heyvern wrote:Blah blah. The vectors are totally different. AS can only morph points on a single blah. Those points stay blah blah from one key frame to the next.

In Flash and I assume TB, blah blah... LOTS AND LOTS of points. That is WHY they REQUIRE "blah". It would be impossible to blah blah. In Flash "shape points" are almost as complex as "blah blah" or pixel based blah. The type of morphing done in those programs is very very blah blah blah.

The only type of morphing possible in AS is based on blah blah blah. Blah. If you need to have more precise or specific point motion in a shape morph then you can key frame each point individually to blah blah.

Just my thoughts on it.

-vern
Sorry I don't quite get what you are saying Vern.
Are you saying that the scripts are done?
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

madrobot wrote:
Sorry I don't quite get what you are saying Vern.
Are you saying that the scripts are done?
Blah blah blah blah. Sacrifice Blah blah blah
blah blah. Blah blah blah blah blah blah blah
blah blah blah blah blah pentagram blah blah.

Code: Select all

blah blah blah blah get magic spells from the book of LUA blah blah blah blah blah.
Uh... yeah sure. Almost done. That's the ticket. ;)

-vern
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Post by madrobot »

I love that band.
User avatar
hothead
Posts: 213
Joined: Mon Apr 12, 2010 10:53 pm

Post by hothead »

vern i understand what you are saying BUT since as in AS work with here what i need you to do... how the script tool to work

1. say you have a square shape with 100 point on each of the four side the same shape on 2 layer.

2. lets say after you finish all that hard work create a complex shape you realize that you need "1 more point at the top of the square shape and on 1 more point at the bottom of the square shape on both layer.

3. now the shape will have 101 point at top and bottom and 100 point and both left and right side.

THE MAGIC

1. to get a smooth morph in AS tell the program to put the top point that you add at the top of the sharp in layer 1 TO MORPH TO A DIFFERENT POINT THAT YOU SELECT ON LAYER 2


basically vern your new magic tool :idea: can change the first or any other point that you add at the start of the square with any other point in the square instead of it of to match back with the first point added in layer 2 :D :D Genete, selgin and madrobot you other pro help me out here
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

hothead wrote:basically vern your new magic tool :idea: can change the first or any other point that you add at the start of the square with any other point in the square instead of it of to match back with the first point added in layer 2 :D :D Genete, selgin and madrobot you other pro help me out here
From my experience, I can tell you it's easier to make the transformation by hand. It's always nice to have control over the number of points.
Anyway, there is a tool which could help you a little on transformations. It's called Replace Line, made by Fazek. You can find it on scripting section.

Now, about the idea, maybe the scripters can answer it. Would be possible to have an "intelligent add points" tool which calculates and keyframes a new point created on a frame different to zero?

It's hard to me to explain it, but I'll try. Imagine you have a circle and you animate it in 3 keyframes like in this image
Image
Now, let's suppose we add a point on frame 20. With normal add point tool, that point will be only keyframed on frame 20, being still from frame zero until 20. This way, our circle will look distorted on frame 1 and 10.
Image
Now, imagine you add a point using this "intelligent add point tool". This tool will create a keyframe on frame 1 and 10 for the new point, calculating the average position in relation where it have been added between two adjacent points and maintaining the desired structure.
Image

With my very very limited knowledge about scripting I can bet it could be possible to make this kind of tool. But, however, you are the experts, what do you think?
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
hothead
Posts: 213
Joined: Mon Apr 12, 2010 10:53 pm

Post by hothead »

here a link what i mean

http://www.youtube.com/watch?v=wfLXtPRmMFA

notice how i add the point on the right shape top to bottom first on layer1 then bottom to top on layer 2. the TOOL most be able match the top point on layer 1 with the top point on layer 2 same with the bottom point

the Left shape the first point was add at the top in layer 1 same with layer 2
but not on the Right shape first point was add at the top in layer 1 But was add at the bottom in layer 2, notice i get a smooth morph on the left shape but not on the right shape, the Script tool most be able to fix it.

dont say its ease to know where to add point on both layers because if you have 1000000 points on both shape it would be hard to now were to add the point on the same shape without the distortion

thats how TB and Adobe flash works they just let you REMATCH BACK SOME OF THE POINT THAT YOU TELL THE PROGRAM TO DO. HENCE THE HINT TOOL!

vern dont tell me you cant we all now you can :wink: :wink: you are one of the best.... seglin gente
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

selgin wrote:
hothead wrote:basically vern your new magic tool :idea: can change the first or any other point that you add at the start of the square with any other point in the square instead of it of to match back with the first point added in layer 2 :D :D Genete, selgin and madrobot you other pro help me out here
From my experience, I can tell you it's easier to make the transformation by hand. It's always nice to have control over the number of points.
Anyway, there is a tool which could help you a little on transformations. It's called Replace Line, made by Fazek. You can find it on scripting section.

Now, about the idea, maybe the scripters can answer it. Would be possible to have an "intelligent add points" tool which calculates and keyframes a new point created on a frame different to zero?

It's hard to me to explain it, but I'll try. Imagine you have a circle and you animate it in 3 keyframes like in this image
Image
Now, let's suppose we add a point on frame 20. With normal add point tool, that point will be only keyframed on frame 20, being still from frame zero until 20. This way, our circle will look distorted on frame 1 and 10.
Image
Now, imagine you add a point using this "intelligent add point tool". This tool will create a keyframe on frame 1 and 10 for the new point, calculating the average position in relation where it have been added between two adjacent points and maintaining the desired structure.
Image

With my very very limited knowledge about scripting I can bet it could be possible to make this kind of tool. But, however, you are the experts, what do you think?
OK, that's a little bit scary, Selgin. I recently wrote a script that does this! The only difference is I did it as a post-fix type tool, but you could probably just tack a reference to it onto the MouseUp method of a copy of the add_points tool, if you wanted it to work that way.

The way it works at the moment is, you just select the points you want to "fix" and it goes through the entire timeline (and actions if you specify them), and corrects the selected points on any frame where one of its adjacent points has a keyframe, but it, itself, does not.

It works quite well on AS6, but I imagine it would work even better with the new curves in AS7. The only problem is, I would have to figure out how they are calculated, unless we can somehow convince Mike to tell us his secret algorithm.

Hothead, I'm guessing what you want is something different. A script which reorders points in switch layers based on certain criteria. Should be possible. You could make it fully automatic by minimising the distance points have to be translated from one switch to the next, or you could make it possible to change the order with a paint stroke or something. Are you willing to pay, though?
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Wow, Rudiger, you are simply amazing!
That thing is what Anime Studio should do by default! wow, it will be so easy to animate complex transformations now. I was thinking on a new add points tool with a checkbox for calculate or not the keyframes of the new points, could your script be modified like that?
And you read my mind (even before I thought it), I was thinking yesterday on the subway about the adjacent point moving detection to make the keyframes.
Could I see the script a little bit? :roll:
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

Aww, thanks, Selgin. I had it in my mind to write such a script for several years now, but every time I encountered the problem of having to add keys for new points, it always seemed like less effort to just go and fix them than write the script. However, now that I'm trying to apply my morph dials script to a horribly complex character, and it's something of a nightmare every time I just want to add a point to fix one of the morphs, as there was just no way of doing without breaking all of the other morphs. Now I can just hit a button, and they are all magically repaired!

And yes, you could integrate it into a modified add_points tool. I tried to explain that in my previous post, but it came out a little more convoluted than I planned.

Like I said, I want to add support of AS7's new curve calculation method, but after that I will think about releasing it.
User avatar
hothead
Posts: 213
Joined: Mon Apr 12, 2010 10:53 pm

Post by hothead »

Rudiger wrote:
selgin wrote:
hothead wrote:
OK, that's a little bit scary, Selgin. I recently wrote a script that does this! The only difference is I did it as a post-fix type tool, but you could probably just tack a reference to it onto the MouseUp method of a copy of the add_points tool, if you wanted it to work that way.

The way it works at the moment is, you just select the points you want to "fix" and it goes through the entire timeline (and actions if you specify them), and corrects the selected points on any frame where one of its adjacent points has a keyframe, but it, itself, does not.

It works quite well on AS6, but I imagine it would work even better with the new curves in AS7. The only problem is, I would have to figure out how they are calculated, unless we can somehow convince Mike to tell us his secret algorithm.

Hothead, I'm guessing what you want is something different. A script which reorders points in switch layers based on certain criteria. Should be possible. You could make it fully automatic by minimising the distance points have to be translated from one switch to the next, or you could make it possible to change the order with a paint stroke or something. Are you willing to pay, though?

Rudiger where can i find this script and i hope you come up with this tool soon i'll be praying since am how trying to do a character 360 on one layer this tool well help a lot
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

hothead wrote:
Rudiger wrote:
selgin wrote:
Rudiger where can i find this script and i hope you come up with this tool soon i'll be praying since am how trying to do a character 360 on one layer this tool well help a lot
Always, looking for eager, young beta testers! Which script are you saying you are interested in, though?
User avatar
hothead
Posts: 213
Joined: Mon Apr 12, 2010 10:53 pm

Post by hothead »

selgin wrote:
hothead wrote:basically vern your new magic tool :idea: can change the first or any other point that you add at the start of the square with any other point in the square instead of it of to match back with the first point added in layer 2 :D :D Genete, selgin and madrobot you other pro help me out here
From my experience, I can tell you it's easier to make the transformation by hand. It's always nice to have control over the number of points.
Anyway, there is a tool which could help you a little on transformations. It's called Replace Line, made by Fazek. You can find it on scripting section.

Now, about the idea, maybe the scripters can answer it. Would be possible to have an "intelligent add points" tool which calculates and keyframes a new point created on a frame different to zero?

It's hard to me to explain it, but I'll try. Imagine you have a circle and you animate it in 3 keyframes like in this image
Image
Now, let's suppose we add a point on frame 20. With normal add point tool, that point will be only keyframed on frame 20, being still from frame zero until 20. This way, our circle will look distorted on frame 1 and 10.
Image
Now, imagine you add a point using this "intelligent add point tool". This tool will create a keyframe on frame 1 and 10 for the new point, calculating the average position in relation where it have been added between two adjacent points and maintaining the desired structure.
Image

With my very very limited knowledge about scripting I can bet it could be possible to make this kind of tool. But, however, you are the experts, what do you think?
this script the one that let you add a point on a shape any where on the timeline. example when i move the points around in the ACTION window to make a pose let the head turn if i add a point in the action window timeline to form a smoother shape.
when i close the action window and open the blend morph window and add the pose on the timeline all the onginal points animate EXCEPT the point that i ADD IN THE ACTION WINDOW.
therefore i need a script to let the point move in sync with the two point that it is in between :idea:

me a young beta testers WOW thats greate i hope SMITHMICRO empoly me soon before someone else do :D like how am not working now
Post Reply