Giter VIP home page Giter VIP logo

shadernodesextra2.80's Introduction

ShaderNodesExtra

Utilities for Cycles PyNodes

This Addon serves the purpose of simplifying the creation of new custom nodes for Cycles, and it can be considered as a better API for custom nodes. The nodes produced by this addon are GPU compatible, and internally they work as an ordinary nodegroup. The main difference is that it's possible to change completly the node layout and add functionality to the node.

Most of it will work in background, and visibly there's not much to see yet.

Apart from the typical node functions (draw_buttons, draw_buttons_ext, update, free, copy, etc), the nodes integrate the following API(s):

ShaderNodeBase API: addNode(nodeType, **nodeAttributes) delNode(node) addInput(socketType, **socketAttributes) delInput(socket) addOutput(socketType, **socketAttributes) delOutput(socket) addLink(socket, socket) delLink(link)

Nodes created with this API should call setupTree() in the init() function, and should have a defaultNodeTree() to define the initial node configuration.

For now, while there isn't any MenuEditor, nodes are in charged to define their menu categories. This is not a good approach as a design perspective, and editing the menu will soon become something aside from the custom nodes.

The addon includes a converter operator, that can automatically write a custom node based in some nodegroup. To use it, select the nodegroup you want to convert into a script, press SPACE and look for 'Convert Selected Nodegroup to PyNode'. It will prompt for a bl_name and a bl_label. For consistency, bl_name should start by 'ShaderNode', thouhgt there's nothing to stop one from naming it whatever they want. The node will be automatically added to the 'Custom Nodes' category, and to change this, one should add a draw_menu function to the node script (located in the 'Nodes' folder inside the Addon path).

At the moment, I'm also sharing some nodes with the purpose to show what is possible..

-DisplacementBake: is a node to help baking displacement maps in a similar fashion as in ZBrush. (Credits to nudelZ)

-NormalBake: will help the creation of tangent normal maps from a normal vector.

-SwitchFloat: is a simple switch, if the 'Switch' input is set to 0, the output will be the 'value1'; if 1, the output will be 'value2'

-Compare: this node will compare two values and return a boolean. It features '>', '>=', '==', '!=', '<=', '<' and '~='.

-Interpolate: as the name says, it will interpolate between two values. Defaults to Lerp(linear interpolation), but also features 'SmoothStep', 'SmootherStep', 'HighPower' and its inverse, 'Sine' and its inverse, 'Cosine' and 'Catmull-Rom' interpolations.

-Loop: A more complex node that uses a nodegroup as a loop step. The nodegroup requires to have an input socket named 'iterator' for feeding the node with the step integer, and at least 1 output with the same name as the input for the data that is trasnfer from each cycle to the next.

shadernodesextra2.80's People

Contributors

secrop avatar sirmaxim avatar

Watchers

 avatar  avatar

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.