Free transform tool

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

Moderators: Víctor Paredes, Belgarath, slowtiger

ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Free transform tool

Post by ponysmasher »

Image

The script:
ds_distort.zip

The button "Reset distortion points" is for when you want to start on a new mesh or if you just want to reset the distortion points to a square shape:
Image

And here's a tip for scripters that I learned the hard way:

Code: Select all

myVectorPoint = mouseEvent.vec
... is NOT just a cleaner way of writing:

Code: Select all

myVectorPoint.x = mouseEvent.vec.x
myVectorPoint.y = mouseEvent.vec.y
The latter just gives you the values (which was what I wanted) while the former turns myVectorPoint into an instance (or whatever it's called) of mouseEvent.vec which means that myVectorPoint will keep jumping to the mouse position even when you don't want it to.
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Re: Free transform tool

Post by Breinmeester »

My friend, your new tools are amazing! As if you can read my mind. Thanks so much!
jonbo
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

Re: Free transform tool

Post by jonbo »

Thanks Pony, this will be much easier to use than the perspective tools. You da man!!! :D
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: Free transform tool

Post by ulrik »

Great tool!! Thank you for sharing your scripting skills with us mortal :D
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Free transform tool

Post by Víctor Paredes »

Wow, this tool really should replace the current perspective points tool.
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
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Re: Free transform tool

Post by ponysmasher »

selgin wrote:Wow, this tool really should replace the current perspective points tool.
Actually Perspective points and this tool will give you slightly different results. Perspective points has "real" perspective calculated according to a virtual camera.
Comparison:
Image
As you can see, Perspective points looks more like in real life.
But it's a pain trying to line up points to a 2D image with the Perspective points tool, and photo realistic representations are not always desirable.

Also, try doing this with Perspective points:
Image
:P
User avatar
Lukas
Posts: 1294
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Free transform tool

Post by Lukas »

THANK YOU!
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Free transform tool

Post by hayasidist »

ponysmasher wrote: And here's a tip for scripters that I learned the hard way:

Code: Select all

myVectorPoint = mouseEvent.vec
... is NOT just a cleaner way of writing:

Code: Select all

myVectorPoint.x = mouseEvent.vec.x
myVectorPoint.y = mouseEvent.vec.y
you have just explained something that had been confusing me for ages .... sometimes the "cleaner" way worked (or at least seemed to!) and sometimes it didn't....

thank you!!
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Re: Free transform tool

Post by Breinmeester »

Same goes for:

Code: Select all

vec = point.fPos
It makes an instance. So if you change vec, the point's position will change on screen as well.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: Free transform tool

Post by chucky »

Great tool, truly awesome and useful.
Wow, this tool really should replace the current perspective points tool.
I have to disagree Victor, this one is certainly different and excellent, the other has some of its own uniquely relevant purposes.
User avatar
Lukas
Posts: 1294
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Free transform tool

Post by Lukas »

I would loooove to have a version with 8 points instead of 4.

Code: Select all

4 points:
.___________.
|           |
|           |
|           |
|           |
|           |
.___________.

8 points:
._____._____.
|           |
|           |
.           .
|           |
|           |
._____._____.
I have no idea how hard this would be to make, but I could sure use it.
User avatar
biblesinger
Posts: 23
Joined: Sun Apr 14, 2013 1:00 am

Re: Free transform tool

Post by biblesinger »

Please forgive for resurrecting this old thread, but i'm just not 'getting' how this tool is supposed to work? The animated gif pic, above, shows text being manipulated by the ds distort script tool, and NOT a vector shape, but vector shapes is the only thing this tool affects for me. It's greyed out whenever i create a new text layer so i can't use it to affect the text. What am i missing here? Thanks a million --- this tool would be awesome to use on text!

Tim
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Re: Free transform tool

Post by heyvern »

biblesinger wrote:Please forgive for resurrecting this old thread, but i'm just not 'getting' how this tool is supposed to work? The animated gif pic, above, shows text being manipulated by the ds distort script tool, and NOT a vector shape, but vector shapes is the only thing this tool affects for me. It's greyed out whenever i create a new text layer so i can't use it to affect the text. What am i missing here? Thanks a million --- this tool would be awesome to use on text!

Tim
When creating text there is a check box to Create Text Layer. A text layer doesn't have points, and the text can be edited after you created it. If you uncheck that box when creating your text, the outlines of the text you type are converted to vector points. If you use that option the text can not be edited. This is the same as "Create Outlines" of text or a text layer in a program like Adobe Illustrator or Photoshop.

This checkbox is grayed out if the selected layer is NOT a vector layer. In order to create vector text you have to have a vector layer created and selected first. This box is usually checked by default.
User avatar
biblesinger
Posts: 23
Joined: Sun Apr 14, 2013 1:00 am

Re: Free transform tool

Post by biblesinger »

Thanks heyvern for the help. Perfect! That did it.
Ya know, i looked at those two check boxes, just over the 'scale' slider, and missed them both times (i'm 56, so there ya go).

I've also been an apprentice to some of your vids so thanks for that as well. I'll give back to the forum after i
go intermediate then advanced. Thanks again..

Tim
Breinmeester
Posts: 303
Joined: Thu May 13, 2010 2:01 pm

Re: Free transform tool

Post by Breinmeester »

Hi Dauid,

I use tool a lot, especially on our current project. But i noticed it doesn't work when onionskinnig is on. The points snap back to their fAnimPos on mouse release. I have the same problem on my multi-layer magnet tool. If you or anybody else know how to fix it, it would be very welcome.
Post Reply