Shortcut for renaming Object to existing named Object?

Next
 From:  hairykiwi
3375.1 
Hi all,

Is it possible to quickly rename/append a selected object an existing Object's name by script or shortcut?

I'm currently manually editing each 'Unnamed' Object Name to be identical to the desired existing object name. (Or using copy-paste.)

Ideally I want to select an entity, then 'Ctrl + select-target-Object-name' in the Browser.


Thanks,
Hamish
  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
3375.2 In reply to 3375.1 
Hi Hamish, Ctrl+click on a name in the scene browser is already being used for something - it deselects the objects belonging to that set.

So it would not work very well to use that particular method, also trying to make a script that hooks into the scene browser is probably going to be difficult right now, it's not really set up to be extended by scripting.

But I can probably come up with some kind of script to help that works a bit differently than that, I'll take a look.

- 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:  Michael Gibson
3375.3 In reply to 3375.1 
Hi Hamish, here's a script that I think can help you out:

script: /* Match object name */ var name = ''; var objects = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.selected && obj.name != '' ) { name = obj.name; break; } } if ( name != '' ) { for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.selected && obj.name == '' ) { obj.name = name; obj.selected = false; obj.selected = true; } } }


To set up the script, go to Options > Shortcut keys, add in a new entry and paste in the above as the command part of the shortcut key.


The script works purely off of selection - to use it you must make a combined selection that includes at least one of the objects that already has the name assigned to it, along with other unnamed objects that you want to have assigned to that same name.

When you have a selection set up like that, then push the shortcut key and it will assign the unnamed objects to have that same name.

You can use the Scene browser to help you make the selection - right click on the object name in the scene browser to make it the "isolated selection" - everything else will get deselected and only those named objects will be selected. Then select the unnamed objects and then push the shortcut key.


I do have a plan for making this easier in the future - I want to have a drop-down menu that you can pop out from some things in the scene browser and one of the things I want to put on that menu is "assign to this name". That is part of the stuff that I also want to add in for Groups support when I get a chance to work on that area again in v3.

- 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:  DannyT (DANTAS)
3375.4 
An inherit button would be nice, where when you hit the button you can inherit, style, object name, and future line types etc. etc. from another object.

-
~Danny~
  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
3375.5 In reply to 3375.4 
Hi Danny, you mean that after pushing "inherit" you would then click on another object which would be taken as the source?

I think that would be useful as well, but not really so much for object name though - object names are kind of easier to see listed in the browser, so for names it would be nice to be able to just go to one of the things in the list in the browser and have some way to say "assign to this one".

But it would be useful for things that are more visual like styles.

Probably in the future that will end up being called "Match", and probably be a button that you could click inside of an extended object properties dialog box.

- 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:  DannyT (DANTAS)
3375.6 In reply to 3375.5 
Hi Michael,

Then 'Match' it is, that would be good, as for what you name it, I'm not too fused, maybe 'Clone' or 'Suck the properties' :)

Cheers
~Danny~
  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
3375.7 In reply to 3375.6 
I'm sure there will also be at some point.... "SuckThePropertiesOfMatchAndCloneExistingMorphObligations" tool someone will need at some point :o
  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:  hairykiwi
3375.8 
Hi Michael,

That does the trick nicely, many thanks. Saved in my shortcuts as Ctrl+M. (That doesn't appear to clash with the other documented shortcuts.)

I guess I've started using Objects in a similar way that I envisage using Groups, when they're implemented.

I'd be interested to hear how others are referencing their geometry, so far as being able to rebuild a sub-part without, say, winding their file back to an earlier version.

Speaking of which, does anyone use file version control? I have an app that saves a new version each time I do a save within MoI. It works well and has been useful, but it's a bit unwieldy in that there's no image saved as a reminder of where I was at at any particular version. I can append a note to each version, but quickly get bogged down in the semantics of describing subtle changes to a part's features.

So, any 'construct management' tips much appreciated.

EDITED: 13 Mar 2010 by HAIRYKIWI

  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
3375.9 In reply to 3375.8 
MoI has an Incremental Save shortcut, but this doesnt do the "thumbnail" thing yet. Also remember that "Import and Export" do "Just the selected parts". So you can Select a single object you would like to refer to sand save it to a specific name in your construction folder, then if need for any scene, import the part in. You could build massive scenes and only keep one object loaded at any time. The new "Part import tool" is very powerful 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
 From:  hairykiwi
3375.10 In reply to 3375.9 
Thanks BurrMan, I'll have a play with that.

Hamish
  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