Python Scripting - Set name whilst Duplicating

Discussions concerning programming of SOFTIMAGE©
chrisbore
Posts: 4
Joined: 03 Sep 2010, 11:03

Python Scripting - Set name whilst Duplicating

Post by chrisbore » 22 Sep 2010, 10:39

Is there away of specifying the name of the new object whilst duplicating? or least selecting the newly created object?

I have a script I'm writing thats going to be replacing a load of objects with objects from a generic library, so I need to know the name of the newly duplicated object, whether I do it directly and set the name while I'm duplicating or my duplicate command selects the new object on its creation and get the name from the selection.

I have tried both the SIDuplicate and Duplicate commands.

Anybody have any good ideas?

Cheers

Chris

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: Python Scripting - Set name whilst Duplicating

Post by Hirazi Blue » 22 Sep 2010, 10:48

Doesn't the SIDuplicate command return a list of duplicates just created, that you can store in a variable while issuing the command?
something like

Code: Select all

thislist = Application.SIDuplicate(a lot of parameters)
You then should be able to extract individual items from this list and select them...
(Or even get to their names, obviously)

Or am I missing the point completely?
Stay safe, sane & healthy!

chrisbore
Posts: 4
Joined: 03 Sep 2010, 11:03

Re: Python Scripting - Set name whilst Duplicating

Post by chrisbore » 22 Sep 2010, 10:51

Was just typing that I'd sorted - cheers for the help...

Should have read the docs before posting!

Either of the duplicate commands (Duplicate / SIDuplicate) return a list of the duplicated objects which is exactly what I needed

Cheers

Chris