PDA

View Full Version : How to get object name in XSI use python?


sunboy69
02-26-2009, 03:56 AM
Hi guys:
How to get object name in XSI use python?

I try to use the line,but it's wrong.

Application.GetObjName()

Strang
02-26-2009, 04:09 AM
#select an object
Application.LogMessage( Application.Selection(0).Name )
Application.LogMessage( Application.Selection(0).FullName )

ThE_JacO
02-26-2009, 07:43 AM
there is a programming xsi subforum for scripting questions.
Moving your thread there, next time please post in the right location.

sunboy69
02-26-2009, 01:52 PM
#select an object
Application.LogMessage( Application.Selection(0).Name )
Application.LogMessage( Application.Selection(0).FullName )

Hi,thanks for your advice.
I thought,If i want to get the result when i run the script,first i need to select a Obj, then it can return the Obj name,but if i don't select a Obj first , it will return null.

In my scene,there is just one Obj, I don't know how to get its name,but not to select it first.

Strang
02-26-2009, 07:34 PM
you want to get the name of something without any information about it?

sorry no can do

Stoehr
04-10-2009, 12:13 AM
You could search for the object type.

I believe search the ActiveScene for it's children, then find all the object of, say, type polymsh.


Try selecting the item, then running


oType = Application.Selection(0)

Application.LogMessage(oType.Type)



From there, you'll get the type to search for. Like, search for all items that match type string "polymsh". Sorry, if I'm not more specific. I'm just thinking it through at the moment.

CGTalk Moderation
04-10-2009, 12:13 AM
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.