shortcut: select everything with the same name.

Next
 From:  noskule
4780.1 
Hi all
Is there a way to extend the current selection with all elements which have the same name than the current selected element?
Thanks for any hints
nos
  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
4780.2 In reply to 4780.1 
Hi nos - here is a script which you can paste in as the command part on a shortcut key for that. When triggered, it will go through and select any objects which have the same name as one that is already currently selected.

script: /* Extend selection to same names */ var names = new Array(); var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name != '' ) names[obj.name] = true; } objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name != '' && names[obj.name] ) obj.selected = true; }
  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:  Rich_Art
4780.3 In reply to 4780.2 
lol Ask it and Michael fix it. :-)
Nice script thanks...

Peace,
Rich_Art. ;-)

| C4DLounge.eu | Our Dutch/Belgium C4D forum. Cinema4D R13 Studio + VrayForC4D + UVLayout Pro + 3DCoat + MoI
  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:  noskule
4780.4 
cool thanks, this really speeds up my workflow. I noticed if the script only selects object which are visible. Could this be changed so that it would select all object and make the hidden objects visible?
  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:  Michael Gibson
4780.5 In reply to 4780.4 
Hi nos,

> I noticed if the script only selects object which are visible. Could
> this be changed so that it would select all object and make the
> hidden objects visible?

Yup, this is possible by making a small change to the script, here is a version that should behave like you're asking about:

script: /* Extend selection to same names */ var names = new Array(); var objs = moi.geometryDatabase.getSelectedObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name != '' ) names[obj.name] = true; } objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name != '' && names[obj.name] ) { obj.hidden = false; obj.selected = true; } }

- 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
 

Reply to All Reply to All