Hi guys:
How to get object name in XSI use python?
I try to use the line,but it’s wrong.
Application.GetObjName()
Hi guys:
How to get object name in XSI use python?
I try to use the line,but it’s wrong.
Application.GetObjName()
#select an object
Application.LogMessage( Application.Selection(0).Name )
Application.LogMessage( Application.Selection(0).FullName )
there is a programming xsi subforum for scripting questions.
Moving your thread there, next time please post in the right location.
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.
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.
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.