Stats
Actions
Tags
From pysbs-dev
Generate PySBS code to add a node to a graph. Use when user wants to add filter nodes, input/output nodes, bitmap nodes, or instance nodes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pysbs-dev:add-node [node type] [graph name][node type] [graph name]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate PySBS code to add a specific node type to a graph.
Generate PySBS code to add a specific node type to a graph.
Based on $ARGUMENTS, generate Python code to add the specified node type.
from pysbs import sbsenum
# Common filter nodes
node = graph.createCompFilterNode(
aFilter=sbsenum.FilterEnum.BLEND,
aGUIPos=[0, 0, 0],
aParameters={
sbsenum.CompNodeParamEnum.BLENDING_MODE: sbsenum.BlendBlendingModeEnum.MULTIPLY,
sbsenum.CompNodeParamEnum.OPACITY: 1.0
}
)
# Available FilterEnum values:
# BITMAP, BLEND, BLUR, CURVE, DISTANCE, DYNAMICGRADIENT,
# EMBOSS, FXMAPS, GRADIENT, GRAYSCALECONVERSION, HSL, LEVELS,
# NORMAL, PIXEL_PROCESSOR, SHARPEN, SHUFFLE, SVG, TEXT,
# TRANSFORMATION, UNIFORM, VALUE_PROCESSOR, WARP, PASSTHROUGH
# Instance of internal graph
instance = graph.createCompInstanceNodeFromPath(
aSBSDocument=doc,
aPath='pkg:///OtherGraph',
aGUIPos=[200, 0, 0],
aParameters={'param_name': value}
)
# Instance of library graph
blur_hq = graph.createCompInstanceNodeFromPath(
aSBSDocument=doc,
aPath='sbs://blur_hq.sbs/blur_hq',
aGUIPos=[200, 0, 0],
aParameters={'Intensity': 2.0}
)
# Input node
input_node = graph.createInputNode(
aIdentifier='Input',
aColorMode=sbsenum.ColorModeEnum.COLOR,
aGUIPos=[0, 0, 0]
)
# Output node
output_node = graph.createOutputNode(
aIdentifier='Output',
aGUIPos=[500, 0, 0],
aUsages={sbsenum.UsageEnum.BASECOLOR: sbsenum.ComponentsEnum.RGBA}
)
# Bitmap node
bitmap = graph.createBitmapNode(
aSBSDocument=doc,
aResourcePath='/path/to/texture.png',
aGUIPos=[0, 0, 0]
)
# SVG node
svg = graph.createSvgNode(
aSBSDocument=doc,
aResourcePath='/path/to/vector.svg',
aGUIPos=[0, 100, 0]
)
# Text node
text = graph.createTextNode(
aGUIPos=[0, 200, 0],
aParameters={
sbsenum.CompNodeParamEnum.TEXT: 'Hello',
sbsenum.CompNodeParamEnum.TEXT_FONT: 'Arial'
}
)
# Curve node
curve = graph.createCurveNode(aGUIPos=[0, 0, 0])
# Gradient Map node
gradient = graph.createGradientMapNode(aGUIPos=[0, 100, 0])
# Input Value node
value_input = graph.createInputValueNode(
aIdentifier='ValueParam',
aInputValueTypeEnum=sbsenum.InputValueTypeEnum.FLOAT1,
aGUIPos=[0, 200, 0]
)
from pysbs import context, substance, sbsenum
def add_blend_node(sbs_path, graph_name):
ctx = context.Context()
doc = substance.SBSDocument(ctx, sbs_path)
doc.parseDoc()
graph = doc.getSBSGraph(graph_name)
if not graph:
raise ValueError(f"Graph '{graph_name}' not found")
# Find good position (after last node)
nodes = graph.getNodeList()
if nodes:
last_pos = max(n.getPosition()[0] for n in nodes)
new_pos = [last_pos + 200, 0, 0]
else:
new_pos = [0, 0, 0]
# Create node
blend = graph.createCompFilterNode(
aFilter=sbsenum.FilterEnum.BLEND,
aGUIPos=new_pos
)
doc.writeDoc()
return blend
add_blend_node('/path/to/material.sbs', 'MainGraph')
npx claudepluginhub juyeongyi/jylee_claude_marketplace --plugin pysbs-devCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.