Coder Social home page Coder Social logo

nebukam / blender-material-replacement Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5 KB

Replaces materials created during import with suffixes (in the form of '.###') with existing materials with the same name and no suffix.

License: MIT License

Python 100.00%
blender blender-addon blender-material blender-scripts

blender-material-replacement's Introduction

blender-material-replacement version license

A straighforward blender add-on that replaces materials created during import with suffixes (in the form of '.###') with existing materials with the same name and no suffix.

Long story short, will swap MyMatID.001, MyMatID.010, MyMatID.012 for MyMatID if it exists, and remove the others. If no "main" material is found, the script simply ignore the material.

Support Blender 3.3.x, may work with older version, don't know, haven't tested.

--

Install

Simply download this repo as a .ZIP and follow blender's instructions to install the add-on.

Use

Once installed and enabled, a new panel will be available in the scene properties tab under Material Duplicate Clean-up, simply click the button Run on Scene to clean-up all materials in the scene, or Run on Selection to only affect the active selection.

Note that Run on Selection does not remove replaced duplicate, as sometimes dupes are used outside of the selection, resulting in loss of data.

Limitations

Running this on the scene loop through all objects, one by one, and for each object loops through all material within the .blend file, one by one. As such, if you have a very very complex scene with either tons of objects, or tons of materials, or both, you are very likely to experience small freezes. It's not ideal, but it works :)

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.