A Blender addon for MSpec Lingo node-based scripting development.
This addon provides a custom node tree system for creating and executing Lingo-style scripts within Blender. It features a visual node-based interface that allows users to build computational graphs using various node types including value nodes, operation nodes, and control flow nodes.
- Open Blender and switch to the Node Editor
- Change the node tree type to "MSpec Lingo Nodes"
- Add nodes using Shift+A or the Add menu
- Create test trees using the "Create Test Node Tree" operator
- Build your node graphs by connecting nodes together
source .blenv/venv3.11/bin/activate
python -m blenv run
python -m blenv run test
This project follows specific code style preferences to maintain consistency and readability:
- Single quotes (
') for string literals - Triple double quotes (
""") for docstrings only
# Preferred
bl_label = 'My Node'
def my_function():
"""This is a docstring"""
return 'result'
# Avoid
bl_label = "My Node"
def my_function():
'''This is a docstring'''
return "result"F string quotes
name = 'Brad'
data = {'age': 37}
# for simple f-strings: single quotes
greeting = f'Hello, {name}'
# for complex f-strings:
# double quotes to define the f-string, single quotes inside the f-string
msg = f"Brad is {data['age'] years old}"- no unused imports
- no unused variables
Major sections use hash borders:
#
# section name
#Minor sections use hash suffixes:
# section name #Descriptive comments are simple:
# example explaining what is going on at this point in the code- 2 lines around major section headers and between classes
- 1 line around minor section headers and between functions
import bpy
#
# value nodes
#
class MyValueNode(Node):
"""Node for handling values"""
bl_label = 'Value Node'
def init(self, context):
# Create the output socket
self.outputs.new('NodeSocketInt', 'value')
class MyOtherValueNode(Node):
"""Node for handling values"""
bl_label = 'Value Node'
def init(self, context):
# Create the output socket
self.outputs.new('NodeSocketInt', 'value')
# helper functions #
def create_default_value():
# Return a sensible default
return 42
def create_another_default_value():
# Return a sensible default
return 33
#
# registration
#
classes = [
MyValueNode,
]