Selection questions
 1-17  18-22

Previous
Next
 From:  Michael Gibson
9147.18 In reply to 9147.17 
Hi Bravlin,

re:
> Maybe we can somehow reach UI style selection functions (those that fires up when we press near
> style gui to select all obj)?
> They sure doesn't have any performance issues.

There isn't any way set up to access that from script right now but I can add script access to it for the next v4 beta.

Just to make sure I understand, you mean a way to trigger by script the same thing that happens when you click on this selection dot spot in the scene browser? :


- 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:  Bravlin
9147.19 
Yes. I guess the similar query interface will be handy for a group selection also.
  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:  Bravlin
9147.20 
Theas thread helps with performance issue a lot.
http://moi3d.com/forum/messages.php?webtag=MOI&msg=6440.1

script: /*SAVE SELECT TO STYLE*/moi.command.execCommand ('var gd = moi.geometryDatabase; var activstyleidx = moi.geometryDatabase.activeStyle; var objects = gd.getObjects(); var savedobjsnum = 0;var si = moi.geometryDatabase.findStyle( "selectset", true ).index; for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if(obj.styleIndex == si){ obj.styleIndex=activstyleidx; obj.selected=true; savedobjsnum +=1; } else { if(obj.isBRep) { var subs = obj.getSubObjects(); for ( var j = 0; j < subs.length; ++j ) { var sub = subs.item(j); if(sub.styleIndex == si){sub.styleIndex=activstyleidx; sub.selected=true; savedobjsnum +=1; }}}}}if(savedobjsnum == 0){var selobjects = gd.getSelectedObjects(); selobjects.setProperty( "styleIndex", si ); }');
  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
9147.21 In reply to 9147.20 
Hi Bravlin, some of the advice in that thread is outdated now as of MoI v4. In v4 MoI no longer runs command scripts in a separate process, they are run inside the main MoI process and so there is no longer any performance gain from moving functions from a .js file into the .htm file.

- 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:  Bravlin
9147.22 
XSI-like hide toggler. Hide and unhide only last selected object (in our case last named object).

script: /*HIDE*/ var selobjs = moi.geometryDatabase.getSelectedObjects();if(selobjs.length > 0){var allobjs = moi.geometryDatabase.getObjects();for ( var i = 0; i < allobjs.length; ++i ){var obj = allobjs.item(i);if(obj.name == "lasthide")obj.name="";}selobjs.SetProperty("name", "lasthide");selobjs.SetProperty("hidden", true);}else{moi.geometryDatabase.selectNamed("lasthide");selobjs = moi.geometryDatabase.getSelectedObjects();selobjs.SetProperty("name", "");selobjs.SetProperty("hidden", false);}
  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-17  18-22