CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 07-03-2012, 10:19 AM   #1
Posts: n/a
Optimized Textures Location with Python


Do you know how in python i can :

- Switch the "Optimized Textures location' from 'sourceimages/cache' to 'Custom Location' ?
- Toggle On/Off 'Use Optimized Textures(auto-conversion)'

All i could figure for the moment is to change the texture location :

cmds.optionVar( sv=('miFileTextureCacheLocation', '//myServer/MR_MAP_CACHE) )

If a MEL solutoin exist, i'm still interested. I don't want to go over 25 machines and set up this each time. Wanted to include it in a userSetup...

Old 07-03-2012, 01:31 PM   #2
United States Minor Outlying Islands
Join Date: Jul 2008
Posts: 203
There is a mel script for changing texture directories thats pretty awesome :
It might be of help.
Old 07-03-2012, 01:54 PM   #3
Posts: n/a
I know FileTextureManager but it's not really what i'm looking for.

I want to make couple of Maya preferences action through script...take a look at my first message
Old 07-03-2012, 02:29 PM   #4
austin, USA
Join Date: Nov 2006
Posts: 364
You are on the right track.
Have you tried searching through the userPrefs.mel file for the specific name of the optionVar to control enabling/disabling optimized textures?

a quick search yields:
-iv "miFileTextureCacheConversionScope" 1 -sv "miFileTextureCacheLocation" "" -iv "miFileTextureCacheStorageMode" 0
Old 07-03-2012, 02:59 PM   #5
Posts: n/a
Yeah thanks for the input rgkovach123

So these lines works even if it doesn't update the Maya interface...bit lame though...

Here are the lines, if someone got interested by this too, it's pretty handy to setup many machines using .map at a same location with a single shared userSetup.

#Activate the Maya-style alpha detection cmds.optionVar( sv=('miUseMayaAlphaDetection', 1) ) #Activate the use of optimized textures cmds.optionVar( sv=('miCacheOptimFileTextures', 1) ) #Set Optimized Textures Location to 'Custom' cmds.optionVar( sv=('miFileTextureCacheStorageMode', 1) ) #Set the path where the .map will be generated cmds.optionVar( sv=('miFileTextureCacheLocation', '//myServer/MR_MAP_CACHE') ) #Set conversion mode to Assigned Textures Only cmds.optionVar( sv=('miFileTextureCacheConversionScope', 0) )

Last edited by sonicstrawbery : 07-03-2012 at 03:06 PM.
Old 07-05-2012, 04:13 PM   #6
austin, USA
Join Date: Nov 2006
Posts: 364
updating the UI and setting the optionVars are two different operations. To keep them in sync, you would need to manually update the UI.

Maya usually modifies these types of values through MEL scripts that handle both updating the prefs and providing the UI with the new data.
Old 07-05-2012, 04:13 PM   #7
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:00 PM.

Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.