Share your favorite MoI scripts

Next
 From:  Metin Seven (SEVENSHEAVEN)
6992.1 
Hi guys,

I figured it'd be nice if we'd share our favorite MoI scripts in this topic (favorite custom commands are welcome as well).

Please include explanatory comments, thanks.

I'll kick off with my favorite scripts:

———————

script: /* Toggle visibility of all curves */ var objs = moi.geometryDatabase.getObjects().getCurves(); var ishidden = objs.length > 0 ? objs.item(0).hidden : false; objs.setProperty( 'hidden', !ishidden );
script: /* Toggle edge display */ var breps = moi.geometryDatabase.getObjects().getBReps(); var hide = true; for ( var i = 0; i < breps.length; ++i ) { var edges = breps.item(i).getEdges(); if ( i == 0 ) hide = !edges.item(0).hidden; edges.setProperty( 'hidden', hide ); }

script: /* Click and drag mouse to spin (roll) view */ moi.view.spinInteractive();
script: /* Reset view tilt */ moi.ui.getActiveViewport().tiltAngle = 0.0;

script: /* CPlane */ moi.view.setCPlaneInteractive();
script: /* Set CPlane to current view */ moi.view.setCPlane( moi.ui.mainWindow.viewpanel.getViewport('3D').targetFrame );
script: /* Reset CPlane to default */ moi.view.resetCPlane();

script: /* Toggle quad view */ if ( moi.ui.mainWindow.viewpanel.mode != 'split' ) { moi.ui.mainWindow.viewpanel.mode = 'split' } else { var viewport = moi.ui.getViewportUnderMouse(); if ( viewport ) { viewport.viewPanel.mode = viewport.name } }

script: /* Isolate selection */ moi.geometryDatabase.isolate();
script: /* Hide unselected */ moi.geometryDatabase.invertSelection(); moi.geometryDatabase.hide(true);
script: /* Select objects to unhide */ moi.geometryDatabase.showSubset();

script: /* Select edges v1.2 */ var gd = moi.geometryDatabase; function sl(o) { for ( var i = 0; i < o.length; ++i ) { o.Item(i).selected = 0; var e=o.Item(i).getEdges(); for ( var j = 0; j < e.length; ++j ) e.Item(j).selected = !e.Item(j).selected;}} gd.selectLoop(); var so = gd.getSelectedObjects(); var e = so.getEdges(); sl(so.getFaces()); sl(so.getSolids()); so.getBReps().setProperty('selected',0); e.setProperty('selected',1);

script: /* Select naked edges (open borders) */ var gd = moi.geometryDatabase; gd.deselectAll(); var breps = gd.getObjects().getBreps(); for ( var i = 0; i < breps.length; ++i ) breps.item(i).getNakedEdges().setProperty( 'selected', true );

script: /* Grow face selection */ function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',1);}} var so = moi.geometryDatabase.getSelectedObjects(), sf=so.getFaces(), i; for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges()); es(so.getEdges());

script: /* Shrink face selection */ function es(edg){ var i,f; for (i=0; i<edg.length; i++) {f=edg.item(i).getFacesOfEdge(); f.setProperty('selected',0);}} var gd = moi.geometryDatabase; gd.invertSelection(); var so = gd.getSelectedObjects(), sf=so.getFaces(), i; gd.invertSelection(); for ( i=0; i<sf.length;i++) es(sf.item(i).getEdges());

script: /* Front view */ var vname = 'Front'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* Back view */ var vname = 'Back'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* Top view */ var vname = 'Top'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* Bottom view */ var vname = 'Bottom'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* Right view */ var vname = 'Right'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* Left view */ var vname = 'Left'; var vp = moi.ui.mainWindow.viewpanel; vp.mode = vname; if ( vp.getViewport(vname).name != vname ) vp.reverseView( vname );
script: /* 3D view (perspective or isometric) */ moi.ui.mainWindow.viewpanel.mode = '3D';

script: /* Show all in viewports */ moi.view.resetAll();

———————

Many thanks to the creators of these helpful scripts!

EDITED: 23 Oct 2014 by SEVENSHEAVEN

  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:  Max Smirnov (SMIRNOV)
6992.2 In reply to 6992.1 
script: /* Select edges v1.4 */ var gd=moi.geometryDatabase, so=gd.getSelectedObjects(); function ss(o,v){o.setProperty('selected',v)} function sl(o){ for ( var i=0; i<o.length; ++i ) o.item(i).getEdges().invertProperty('selected');} gd.selectLoop(); sl(so.getFaces()); sl(so.getSolids()); sl(so.getOpenBReps()); sl(so.getSingleFaceBReps()); ss(so.getBReps(),0); ss(so.getFaces(),0);
(I rewrote this my old script. Joined surfaces support has been added. Now it will work better than before.)

script:/* Wireframe mode v1.0 */ var gd = moi.geometryDatabase; var so=gd.getSelectedObjects(); if (so.length>0) { so.setProperty( 'displayMode',1); so.setProperty( 'selected', 0); } else { gd.getObjects().setProperty( 'displayMode',0); }
(I use it more often than all the other scripts put together)
  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:  Metin Seven (SEVENSHEAVEN)
6992.3 In reply to 6992.2 
Thanks Max. I'm going to try them right away!

— Metin

———————

metinseven.com — 3D (print) design • animation • artwork • illustration • visualization

  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:  BurrMan
6992.4 In reply to 6992.3 
lol....

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:  Metin Seven (SEVENSHEAVEN)
6992.5 In reply to 6992.4 
Hahahah! Do you ever go outside, Burr? ㋡

Which are the five to ten scripts you couldn't live without?

By the way, I see a lot more scripts in your screenshot than can be found on Petr's MoI page. Is there another script repository or should I just search for "script" over here at the MoI forum?
  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:  BurrMan
6992.6 In reply to 6992.5 
Hi metin,

I like to think i have them all, but the forum was around a bit
Before i joined, so i may be missing some of the early gems...

I doubt you can find them all with a search (maybe a wildcard
Search containing only something found in a script)... but i would bet michael has some type of documentation on what he's done...

5 or 10 favorites? I'll have to ponder it for a minute...

I've thought about providing them, but i forgot to document
Them from the begining, and i've named them and forgot most
Of their purposes, being how most were made for very specific things. Also, michael plans on creating a repository for moi at some point....
  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:  BurrMan
6992.7 In reply to 6992.6 
Also, i think frenchy started a weebly repository once, which will have a link i dont know right now....
  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:  Metin Seven (SEVENSHEAVEN)
6992.8 
Sounds good.

Pilou, if you happen to read this, I'd love to know undiscovered MoI script sources.

Have a nice weekend y'all.
— Metin ——————— metinseven.com — 3D (print) design • animation • artwork • illustration • visualization
  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)
6992.9 In reply to 6992.8 
Some scripts are repository here! ;)
http://moiscript.weebly.com/
It's a site in French but Name of scripts are in English and original places are genraly given and some images or videos of use! ;)
Have fun surfing! (Its about Moi's prog but there are also some other little things! (section Divers) ;)
  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:  Metin Seven (SEVENSHEAVEN)
6992.10 In reply to 6992.9 
Merci beaucoup, Pilou!

— Metin

———————

metinseven.com — 3D (print) design • animation • artwork • illustration • visualization

  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