Change UV set to display in texture editor from python

Discussions concerning programming of SOFTIMAGE©
Post Reply
Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Change UV set to display in texture editor from python

Post by Manticor » 06 May 2014, 16:07

Does anyone know how to change the uv projection to display in the texture editor from python ?


Im on XSI 7.01 btw

Any help much appreciated

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Change UV set to display in texture editor from python

Post by csaez » 07 May 2014, 06:48

There is a view attribute called "projection" to do just that, but is available starting from Softimage 2013 :(

Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Re: Change UV set to display in texture editor from python

Post by Manticor » 07 May 2014, 07:51

I think I found another way to do it by selecting the projection and then opening the texture editor view.
You don't happen to know how to access the projections of an object using the object model do you?
I get as far as activeprimitive.geometry.clusters... After that I have to loop through the properties to get access to what I want.... I'd prefer to go direct without having to loop and filter.

Thanks

Kenny

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Change UV set to display in texture editor from python

Post by csaez » 07 May 2014, 09:46

AFAIK that's the way to do it, you can always write a little function to keep things tight but yeah, that's the object model way.

Code: Select all

get_uvs = lambda obj: [p for c in obj.ActivePrimitive.Geometry.Clusters
                       for p in c.Properties if p.Type == "uvspace"]

print get_uvs(Application.Selection(0))

Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Re: Change UV set to display in texture editor from python

Post by Manticor » 07 May 2014, 11:03

I've written a function to get the object from any ".fullname" string .Seems to do the trick .

Thanks for your help cesar .

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests