A browser window to see all the built-in Qt image resources Maya can load.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2e3ae4b Dec 28, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github update help Dec 28, 2017
.screenshots minor updates Dec 27, 2017
qt_img_resource_browser edit license Dec 28, 2017
.gitignore minor updates Dec 27, 2017
LICENSE edit license Dec 28, 2017
README.md update help Dec 28, 2017

README.md

Maya Qt Image Resource Browser

tested_maya_2016 tested_maya_2018 license

Description

This Python tool for Maya will let you browse all the image resources Maya has already loaded from QResource bundles.

These internal resources make it easy to add images to buttons and other UI elements without authoring or packaging images in your tools and scripts.

There is the added benefit of having your application look native to Maya and feel familiar with users.

This is an example of using a built in Maya icon as a QPixmap in your code:

px_open = QtGui.QPixmap(":/fileOpen.png")
Screenshot

Window Screenshot

Installation and Use

  1. Place the entire directory qt_img_resource_browser in your Maya scripts directory or a directory that Maya can load Python scripts from.

    ├- maya
       ├- scripts
          ├- qt_img_resource_browser
             ├- app.py
             ├- interface.py
             ├- etc . . .
    
  2. Restart Maya.

  3. Launch the window with this python command:

    # Python
    import qt_img_resource_browser.interface as interface
    interface.load()
UI
  • Add a shortcut to the shelf from the "Utils" main menu.
  • Open the Github page from the "Help" main menu.
  • The number of images in the list is displayed in the title bar.
Details

Window Screenshot

  1. A preview of the image
  2. The path for the image
  3. The extension of the image
  4. The pixel dimensions of the image
  5. Copy the path with quotes to the clipboard
  6. Save the image file as a .png
Notes

By default some paths are excluded from the list. You can edit the config.json file to modify these exclusions.

This tool uses the Qt.py shim to enable compatibility with PySide or PySide2.

I can only test on Windows 10 at the moment. I won't be able to reproduce any issues running on another platform.

Please note that some images included in later versions of Maya may not be present in earlier versions.

Known Issues

  • Loading the window is slow initially due to thousands of widgets.