Locking Points

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Locking Points

Post by DK »

Is there a way to lock points so that they do not pass a particular point? even if they are bound to bones? Is it possible to write a script that could do this?

I have been looking at applying this idea to the scale rotate technique to prevent detail lines on a face going past a certain point in a head turn. You cold also use such a script to apply to pouring fluids onto a specific area. Currently trying to mask lines out is almost impossible but If you were abe to crunch down all points in a line to a small group as the bone rotated or moved it would be a lot easier to mask out.

Any help suggestions?

D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Hi DK!
have you seen my FREEZE points script?
There is a link in my signature to the my scripts in the forum.
I hope it is what you're looking.
Best
-G

PS: Nah! you're looking for a "limit X or Y position" for points. I guess this script can be modified to do something like you need.
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Hi Genete :)

I'm eagerly having a look now!!!!!

Cheers
D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

DK, please look again to my signature link. I've modified the scripts and now you can limit by X or by Y the movements of the points. Even using bones!!

Best
-G
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

A dropping sample. To make it vertical just rotate the layer :wink:

Image

It is a little tricky. I've created the animation with point motion and some keyframes. But between keyframes I selected only the points that are not flatten so the rest is kept in the wall.

-G
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Wow...that's brilliant Genete!!! A script like this will be well used I imagine. I can't wait to try it out!
Imagine growing plants, trees etc.

D.K
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

I installed the scripts but there are now lua consoles poping up every time i try to do anything in AS?

D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

DK wrote:I installed the scripts but there are now lua consoles poping up every time i try to do anything in AS?

D.K
It is normal.
When you run the script it looks if the table where the points positions are stored exists. If it doesn't exists the script complains and tell you: "table layer". If it is so annoying I can remove it.
It is like a remind to you tell you that you have to store the freeze position of the points. When you do that then a bunch of info is drop to the console and the "table layer" message wont never appear (well, when you open the file again it reappears)

Remember:

ge_freeze_points.lua >>>> scripts/tools
ge_select_frozen_poins.lua >>>> scripts/menu
ge_freeze_points.png >>>> scripts/tools
and add the

Code: Select all

button ge_freeze_points   ...
to your _tool_list.txt

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

Post by heyvern »

It might be better to use an alert box rather than the lua console. I can take a look at the code and see how this might work.

Easier to close out an alert using the return key than to close the lua console.

-vern
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

You guys are amazing with your scripts :)
Many thanks

D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Vern,
please feel free to change or improve what you consider!

DK, please post your progresses if the script is used :)

-G
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Vern. It would be great if you could take the lua console out of the script as it makes it very hard to work in AS when there are boxes poping up.

Thanks to you both!
D.K
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

DK wrote:Vern. It would be great if you could take the lua console out of the script as it makes it very hard to work in AS when there are boxes poping up.

Thanks to you both!
D.K
I just minimize the lua console.
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Ahh...thanks Genete. I'll try that instead of closing it.

EDIT: This is a handy script but it seems to me that you have to maipulate each point to an x,y co-ordinate then run the freeze script so that when the shape moves through these particular co-ordinates the points will not pass?. Is this correct?

D.K
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Genete wrote:
DK wrote:Vern. It would be great if you could take the lua console out of the script as it makes it very hard to work in AS when there are boxes poping up.

Thanks to you both!
D.K
I just minimize the lua console.
can't do that on a mac. :)

-vern
Post Reply