An addon for Blender that helps reduce draw calls in game engines by combining textures without quality loss and avoiding issues with UV bounds larger than 0-1.
The original author of this plugin is shotariya, you can find the original here: https://github.com/Grim-es/material-combiner-addon
This is an unoffical version for Cats Blender Plugin, we are only bug fixing unto Avatar Toolkit comes out.
- Combining Multiple Materials: Allows you to mix diffuse colors with textures, and specify both the size of the resulting atlas and the size of each individual texture.
- Multicombining: Adds image-layers for each material, which are combined into different atlases. This feature supports the generation of Normal maps, Specular maps, and other atlases. (Not implemented in newer versions | Supported in version 2.0.3.3)
- UV Packing: Packs UVs into the selected scale bounds by splitting mesh faces, and is compatible with rigged models. (Not implemented in newer versions | Supported in version 1.1.6.3)
- Download an addon: Material-combiner.
- Go to File > User Preferences > Addons.
- Click on Install Add-on from File.
- Choose
material-combiner-addon-master.zip
archive. - Activate Material Combiner.
- Once the addon is installed and activated, go to the 3D Viewport in Blender.
- On the right side of the 3D View (Scene) window, open the side panel by pressing the
N
key on your keyboard. - In the side panel, locate the MatCombiner section.
- You will see a list of objects and their corresponding materials:
- For each material, you can choose to include or exclude it from the atlasing process by checking or unchecking the box next to it.
- Each object has a Select All or Deselect All button, allowing you to quickly enable or disable atlasing for all of its materials.
- You can also set the size for materials that do not have an image. The default size is set to 32 pixels.
- Once you have made your selections, click the
Save atlas to..
button to start the atlasing process. - If the materials are not merged properly or the atlas image does not contain all the textures, please refer to the section: After clicking "Save atlas to.." the materials are simply merged or the atlas image does not have all the textures.
After clicking "Save atlas to.." the materials are simply merged or the atlas image does not have all the textures
- Textures are packaged in a .blend file. Save the .blend file to a location of your choice, then go to File > External Data > Unpack Resources / Unpack All Into Files to extract the textures.
- Your version of Blender is not in English, in this case the nodes will be named differently, their names are strictly written in the script. You need to manually rename the nodes to their own names, or switch the blender version to English and regenerate the nodes by re-importing the model.
- You are using an unsupported shader (Surface property of material) or incorrect node names. You can check the file utils/materials.py to see which shaders are supported and what node names should be used. For more details, refer to the relevant discussion on GitHub: Issue #98.
- If objects already share the same material with the same texture, they will not be atlased because they are already optimized, and the existing image will be used instead.
-
Make sure the VPN is not currently active.
-
Windows | Verify that Blender is not installed from the Windows Store, as it may not function correctly. To install Pillow manually, navigate to your Blender installation folder, then to the folder with the blender version name\python\bin and copy this path. Press Win+R on your keyboard, type cmd.exe, and press Enter. In the Windows console, enter the following commands:
set PythonPath="Your\Copied\Path\To\Python\bin\Folder" %PythonPath%\python.exe -m pip install Pillow --user --upgrade
Replace Your\Copied\Path\To\Python\bin\Folder with the path you copied.
-
MacOS | Open a Terminal console and execute the following commands:
/Applications/Blender.app/Contents/MacOS/Blender -b --python-expr "__import__('ensurepip')._bootstrap()" /Applications/Blender.app/Contents/MacOS/Blender -b --python-expr "__import__('pip._internal')._internal.main(['install', '-U', 'pip', 'setuptools', 'wheel'])" /Applications/Blender.app/Contents/MacOS/Blender -b --python-expr "__import__('pip._internal')._internal.main(['install', 'Pillow'])"
If you installed Blender in a different location, adjust the path at the beginning of each command accordingly.
You have installed the source code from the Releases. Instead, install from the master branch Material-combiner. Before doing so, remove the old installation folder. The default locations are:
- Windows
Replace YourUserName with your actual username and BlenderVersion with the version of Blender you are using.
C:\Users\YourUserName\AppData\Roaming\Blender Foundation\Blender\BlenderVersion\scripts\addons
- MacOS
Replace YourUserName with your actual username and BlenderVersion with the version of Blender you are using.
/Users/YourUserName/Library/Application Support/Blender/BlenderVersion/scripts/addons
If you have found a bug please read this first: #1