Git Product home page Git Product logo

auto-texture-file-assigner-mtoa's Introduction

Automatic Texture File Assigner (for Maya and Arnold's aiStandardSurface)

Reason for existence

Having to assign texture files to aiStandardSurface is a bit of a pain. Creating each file node, assigning each file path, and changing the file color space as needed is tedious work that takes more time than it should. AutoTextureFileAssignerMtoA.py is a script designed to mostly automate this process for you.

How to use the script

  1. In the Hypershade editor, select the aiStandardSurface node you want to connect texture files to.
  2. Run the script via a hotkey or the script editor.
  3. In the file selection dialog that opens up, select the files you wish to connect to the shader.
    1. For best results, the file names should be formatted as follows: (FilePrefix_)ShaderChannel(.UDIM).FileType
    2. If you are working with UDIMs, select only the first file in a given series.
  4. Press the "Open" button when done selecting files.
  5. The script will do its magic! File nodes will be generated, their settings updated to fit how the file should be used by the shader, then connected to the selected shader.

How the script works

The name of each user-selected file is parsed for what shader channel it is supposed to connect to. Once the script knows that, it generates file nodes with the appropriate color space, uv tiling settings, and file path, and connects them to the selected aiStandardSurface node! For normal maps, an aiNormalMap node will be generated alongside the file node. For height maps, a displacement node will be generated alongside the file node and connected to the selected shader's shading engine node.

You can change what the script looks for in file names for each channel by modifying the dictionary FileNameToAttributeDictionary in AutoTextureFileAssignerMtoA.py. See the script for additional details.

Notices

Tested in Maya 2020/Python 2.7.11. Backwards or forwards compatibility with different Maya or Python versions is not guaranteed.

Released under MIT License (see LICENSE.md for more details.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.