Hi Michael,
Thank you a lot,
>> - Group selection: I use your script that groups selected objects by name (object_0001, object_0002,..).
>> Is it possible to make this script loop through named objects? (if one group is selected / nothing is selected)?
> Sorry I'm not understanding what you want with this part, can you describe it in some more detail please?
I meant that if we have a named object that is selected, it deselects it and selects the next named object in the list (looping through the list continuously).
I find that useful because it allows me to jump between object groups that I make with this script:
script: /* Assign unique object name to selection */ var all_objects = moi.geometryDatabase.getObjects(); var used_names = new Array(); for ( var i = 0; i < all_objects.length; ++i ) { var obj = all_objects.item(i); if ( obj.name != '' ) { used_names[obj.name] = true; } } var counter = 1; var name; while ( 1 ) { var numtag = counter.toString(); while ( numtag.length < 4 ) { numtag = '0' + numtag; } name = 'object_' + numtag; if ( used_names[name] ) { ++counter; continue; } used_names[name] = true; break; } moi.geometryDatabase.getSelectedObjects().setProperty( 'name', name );
This might be a niche functionality that other users won't find very useful though.
|