Coder Social home page Coder Social logo

jb-materialsharing's Introduction

Material Sharing

Finally we can stop sharing Materials and Material Nodes as images!

This is the Blender add-on that allows you to copy and paste Blender Materials as JSON! There is also a shortcut to save the active material as a file.

I have been wanting this for a long time, so now I finally spent the time to make it. And it works great! Look for the new options to Copy, Paste and Save Material in the Edit menu.

Coming soon: Please join me on https://matdb.org where we all can share and copy materials freely!

Thanks! Johan

Feature Highlights

Share

  • Copy Entire Material: It only copies all the nodes and their state and links (make sure nothing is selected, otherwise you will only copy the selection). No files will be included. The copy operation converts the material information into a JSON format, which is a text-based data interchange format. The JSON structure is copied to your clipboard.

  • Copy Partial Material: If you have selected anything of the active material, clicking Copy Material will only copy the selection. This way you can share smaller parts of a larger material. Neat, right?

  • Paste Material: When you have a copied material on your clipboard, you can select an object and paste it. Easy. Please note: It replaces the active material. The operation can be undone.

  • Save Material: Saves the current active material for the currently selected object in a .json file, stored in the output path of your Blender file, named after the material.

Installation

Install

This is a very simple process:

  1. Download the zipped archive (which you unzip) or just the jb-materialsharing.py file to any location.
  2. Open Blender Preferences (CMD+comma on MacOS).
  3. Go to the Add-ons tab and click the Install at the top.
  4. Browse to the downloaded python script and select and install it.
  5. Blender will copy the file to its installed addons folder.
  6. Finally, enable the script, it is called: Material: Material Sharing using JSON

The new shortcuts to copy and paste a JSON material is available at the bottom of the Edit menu. This is also where you will find the option to Savea Material.

How It Works

When you copy the entire or only selected parts of the active material of the currently selected object, the script runs through the node tree, parsing each property and storing its value. It then stores the links between the nodes. And finally, it formats the data in the JSON format and copies it to your clipboard (Unless you use Save Material).

When you paste, the active material is replaced (and lost) by the pasted material. First the script creates the nodes, gives each property its value, and then establishes all the links between each node.

Let me know what you think!

Johan

jb-materialsharing's People

Contributors

gatada avatar

Watchers

 avatar  avatar

jb-materialsharing's Issues

Incomplete materials

I have realised that the copying of the material is incomplete.

So I am working on improving both the parsing/copying and the creation/pasting of the material—to be both robust and future proof.

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.