Super easy script question (i think)


Hi there,

I am a pretty naff scripter but from time to time i need to do this and I can’t figure it out. (it’s a hard one to search for but i’m sure it’s dead simple)
If i had a sphere, say and I wanted to change it’s name via scripting to ‘ball’, I could
SetValue(“sphere.Name”, “Ball”, null); How could I do something like that, but to whatever the currently selected item was?
I guess it would look something like this? - SetValue(“SELECTED.Name”, “Ball”, null);



This is how I do it:

var o = GetValue("SelectionList");

o(0).name = "foo";



You can also use the Object Model

Selection(0).Name = “Ball”;


There’s a scripting subforum for such threads.
Moving it for you, next time please post in the correct forum.


Cool, thanks guys!
It was killing me trying to search for that :slight_smile:
And I hadn’t realised there was a scripting subforum here. Cool.


Just expanding on this a bit, would there be a way to use this script
Selection(0).Name = “Ball”;
but make it so it appends the name that is already there?


yes, how you do it depends from the language.

the pseudo code would be in form: += “suffix”
or = + “suffix”


Awesome that works great! This is going to make it heaps easier when i am naming hundreds of rigging nodes!


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.