MoI discussion forum
MoI discussion forum

Full Version: Small Feature Wish

Show messages:  1-13  14-21

From: Frenchy Pilou (PILOU)
15 Sep 2010   [#14]
"Select only 'compound' paths" can
be put on a shortcut?

If Yes what is the syntax?
From: Kiril
15 Sep 2010   [#15] In reply to [#14]
Hi Pilou,

It suffices to follow the normal method of adding a shortcut, and adding:

script:var crvs = moi.geometryDatabase.getObjects().getCurves(); for ( var i = 0; i < crvs.length; ++i ) { var crv = crvs.item(i); if ( crv.getSubObjects().length> 1 ) crv.selected = true; }

With all credit for the script given to Michael, ofcourse.
From: Frenchy Pilou (PILOU)
15 Sep 2010   [#16] In reply to [#15]
Thx, it was for the end of the line that I had some doubt :)
From: Frenchy Pilou (PILOU)
15 Sep 2010   [#17] In reply to [#16]
there is not something false in the script?
Seems it keep in memory previous joined lines!

If I launch the script whith the yellow curves selected, the other curve becomes yellow too !!!
Is that normal?

Image Attachments:
normal.jpg 


From: Kiril
15 Sep 2010   [#18] In reply to [#17]
I've made a small change to the script that will clear all previous selection and then proceed to look for only compound curves:
code:
moi.geometryDatabase.deselectAll(); var crvs = moi.geometryDatabase.getObjects().getCurves(); for ( var i = 0; i < crvs.length; ++i ) { var crv = crvs.item(i); if ( crv.getSubObjects().length> 1 ) crv.selected = true; }

This is actually a good idea, since it will avoid mistaken identification.

Confusion may also arise after having used the "Rebuild" function with the "Refit" option. In this mode only curviture continuous stretches of a compound curve are rebuilt into a single entity; this results in the possibility of a compound curve even after a "rebuild". To avoid this use the "# points" option("keep corners" turned off); since this mode is not adaptive you will need many points - by running the rebuild function a second time, with the "Refit" option, this problem can be avoided.

If your asking why "previous joined lines" are selected: this is the purpose of the script :) - the idea is to select these charlatans :) and 'rebuild' them, this way avoiding spikes/kinks while editing.
From: Frenchy Pilou (PILOU)
15 Sep 2010   [#19] In reply to [#18]
<this way avoiding spikes/kinks while editing.
I had well understood :) but not for the curves who are some kilometers away :)
From: Michael Gibson
15 Sep 2010   [#20] In reply to [#18]
Hi Kiril, also if you want more info about scripting, one way is to look at existing scripts but also see here:
http://moi3d.com/wiki/Scripting

for some additional information. See David's page for some documentation on what properties and methods are available on each MoI class, and also you can get the moi.idl file there which contains a all the stuff that is accessible to scripting in it.

- Michael
From: Kiril
15 Sep 2010   [#21] In reply to [#20]
Thanks Micheal, I'm quite content with the level of customization I can achieve now - I shall wait for something akin to JQuery for MoI :) before I invest much more time into scripting.

Cheers,

Kiril

Show messages:  1-13  14-21