Free transform tool

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Free transform tool

Postby ponysmasher » Sat May 19, 2012 6:17 pm

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.
User avatar
ponysmasher
 
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles

Re: Free transform tool

Postby Breinmeester » Sat May 19, 2012 6:21 pm

My friend, your new tools are amazing! As if you can read my mind. Thanks so much!
Breinmeester
 
Posts: 289
Joined: Thu May 13, 2010 2:01 pm

Re: Free transform tool

Postby jonbo » Sat May 19, 2012 6:56 pm

Thanks Pony, this will be much easier to use than the perspective tools. You da man!!! :D
User avatar
jonbo
 
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

Re: Free transform tool

Postby ulrik » Sat May 19, 2012 7:37 pm

Great tool!! Thank you for sharing your scripting skills with us mortal :D
ulrik
 
Posts: 1060
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden

Re: Free transform tool

Postby Víctor Paredes » Sat May 19, 2012 8:41 pm

Wow, this tool really should replace the current perspective points tool.
Víctor Paredes - Former Moho 12 Product Manager
My Youtube Channel - My webinars
User avatar
Víctor Paredes
 
Posts: 4735
Joined: Wed Jan 26, 2005 12:18 am
Location: Chile

Re: Free transform tool

Postby ponysmasher » Sat May 19, 2012 11:02 pm

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
ponysmasher
 
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles

Re: Free transform tool

Postby Lukas » Mon May 21, 2012 11:28 am

THANK YOU!
User avatar
Lukas
 
Posts: 717
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands

Re: Free transform tool

Postby hayasidist » Mon May 21, 2012 1:56 pm

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!!
User avatar
hayasidist
 
Posts: 1595
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Free transform tool

Postby Breinmeester » Mon May 21, 2012 4:34 pm

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.
Breinmeester
 
Posts: 289
Joined: Thu May 13, 2010 2:01 pm

Re: Free transform tool

Postby chucky » Mon May 28, 2012 2:15 pm

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.
Sequential offender.
my latest animations
User avatar
chucky
 
Posts: 3300
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land

Re: Free transform tool

Postby Lukas » Mon May 28, 2012 4:43 pm

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
Lukas
 
Posts: 717
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands

Re: Free transform tool

Postby biblesinger » Sat Apr 27, 2013 9:07 am

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
biblesinger
 
Posts: 23
Joined: Sun Apr 14, 2013 1:00 am

Re: Free transform tool

Postby heyvern » Sat Apr 27, 2013 3:44 pm

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
heyvern
 
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Re: Free transform tool

Postby biblesinger » Sun Apr 28, 2013 3:38 am

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
User avatar
biblesinger
 
Posts: 23
Joined: Sun Apr 14, 2013 1:00 am

Re: Free transform tool

Postby Breinmeester » Fri Nov 15, 2013 11:06 am

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.
Breinmeester
 
Posts: 289
Joined: Thu May 13, 2010 2:01 pm

Next

Return to Scripting

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest