How to get ResNames of a RefModel ?

Discussions concerning programming of SOFTIMAGE©
antonieo
Posts: 7
Joined: 13 Apr 2011, 03:37

How to get ResNames of a RefModel ?

Post by antonieo » 05 Jun 2012, 07:01

Hello guys ,
I'm trying to get ResNames of a RefModel (as a list), the codes below let me get the resolution instance , but I don't know how to go further , or maybe I'm wrong from the beginning .
Now I don't have any clue . Please help me out if you know the trick . Big ThX

Code: Select all

App = Application
Sel = App.Selection
#Currnt Selection is a refmodel
o_Nested = Sel(0).NestedObjects

Log(o_Nested.GetAsText())
for i in o_Nested:
	if i.Type == "resolutions":
		#Log(str(i) + "    " + i.Type)
		Log(i)

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: How to get ResNames of a RefModel ?

Post by EricTRocks » 05 Jun 2012, 09:38

Not documented and annoying:

Code: Select all

# Python
xsi = Application
log = xsi.LogMessage
collSel = xsi.Selection

oRefModel = collSel(0)
oResolutions = oRefModel.NestedObjects("resolutions")
collResolutions = oResolutions.NestedObjects
for each in collResolutions:
    log(each.Name + ": " + str(each.Value))
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: How to get ResNames of a RefModel ?

Post by xsisupport » 05 Jun 2012, 09:58

http://xsisupport.wordpress.com/2012/02 ... solutions/

The first hit if you google "reference model resolutions"
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

antonieo
Posts: 7
Joined: 13 Apr 2011, 03:37

Re: How to get ResNames of a RefModel ?

Post by antonieo » 06 Jun 2012, 03:02

EricTRocks wrote:Not documented and annoying:

Code: Select all

# Python
xsi = Application
log = xsi.LogMessage
collSel = xsi.Selection

oRefModel = collSel(0)
oResolutions = oRefModel.NestedObjects("resolutions")
collResolutions = oResolutions.NestedObjects
for each in collResolutions:
    log(each.Name + ": " + str(each.Value))
ThX Bro ! :ymhug:

antonieo
Posts: 7
Joined: 13 Apr 2011, 03:37

Re: How to get ResNames of a RefModel ?

Post by antonieo » 06 Jun 2012, 03:06

xsisupport wrote:http://xsisupport.wordpress.com/2012/02 ... solutions/

The first hit if you google "reference model resolutions"
Yeah ! But thanks to our f**king government, I can't visit that great web without a proxy , and I don't have a proxy right here . But thX all the same :(