Script request
All  1-16  17-20

Previous
Next
 From:  Michael Gibson
8230.17 In reply to 8230.15 
Hi nameless, you can try this for assigning a generic name "object_1", "object_2", etc.. to all current unnamed objects:

script: /* assign names to unnamed objects */ var objs = moi.geometryDatabase.getObjects(); var counter = 0; var current_names = []; for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name ){ current_names[obj.name] = true; } } for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.name ) { continue; } ++counter; var name = 'object_' + counter; while ( current_names[name] === true ) { ++counter; name = 'object_' + counter; } obj.name = name; }

- 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:  nameless
8230.18 
Thanks Pilou and Michael,

These both work!

I was wondering- Is there a way or a "bridging" script that can run 2 commands one after the other with a single shortcut? That would help script illiterates like me to be able to cook two commands together. I understand that this could potentially create unexpected problems with dialogues and stuff but it was worth a try :))

Thank you for that naming script Michael! I badly needed it, as I rarely name things, I work messy as hell :|
  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
8230.19 In reply to 8230.18 
Hi nameless,

re:
> I was wondering- Is there a way or a "bridging" script that can run 2 commands one
> after the other with a single shortcut?

Not currently but that is something that I want to add.

- 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:  nameless
8230.20 In reply to 8230.19 
Hi Michael,

Awesome! Happy it's on your radar :D
  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: All  1-16  17-20