Skip to content

Latest commit

 

History

History
149 lines (71 loc) · 3.8 KB

README.md

File metadata and controls

149 lines (71 loc) · 3.8 KB

Blender Serpens 3

Extended Scripting

Serpens 3 package containing new scripting nodes.

This package is free, but you can support me through: paypal.me/mahrkeenerh

Donate Download

Installation

  1. Download the zip file,
  2. In the N panel of serpen (in serpen node editor), go to Extensions, and Packages,
  3. Click install Package and select the zip file,
  4. Restart blender.

Nodes:

Script Function Node

This node allows to run a custom python Function from a script, and receive the return results.

If Use Keyword Arguments is checked, the function uses keyword arguments, otherwise positional arguments.

Default Script Function node

Initialization

To allow usage of Script Functions, the Script file containing python functions must first be loaded.

When changes are made, the script must be reloaded.

Initialization

# addon.py
def combine_strings(string1, string2):
    return string1 + string2

Executing Custom Function

Custom Function Call

  • string1 and string2 are the function parameter inputs, naming must match, position doesn't have to match
  • output is the return value of function, can be named anything

Executing Custom Function without Keyword Arguments

Custom Function without Keyword Arguments

  • first and second are the function paremeter inputs, but naming doesn't have to match, position matters

Multiple Outputs

# addon.py
def swap_input(string1, string2):
    return string2, string1

Multiple outputs can either be combined, or split into separate outputs.

Multiple Outputs Combined

Multiple Outputs Separated

Expression Node

This node allows you to define a python expression, or execute the python expression (to preserve current state).

Expression Default Node

Expression Require Execute

Altering inputs

Expression to lower

Using libraries

In order to use other libraries that require to be imported, the import first must be executed. Then the library can be used anywhere in the addon.

Import math

Expression math ceil

Combining Expressions

Expression nodes can be combined to improve readability.

Combined Expressions

Try Except

Adds support for Python's try except statement.

Print Errors will print the error to the console, if an error occurs.

Try Except Node

Multi Execute

Very straight-forward node, allows combining multiple input and output Execute sockets together.

Each of the connected inputs will execute all of the outputs.

Multi Execute Node

Loop While

Adds support for Python's while loop.

Be careful, as this very well may crash your file, if you're not sure what you're doing.

Loop While Execute