Home Technical Talk

Maya 2009: Auto-update textures

polycounter lvl 18
Offline / Send Message
killingpeople polycounter lvl 18
Maya 2009 does not have the option to auto-refresh textures. One must manually refresh.

NEX enables this feature.

Is there a means of getting this feature without the need to buy and install NEX for those that only want this feature?

I found this script with a search. What sucks is that the user has to manually enable the feature every time they open a new copy:

http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/auto-refresh-textures

And this thread has a fail link:

http://www.polycount.com/forum/showthread.php?t=41473

Thanks

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    You can put a shelf button for doing something like:
    {
        string $files[] = `ls -type "file"`;
        for ( $file in $files )
        {
            string $fileName = `getAttr ( $file + ".fileTextureName" )`;
            setAttr -type "string" ( $file + ".fileTextureName" ) $fileName;
        }
    }
    

    Untested, but I think it should work. Then you just click that and it will re-load all textures in your scene.

    I have a better idea for one that would only reload file textures that changed (far more efficient, especially with large textures, or large amounts of textures), but I'll have to sit down and actually write that. Might try it in Python to get some learning in.

    BTW, if you wanted to "enable" that script every time you load Maya, just put the command into the userSetup.mel file in your Documents/maya/2009/scripts/ folder, it'll run any commands in that file on startup. So that might work for you.
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    Thanks MoP. In this case, I won't have access to change the userSetup.mel, the tech artists own it. I wish ;)
  • akrelle
    Offline / Send Message
    akrelle null
    Nice! This was exactly what I needed. Thanks MoP!

    BTW, what do you mean "enable"? It seems the shelf button works after restart.
    Sorry if that is a noob question. :)
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    I have an old script that works well for this. With an object selected it will refresh all materials assigned to that object. With nothing selected it'll refresh all materials. I have it assigned to a hotkey.

    http://dl.dropbox.com/u/1889770/alexxUpdateFileTextures.mel
Sign In or Register to comment.