easy script request

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

Moderators: Víctor Paredes, Belgarath, slowtiger

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

Post by heyvern »

Got it. Yes I agree Selgin. It wouldn't be possible with a "non closed shape" to have "auto strokes". I guess I was thinking of a closed shape created with the add point tool. It has auto fill but not auto stroke.

The trouble with some of these ideas is that they sound good in general terms at first glance... but as you start working out the details you end up with 50 bazillion "what if this happens or what if I did that or this how would that work?". ;)

It would be nice though if adding a point to the END Of a stroke shape could extend the shape. I may have to study the tool scripts to see how hard this might be. It works when adding points INSIDE an existing stroke shapes.
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

heyvern wrote:Got it. Yes I agree Selgin. It wouldn't be possible with a "non closed shape" to have "auto strokes". I guess I was thinking of a closed shape created with the add point tool. It has auto fill but not auto stroke.

The trouble with some of these ideas is that they sound good in general terms at first glance... but as you start working out the details you end up with 50 bazillion "what if this happens or what if I did that or this how would that work?". ;)

It would be nice though if adding a point to the END Of a stroke shape could extend the shape. I may have to study the tool scripts to see how hard this might be. It works when adding points INSIDE an existing stroke shapes.
As far as I know, there's currently no way in the scripting interface to explicitly add points to an existing shape. The point that gets added to a shape, when you add a point to a curve that is already part of the shape, happens internally to the program and is not dependent on the scripting interface.

However, there's nothing stopping you from getting all of the attributes of the shape, deleting it, then creating a new shape which includes the extra points. The user probably wouldn't know the difference, but it might take quite a bit of work to make sure nothing gets lost when you delete the shape.

An alternate idea to modding the add point tool would be to mod the freehand tool, which only draws the shape at the end. For example, you would go click, click, click, click, ..., to define the points of your polyline while getting a red preview of the shape you are creating, then double-click and the shape would be created with your created points. I already have something like this working, but only with a single point at the moment.
Post Reply