Small Feature Wish
 1-9  10-21

Previous
Next
 From:  Michael Gibson
3756.10 In reply to 3756.8 
Oops, missed this one:

> I would still find it useful to pu the "Plane" button
> in said toolbar - left click = activate right click =
> reset(assuming this is possible).

For this one, open up the file SidePane.htm, that contains all the palettes of stuff on the right-hand side, then go to the cplane button (search for the text CPlane, it's on line #617) and copy out the <moi:CommandButton> for it, paste that into the end of the CommandBar.htm file and you'll have the cplane button down there on the bottom.

You can move other buttons over the same way. Some buttons are part of a "command set", like the little booleans menu thing, those buttons are actually in small .htm files in the \commands sub-folder, like the boolean menu is in the file Booleans.htm in that commands folder, the buttons for the individual boolean commands are in there.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3756.11 In reply to 3756.10 
Does this sort of moves buttons will be more easy in the V 3?
An easy "building interface" by the advanced user or modeling functions are more priority?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3756.12 In reply to 3756.11 
Hi Pilou, I think that some easier UI configuration stuff will get some attention in v3, but it remains to be seen how much exactly.

I don't think I'm going to try to do a "drag/drop" type arrangement of buttons but instead have something like a UI organization dialog type thing. No totally set plans yet though.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Kiril
3756.13 In reply to 3756.9 
The script works perfectly Michael, also thanks for taking the time to explain the procedure of adding buttons.

I've managed to implement the buttons I wanted:


I did make an attempt at combining Join and Rebuild in a single click, thinking that I could stuff the "DoRebuild()" and "DoJoin()" functions together in a new function Joinrebuild.js
and call that as a command - but did not work out - so left click = Join & Right click = Rebuild.

In the spirit of learning and trying to understand MoI scripting I analyzed your script and annotated its working with comments - first for myself and now for anyone else interested:

Get all curves in the workspace, store them in the array 'crvs'.
var crvs = moi.geometryDatabase.getObjects().getCurves(); 


Look at each curve in the scene, incrementally, where curvs.length refers to the number of curves in the array 'crvs'.:
for ( var i = 0; i < crvs.length; ++i ){	


Get the item(which itself is an array) in the array 'crvs' in position 'i''(a digit set by the previous declaration)(array entries are numbered from 0, so i=0 makes sense).
var crv = crvs.item(i); 


Assuming a compound curve is a single entry in the 'crvs' array, look at the 'SubObjects' property of that curve(an array) - specifically its 'length' or number of entries.Since a compound path will contain multiple sub-curves/"[..]objects" we would expect length to be>1 - in this case select it.
if ( crv.getSubObjects().length > 1 ) crv.selected = true; }


Regards,

Kiril

EDITED: 15 Sep 2010 by KIRIL

Image Attachments:
Size: 20.8 KB, Downloaded: 48 times, Dimensions: 505x92px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3756.14 
"Select only 'compound' paths" can
be put on a shortcut?

If Yes what is the syntax?
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Kiril
3756.15 In reply to 3756.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.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3756.16 In reply to 3756.15 
Thx, it was for the end of the line that I had some doubt :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3756.17 In reply to 3756.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?

EDITED: 15 Sep 2010 by PILOU

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Kiril
3756.18 In reply to 3756.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.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3756.19 In reply to 3756.18 
<this way avoiding spikes/kinks while editing.
I had well understood :) but not for the curves who are some kilometers away :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3756.20 In reply to 3756.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Kiril
3756.21 In reply to 3756.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-9  10-21