2024-02-14 12:33:40 +01:00
|
|
|
import typing as typ
|
|
|
|
import typing_extensions as pytypes_ext
|
2024-02-10 17:59:16 +01:00
|
|
|
import enum
|
|
|
|
|
2024-02-14 12:33:40 +01:00
|
|
|
import sympy as sp
|
2024-02-19 14:28:35 +01:00
|
|
|
|
|
|
|
sp.printing.str.StrPrinter._default_settings['abbrev'] = True
|
|
|
|
## When we str() a unit expression, use abbrevied units.
|
|
|
|
|
2024-02-14 12:33:40 +01:00
|
|
|
import sympy.physics.units as spu
|
|
|
|
import pydantic as pyd
|
|
|
|
import bpy
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
from ...utils.blender_type_enum import (
|
2024-02-19 14:28:35 +01:00
|
|
|
BlenderTypeEnum, append_cls_name_to_values, wrap_values_in_MT
|
2024-02-10 17:59:16 +01:00
|
|
|
)
|
2024-02-19 15:58:39 +01:00
|
|
|
from ...utils import extra_sympy_units as spuex
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-14 12:33:40 +01:00
|
|
|
####################
|
|
|
|
# - String Types
|
|
|
|
####################
|
|
|
|
BlenderColorRGB = tuple[float, float, float, float]
|
|
|
|
BlenderID = pytypes_ext.Annotated[str, pyd.StringConstraints(
|
|
|
|
pattern=r'^[A-Z_]+$',
|
|
|
|
)]
|
|
|
|
|
|
|
|
# Socket ID
|
|
|
|
SocketName = pytypes_ext.Annotated[str, pyd.StringConstraints(
|
|
|
|
pattern=r'^[a-zA-Z0-9_]+$',
|
|
|
|
)]
|
|
|
|
BLSocketName = pytypes_ext.Annotated[str, pyd.StringConstraints(
|
|
|
|
pattern=r'^[a-zA-Z0-9_]+$',
|
|
|
|
)]
|
|
|
|
|
|
|
|
# Socket ID
|
|
|
|
PresetID = pytypes_ext.Annotated[str, pyd.StringConstraints(
|
|
|
|
pattern=r'^[A-Z_]+$',
|
|
|
|
)]
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Sympy Expression Typing
|
|
|
|
####################
|
|
|
|
ALL_UNIT_SYMBOLS = {
|
|
|
|
unit
|
|
|
|
for unit in spu.__dict__.values()
|
|
|
|
if isinstance(unit, spu.Quantity)
|
|
|
|
}
|
|
|
|
def has_units(expr: sp.Expr):
|
|
|
|
return any(
|
|
|
|
symbol in ALL_UNIT_SYMBOLS
|
|
|
|
for symbol in expr.atoms(sp.Symbol)
|
|
|
|
)
|
|
|
|
def is_exactly_expressed_as_unit(expr: sp.Expr, unit) -> bool:
|
|
|
|
#try:
|
|
|
|
converted_expr = expr / unit
|
|
|
|
|
|
|
|
return (
|
|
|
|
converted_expr.is_number
|
|
|
|
and not converted_expr.has(spu.Quantity)
|
|
|
|
)
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Icon Types
|
|
|
|
####################
|
|
|
|
class Icon(BlenderTypeEnum):
|
|
|
|
MaxwellSimTree = "MOD_SIMPLEDEFORM"
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
####################
|
|
|
|
# - Tree Types
|
|
|
|
####################
|
|
|
|
@append_cls_name_to_values
|
|
|
|
class TreeType(BlenderTypeEnum):
|
|
|
|
MaxwellSim = enum.auto()
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Socket Types
|
|
|
|
####################
|
|
|
|
@append_cls_name_to_values
|
|
|
|
class SocketType(BlenderTypeEnum):
|
2024-02-19 14:28:35 +01:00
|
|
|
# Base
|
2024-02-14 12:33:40 +01:00
|
|
|
Any = enum.auto()
|
2024-02-19 18:36:16 +01:00
|
|
|
Bool = enum.auto()
|
2024-02-14 12:33:40 +01:00
|
|
|
Text = enum.auto()
|
|
|
|
FilePath = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Number
|
|
|
|
IntegerNumber = enum.auto()
|
2024-02-14 12:33:40 +01:00
|
|
|
RationalNumber = enum.auto()
|
|
|
|
RealNumber = enum.auto()
|
|
|
|
ComplexNumber = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Vector
|
|
|
|
Real2DVector = enum.auto()
|
|
|
|
Complex2DVector = enum.auto()
|
|
|
|
|
|
|
|
Real3DVector = enum.auto()
|
|
|
|
Complex3DVector = enum.auto()
|
|
|
|
|
|
|
|
# Physical
|
|
|
|
PhysicalTime = enum.auto()
|
|
|
|
|
|
|
|
PhysicalAngle = enum.auto()
|
|
|
|
|
2024-02-14 12:33:40 +01:00
|
|
|
PhysicalLength = enum.auto()
|
|
|
|
PhysicalArea = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
PhysicalVolume = enum.auto()
|
|
|
|
|
2024-02-19 18:36:16 +01:00
|
|
|
PhysicalPoint2D = enum.auto()
|
|
|
|
PhysicalPoint3D = enum.auto()
|
|
|
|
|
|
|
|
PhysicalSize2D = enum.auto()
|
|
|
|
PhysicalSize3D = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
PhysicalMass = enum.auto()
|
|
|
|
|
|
|
|
PhysicalSpeed = enum.auto()
|
2024-02-19 18:36:16 +01:00
|
|
|
PhysicalAccelScalar = enum.auto()
|
|
|
|
PhysicalForceScalar = enum.auto()
|
|
|
|
PhysicalAccel3DVector = enum.auto()
|
|
|
|
PhysicalForce3DVector = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
|
|
|
|
PhysicalPol = enum.auto()
|
|
|
|
|
|
|
|
PhysicalFreq = enum.auto()
|
|
|
|
PhysicalSpecPowerDist = enum.auto()
|
|
|
|
PhysicalSpecRelPermDist = enum.auto()
|
|
|
|
|
|
|
|
# Blender
|
|
|
|
BlenderObject = enum.auto()
|
|
|
|
BlenderCollection = enum.auto()
|
2024-02-14 12:33:40 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
BlenderImage = enum.auto()
|
|
|
|
BlenderVolume = enum.auto()
|
|
|
|
|
|
|
|
BlenderGeoNodes = enum.auto()
|
|
|
|
BlenderText = enum.auto()
|
|
|
|
|
|
|
|
# Maxwell
|
2024-02-10 17:59:16 +01:00
|
|
|
MaxwellSource = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
MaxwellTemporalShape = enum.auto()
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
MaxwellMedium = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
MaxwellMediumNonLinearity = enum.auto()
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
MaxwellStructure = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
|
|
|
|
MaxwellBoundBox = enum.auto()
|
|
|
|
MaxwellBoundFace = enum.auto()
|
|
|
|
|
|
|
|
MaxwellMonitor = enum.auto()
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
MaxwellFDTDSim = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
MaxwellSimGrid = enum.auto()
|
|
|
|
MaxwellSimGridAxis = enum.auto()
|
|
|
|
|
|
|
|
SocketType_to_units = {
|
|
|
|
SocketType.PhysicalTime: {
|
2024-02-19 15:58:39 +01:00
|
|
|
"default": "PS",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PS": spu.picosecond,
|
|
|
|
"NS": spu.nanosecond,
|
|
|
|
"MS": spu.microsecond,
|
|
|
|
"MLSEC": spu.millisecond,
|
|
|
|
"SEC": spu.second,
|
|
|
|
"MIN": spu.minute,
|
|
|
|
"HOUR": spu.hour,
|
|
|
|
"DAY": spu.day,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SocketType.PhysicalAngle: {
|
2024-02-19 15:58:39 +01:00
|
|
|
"default": "RADIAN",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"RADIAN": spu.radian,
|
|
|
|
"DEGREE": spu.degree,
|
|
|
|
"STERAD": spu.steradian,
|
|
|
|
"ANGMIL": spu.angular_mil,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SocketType.PhysicalLength: {
|
|
|
|
"default": "UM",
|
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PM": spu.picometer,
|
|
|
|
"A": spu.angstrom,
|
|
|
|
"NM": spu.nanometer,
|
|
|
|
"UM": spu.micrometer,
|
|
|
|
"MM": spu.millimeter,
|
|
|
|
"CM": spu.centimeter,
|
|
|
|
"M": spu.meter,
|
|
|
|
"INCH": spu.inch,
|
|
|
|
"FOOT": spu.foot,
|
|
|
|
"YARD": spu.yard,
|
|
|
|
"MILE": spu.mile,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalArea: {
|
|
|
|
"default": "UM_SQ",
|
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PM_SQ": spu.picometer**2,
|
2024-02-19 14:28:35 +01:00
|
|
|
"A_SQ": spu.angstrom**2,
|
2024-02-19 15:58:39 +01:00
|
|
|
"NM_SQ": spu.nanometer**2,
|
|
|
|
"UM_SQ": spu.micrometer**2,
|
|
|
|
"MM_SQ": spu.millimeter**2,
|
|
|
|
"CM_SQ": spu.centimeter**2,
|
|
|
|
"M_SQ": spu.meter**2,
|
|
|
|
"INCH_SQ": spu.inch**2,
|
|
|
|
"FOOT_SQ": spu.foot**2,
|
|
|
|
"YARD_SQ": spu.yard**2,
|
|
|
|
"MILE_SQ": spu.mile**2,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalVolume: {
|
|
|
|
"default": "UM_CB",
|
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PM_CB": spu.picometer**3,
|
2024-02-19 14:28:35 +01:00
|
|
|
"A_CB": spu.angstrom**3,
|
2024-02-19 15:58:39 +01:00
|
|
|
"NM_CB": spu.nanometer**3,
|
|
|
|
"UM_CB": spu.micrometer**3,
|
|
|
|
"MM_CB": spu.millimeter**3,
|
|
|
|
"CM_CB": spu.centimeter**3,
|
|
|
|
"M_CB": spu.meter**3,
|
2024-02-19 14:28:35 +01:00
|
|
|
"ML": spu.milliliter,
|
|
|
|
"L": spu.liter,
|
2024-02-19 15:58:39 +01:00
|
|
|
"INCH_CB": spu.inch**3,
|
|
|
|
"FOOT_CB": spu.foot**3,
|
|
|
|
"YARD_CB": spu.yard**3,
|
|
|
|
"MILE_CB": spu.mile**3,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.PhysicalPoint2D: {
|
|
|
|
"default": "UM",
|
|
|
|
"values": {
|
|
|
|
"PM": spu.picometer,
|
|
|
|
"A": spu.angstrom,
|
|
|
|
"NM": spu.nanometer,
|
|
|
|
"UM": spu.micrometer,
|
|
|
|
"MM": spu.millimeter,
|
|
|
|
"CM": spu.centimeter,
|
|
|
|
"M": spu.meter,
|
|
|
|
"INCH": spu.inch,
|
|
|
|
"FOOT": spu.foot,
|
|
|
|
"YARD": spu.yard,
|
|
|
|
"MILE": spu.mile,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalPoint3D: {
|
|
|
|
"default": "UM",
|
|
|
|
"values": {
|
|
|
|
"PM": spu.picometer,
|
|
|
|
"A": spu.angstrom,
|
|
|
|
"NM": spu.nanometer,
|
|
|
|
"UM": spu.micrometer,
|
|
|
|
"MM": spu.millimeter,
|
|
|
|
"CM": spu.centimeter,
|
|
|
|
"M": spu.meter,
|
|
|
|
"INCH": spu.inch,
|
|
|
|
"FOOT": spu.foot,
|
|
|
|
"YARD": spu.yard,
|
|
|
|
"MILE": spu.mile,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SocketType.PhysicalSize2D: {
|
|
|
|
"default": "UM",
|
|
|
|
"values": {
|
|
|
|
"PM": spu.picometer,
|
|
|
|
"A": spu.angstrom,
|
|
|
|
"NM": spu.nanometer,
|
|
|
|
"UM": spu.micrometer,
|
|
|
|
"MM": spu.millimeter,
|
|
|
|
"CM": spu.centimeter,
|
|
|
|
"M": spu.meter,
|
|
|
|
"INCH": spu.inch,
|
|
|
|
"FOOT": spu.foot,
|
|
|
|
"YARD": spu.yard,
|
|
|
|
"MILE": spu.mile,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalSize3D: {
|
|
|
|
"default": "UM",
|
|
|
|
"values": {
|
|
|
|
"PM": spu.picometer,
|
|
|
|
"A": spu.angstrom,
|
|
|
|
"NM": spu.nanometer,
|
|
|
|
"UM": spu.micrometer,
|
|
|
|
"MM": spu.millimeter,
|
|
|
|
"CM": spu.centimeter,
|
|
|
|
"M": spu.meter,
|
|
|
|
"INCH": spu.inch,
|
|
|
|
"FOOT": spu.foot,
|
|
|
|
"YARD": spu.yard,
|
|
|
|
"MILE": spu.mile,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
SocketType.PhysicalMass: {
|
2024-02-19 16:03:32 +01:00
|
|
|
"default": "UG",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"E_REST": spu.electron_rest_mass,
|
|
|
|
"DAL": spu.dalton,
|
|
|
|
"UG": spu.microgram,
|
|
|
|
"MG": spu.milligram,
|
|
|
|
"G": spu.gram,
|
|
|
|
"KG": spu.kilogram,
|
|
|
|
"TON": spu.metric_ton,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SocketType.PhysicalSpeed: {
|
2024-02-19 16:03:32 +01:00
|
|
|
"default": "UM_S",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PM_S": spu.picometer / spu.second,
|
|
|
|
"NM_S": spu.nanometer / spu.second,
|
|
|
|
"UM_S": spu.micrometer / spu.second,
|
|
|
|
"MM_S": spu.millimeter / spu.second,
|
|
|
|
"M_S": spu.meter / spu.second,
|
|
|
|
"KM_S": spu.kilometer / spu.second,
|
|
|
|
"KM_H": spu.kilometer / spu.hour,
|
|
|
|
"FT_S": spu.feet / spu.second,
|
|
|
|
"MI_H": spu.mile / spu.hour,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.PhysicalAccelScalar: {
|
|
|
|
"default": "UM_S_SQ",
|
|
|
|
"values": {
|
|
|
|
"PM_S_SQ": spu.picometer / spu.second**2,
|
|
|
|
"NM_S_SQ": spu.nanometer / spu.second**2,
|
|
|
|
"UM_S_SQ": spu.micrometer / spu.second**2,
|
|
|
|
"MM_S_SQ": spu.millimeter / spu.second**2,
|
|
|
|
"M_S_SQ": spu.meter / spu.second**2,
|
|
|
|
"KM_S_SQ": spu.kilometer / spu.second**2,
|
|
|
|
"FT_S_SQ": spu.feet / spu.second**2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalForceScalar: {
|
|
|
|
"default": "UNEWT",
|
|
|
|
"values": {
|
|
|
|
"KG_M_S_SQ": spu.kg * spu.m/spu.second**2,
|
|
|
|
"NNEWT": spuex.nanonewton,
|
|
|
|
"UNEWT": spuex.micronewton,
|
|
|
|
"MNEWT": spuex.millinewton,
|
|
|
|
"NEWT": spu.newton,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SocketType.PhysicalAccel3DVector: {
|
2024-02-19 16:03:32 +01:00
|
|
|
"default": "UM_S_SQ",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"PM_S_SQ": spu.picometer / spu.second**2,
|
|
|
|
"NM_S_SQ": spu.nanometer / spu.second**2,
|
|
|
|
"UM_S_SQ": spu.micrometer / spu.second**2,
|
|
|
|
"MM_S_SQ": spu.millimeter / spu.second**2,
|
|
|
|
"M_S_SQ": spu.meter / spu.second**2,
|
|
|
|
"KM_S_SQ": spu.kilometer / spu.second**2,
|
|
|
|
"FT_S_SQ": spu.feet / spu.second**2,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.PhysicalForce3DVector: {
|
2024-02-19 15:58:39 +01:00
|
|
|
"default": "UNEWT",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"KG_M_S_SQ": spu.kg * spu.m/spu.second**2,
|
|
|
|
"NNEWT": spuex.nanonewton,
|
|
|
|
"UNEWT": spuex.micronewton,
|
|
|
|
"MNEWT": spuex.millinewton,
|
|
|
|
"NEWT": spu.newton,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
SocketType.PhysicalFreq: {
|
2024-02-19 15:58:39 +01:00
|
|
|
"default": "THZ",
|
2024-02-19 14:28:35 +01:00
|
|
|
"values": {
|
2024-02-19 15:58:39 +01:00
|
|
|
"HZ": spu.hertz,
|
|
|
|
"KHZ": spuex.kilohertz,
|
|
|
|
"MHZ": spuex.megahertz,
|
|
|
|
"GHZ": spuex.gigahertz,
|
|
|
|
"THZ": spuex.terahertz,
|
|
|
|
"PHZ": spuex.petahertz,
|
|
|
|
#"EHZ": spu.exahertz,
|
|
|
|
"VAC_PM": spu.picometer, ## c(vac) = wl*freq
|
|
|
|
"VAC_A": spu.angstrom,
|
|
|
|
"VAC_NM": spu.nanometer,
|
|
|
|
"VAC_UM": spu.micrometer,
|
|
|
|
"VAC_MM": spu.millimeter,
|
|
|
|
"VAC_CM": spu.centimeter,
|
|
|
|
"VAC_M": spu.meter,
|
2024-02-19 14:28:35 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
SocketType_to_color = {
|
2024-02-19 15:58:39 +01:00
|
|
|
# Basic
|
|
|
|
SocketType.Any: (0.8, 0.8, 0.8, 1.0), # Light Grey
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.Bool: (0.7, 0.7, 0.7, 1.0), # Medium Light Grey
|
2024-02-19 15:58:39 +01:00
|
|
|
SocketType.Text: (0.7, 0.7, 0.7, 1.0), # Medium Light Grey
|
|
|
|
SocketType.FilePath: (0.6, 0.6, 0.6, 1.0), # Medium Grey
|
|
|
|
|
|
|
|
# Number
|
|
|
|
SocketType.IntegerNumber: (0.5, 0.5, 1.0, 1.0), # Light Blue
|
|
|
|
SocketType.RationalNumber: (0.4, 0.4, 0.9, 1.0), # Medium Light Blue
|
|
|
|
SocketType.RealNumber: (0.3, 0.3, 0.8, 1.0), # Medium Blue
|
|
|
|
SocketType.ComplexNumber: (0.2, 0.2, 0.7, 1.0), # Dark Blue
|
|
|
|
|
|
|
|
# Vector
|
|
|
|
SocketType.Real2DVector: (0.5, 1.0, 0.5, 1.0), # Light Green
|
|
|
|
SocketType.Complex2DVector: (0.4, 0.9, 0.4, 1.0), # Medium Light Green
|
|
|
|
SocketType.Real3DVector: (0.3, 0.8, 0.3, 1.0), # Medium Green
|
|
|
|
SocketType.Complex3DVector: (0.2, 0.7, 0.2, 1.0), # Dark Green
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Physical
|
2024-02-19 15:58:39 +01:00
|
|
|
SocketType.PhysicalTime: (1.0, 0.5, 0.5, 1.0), # Light Red
|
|
|
|
SocketType.PhysicalAngle: (0.9, 0.45, 0.45, 1.0), # Medium Light Red
|
|
|
|
SocketType.PhysicalLength: (0.8, 0.4, 0.4, 1.0), # Medium Red
|
|
|
|
SocketType.PhysicalArea: (0.7, 0.35, 0.35, 1.0), # Medium Dark Red
|
|
|
|
SocketType.PhysicalVolume: (0.6, 0.3, 0.3, 1.0), # Dark Red
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.PhysicalPoint2D: (0.7, 0.35, 0.35, 1.0), # Medium Dark Red
|
|
|
|
SocketType.PhysicalPoint3D: (0.6, 0.3, 0.3, 1.0), # Dark Red
|
|
|
|
SocketType.PhysicalSize2D: (0.7, 0.35, 0.35, 1.0), # Medium Dark Red
|
|
|
|
SocketType.PhysicalSize3D: (0.6, 0.3, 0.3, 1.0), # Dark Red
|
2024-02-19 15:58:39 +01:00
|
|
|
SocketType.PhysicalMass: (0.9, 0.6, 0.4, 1.0), # Light Orange
|
|
|
|
SocketType.PhysicalSpeed: (0.8, 0.55, 0.35, 1.0), # Medium Light Orange
|
2024-02-19 18:36:16 +01:00
|
|
|
SocketType.PhysicalAccelScalar: (0.7, 0.5, 0.3, 1.0), # Medium Orange
|
|
|
|
SocketType.PhysicalForceScalar: (0.6, 0.45, 0.25, 1.0), # Medium Dark Orange
|
|
|
|
SocketType.PhysicalAccel3DVector: (0.7, 0.5, 0.3, 1.0), # Medium Orange
|
|
|
|
SocketType.PhysicalForce3DVector: (0.6, 0.45, 0.25, 1.0), # Medium Dark Orange
|
2024-02-19 15:58:39 +01:00
|
|
|
SocketType.PhysicalPol: (0.5, 0.4, 0.2, 1.0), # Dark Orange
|
|
|
|
SocketType.PhysicalFreq: (1.0, 0.7, 0.5, 1.0), # Light Peach
|
|
|
|
SocketType.PhysicalSpecPowerDist: (0.9, 0.65, 0.45, 1.0), # Medium Light Peach
|
|
|
|
SocketType.PhysicalSpecRelPermDist: (0.8, 0.6, 0.4, 1.0), # Medium Peach
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Blender
|
2024-02-19 15:58:39 +01:00
|
|
|
SocketType.BlenderObject: (0.7, 0.5, 1.0, 1.0), # Light Purple
|
|
|
|
SocketType.BlenderCollection: (0.6, 0.45, 0.9, 1.0), # Medium Light Purple
|
|
|
|
SocketType.BlenderImage: (0.5, 0.4, 0.8, 1.0), # Medium Purple
|
|
|
|
SocketType.BlenderVolume: (0.4, 0.35, 0.7, 1.0), # Medium Dark Purple
|
|
|
|
SocketType.BlenderGeoNodes: (0.3, 0.3, 0.6, 1.0), # Dark Purple
|
|
|
|
SocketType.BlenderText: (0.5, 0.5, 0.75, 1.0), # Light Lavender
|
2024-02-19 14:28:35 +01:00
|
|
|
|
2024-02-19 15:58:39 +01:00
|
|
|
# Maxwell
|
|
|
|
SocketType.MaxwellSource: (1.0, 1.0, 0.5, 1.0), # Light Yellow
|
|
|
|
SocketType.MaxwellTemporalShape: (0.9, 0.9, 0.45, 1.0), # Medium Light Yellow
|
|
|
|
SocketType.MaxwellMedium: (0.8, 0.8, 0.4, 1.0), # Medium Yellow
|
|
|
|
SocketType.MaxwellMediumNonLinearity: (0.7, 0.7, 0.35, 1.0), # Medium Dark Yellow
|
|
|
|
SocketType.MaxwellStructure: (0.6, 0.6, 0.3, 1.0), # Dark Yellow
|
|
|
|
SocketType.MaxwellBoundBox: (0.9, 0.8, 0.5, 1.0), # Light Gold
|
|
|
|
SocketType.MaxwellBoundFace: (0.8, 0.7, 0.45, 1.0), # Medium Light Gold
|
|
|
|
SocketType.MaxwellMonitor: (0.7, 0.6, 0.4, 1.0), # Medium Gold
|
|
|
|
SocketType.MaxwellFDTDSim: (0.6, 0.5, 0.35, 1.0), # Medium Dark Gold
|
|
|
|
SocketType.MaxwellSimGrid: (0.5, 0.4, 0.3, 1.0), # Dark Gold
|
|
|
|
SocketType.MaxwellSimGridAxis: (0.4, 0.3, 0.25, 1.0), # Darkest Gold
|
2024-02-19 14:28:35 +01:00
|
|
|
}
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
####################
|
|
|
|
# - Node Types
|
|
|
|
####################
|
|
|
|
@append_cls_name_to_values
|
|
|
|
class NodeType(BlenderTypeEnum):
|
2024-02-19 14:28:35 +01:00
|
|
|
KitchenSink = enum.auto()
|
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
# Inputs
|
2024-02-19 14:28:35 +01:00
|
|
|
## Inputs / Scene
|
2024-02-10 17:59:16 +01:00
|
|
|
Time = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
UnitSystem = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Inputs / Parameters
|
|
|
|
NumberParameter = enum.auto()
|
|
|
|
PhysicalParameter = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Inputs / Constants
|
2024-02-10 17:59:16 +01:00
|
|
|
ScientificConstant = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
NumberConstant = enum.auto()
|
|
|
|
PhysicalConstant = enum.auto()
|
|
|
|
BlenderConstant = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Inputs / Lists
|
|
|
|
RealList = enum.auto()
|
|
|
|
ComplexList = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Inputs /
|
|
|
|
InputFile = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Outputs
|
2024-02-19 14:28:35 +01:00
|
|
|
## Outputs / Viewers
|
2024-02-10 17:59:16 +01:00
|
|
|
ValueViewer = enum.auto()
|
|
|
|
ConsoleViewer = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Outputs / Exporters
|
2024-02-10 17:59:16 +01:00
|
|
|
JSONFileExporter = enum.auto()
|
|
|
|
|
|
|
|
|
|
|
|
# Sources
|
2024-02-19 14:28:35 +01:00
|
|
|
## Sources / Temporal Shapes
|
2024-02-10 17:59:16 +01:00
|
|
|
GaussianPulseTemporalShape = enum.auto()
|
|
|
|
ContinuousWaveTemporalShape = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
ListTemporalShape = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Sources /
|
2024-02-10 17:59:16 +01:00
|
|
|
PointDipoleSource = enum.auto()
|
|
|
|
UniformCurrentSource = enum.auto()
|
|
|
|
PlaneWaveSource = enum.auto()
|
|
|
|
ModeSource = enum.auto()
|
|
|
|
GaussianBeamSource = enum.auto()
|
|
|
|
AstigmaticGaussianBeamSource = enum.auto()
|
|
|
|
TFSFSource = enum.auto()
|
|
|
|
|
|
|
|
EHEquivalenceSource = enum.auto()
|
|
|
|
EHSource = enum.auto()
|
|
|
|
|
|
|
|
# Mediums
|
|
|
|
LibraryMedium = enum.auto()
|
|
|
|
|
|
|
|
PECMedium = enum.auto()
|
|
|
|
IsotropicMedium = enum.auto()
|
|
|
|
AnisotropicMedium = enum.auto()
|
|
|
|
|
|
|
|
TripleSellmeierMedium = enum.auto()
|
|
|
|
SellmeierMedium = enum.auto()
|
|
|
|
PoleResidueMedium = enum.auto()
|
|
|
|
DrudeMedium = enum.auto()
|
|
|
|
DrudeLorentzMedium = enum.auto()
|
|
|
|
DebyeMedium = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Mediums / Non-Linearities
|
2024-02-10 17:59:16 +01:00
|
|
|
AddNonLinearity = enum.auto()
|
|
|
|
ChiThreeSusceptibilityNonLinearity = enum.auto()
|
|
|
|
TwoPhotonAbsorptionNonLinearity = enum.auto()
|
|
|
|
KerrNonLinearity = enum.auto()
|
|
|
|
|
|
|
|
# Structures
|
2024-02-19 14:28:35 +01:00
|
|
|
ObjectStructure = enum.auto()
|
|
|
|
GeoNodesStructure = enum.auto()
|
|
|
|
ScriptedStructure = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Structures / Primitives
|
2024-02-10 17:59:16 +01:00
|
|
|
BoxStructure = enum.auto()
|
|
|
|
SphereStructure = enum.auto()
|
|
|
|
CylinderStructure = enum.auto()
|
|
|
|
|
|
|
|
|
|
|
|
# Bounds
|
|
|
|
BoundBox = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Bounds / Bound Faces
|
2024-02-10 17:59:16 +01:00
|
|
|
PMLBoundFace = enum.auto()
|
|
|
|
PECBoundFace = enum.auto()
|
2024-02-19 14:28:35 +01:00
|
|
|
PMCBoundFace = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
BlochBoundFace = enum.auto()
|
|
|
|
PeriodicBoundFace = enum.auto()
|
|
|
|
AbsorbingBoundFace = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
# Monitors
|
|
|
|
EHFieldMonitor = enum.auto()
|
|
|
|
FieldPowerFluxMonitor = enum.auto()
|
|
|
|
EpsilonTensorMonitor = enum.auto()
|
|
|
|
DiffractionMonitor = enum.auto()
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Monitors / Near-Field Projections
|
2024-02-10 17:59:16 +01:00
|
|
|
CartesianNearFieldProjectionMonitor = enum.auto()
|
|
|
|
ObservationAngleNearFieldProjectionMonitor = enum.auto()
|
|
|
|
KSpaceNearFieldProjectionMonitor = enum.auto()
|
|
|
|
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Sims
|
|
|
|
SimGrid = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Sims / Sim Grid Axis
|
|
|
|
AutomaticSimGridAxis = enum.auto()
|
|
|
|
ManualSimGridAxis = enum.auto()
|
|
|
|
UniformSimGridAxis = enum.auto()
|
|
|
|
ArraySimGridAxis = enum.auto()
|
|
|
|
|
|
|
|
## Sim /
|
|
|
|
FDTDSim = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
# Utilities
|
|
|
|
Math = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
## Utilities / Operations
|
|
|
|
ArrayOperation = enum.auto()
|
2024-02-06 21:44:43 +01:00
|
|
|
|
|
|
|
####################
|
2024-02-10 17:59:16 +01:00
|
|
|
# - Node Category Types
|
2024-02-06 21:44:43 +01:00
|
|
|
####################
|
2024-02-19 14:28:35 +01:00
|
|
|
@wrap_values_in_MT
|
2024-02-10 17:59:16 +01:00
|
|
|
class NodeCategory(BlenderTypeEnum):
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Inputs/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_INPUTS = enum.auto()
|
|
|
|
MAXWELLSIM_INPUTS_SCENE = enum.auto()
|
|
|
|
MAXWELLSIM_INPUTS_PARAMETERS = enum.auto()
|
|
|
|
MAXWELLSIM_INPUTS_CONSTANTS = enum.auto()
|
|
|
|
MAXWELLSIM_INPUTS_LISTS = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Outputs/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_OUTPUTS = enum.auto()
|
|
|
|
MAXWELLSIM_OUTPUTS_VIEWERS = enum.auto()
|
|
|
|
MAXWELLSIM_OUTPUTS_EXPORTERS = enum.auto()
|
|
|
|
MAXWELLSIM_OUTPUTS_PLOTTERS = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Sources/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_SOURCES = enum.auto()
|
|
|
|
MAXWELLSIM_SOURCES_TEMPORALSHAPES = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Mediums/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_MEDIUMS = enum.auto()
|
|
|
|
MAXWELLSIM_MEDIUMS_NONLINEARITIES = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Structures/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_STRUCTURES = enum.auto()
|
|
|
|
MAXWELLSIM_STRUCTURES_PRIMITIVES = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Bounds/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_BOUNDS = enum.auto()
|
|
|
|
MAXWELLSIM_BOUNDS_BOUNDFACES = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Monitors/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_MONITORS = enum.auto()
|
|
|
|
MAXWELLSIM_MONITORS_NEARFIELDPROJECTIONS = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Simulations/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_SIMS = enum.auto()
|
|
|
|
MAXWELLSIM_SIMGRIDAXES = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Utilities/
|
2024-02-19 14:28:35 +01:00
|
|
|
MAXWELLSIM_UTILITIES = enum.auto()
|
|
|
|
MAXWELLSIM_UTILITIES_OPERATIONS = enum.auto()
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def get_tree(cls):
|
2024-02-14 12:33:40 +01:00
|
|
|
## TODO: Refactor
|
2024-02-10 17:59:16 +01:00
|
|
|
syllable_categories = [
|
|
|
|
node_category.value.split("_")
|
|
|
|
for node_category in cls
|
2024-02-19 14:28:35 +01:00
|
|
|
if node_category.value != "MAXWELLSIM"
|
2024-02-10 17:59:16 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
category_tree = {}
|
|
|
|
for syllable_category in syllable_categories:
|
|
|
|
# Set Current Subtree to Root
|
|
|
|
current_category_subtree = category_tree
|
|
|
|
|
|
|
|
for i, syllable in enumerate(syllable_category):
|
|
|
|
# Create New Category Subtree and/or Step to Subtree
|
|
|
|
if syllable not in current_category_subtree:
|
|
|
|
current_category_subtree[syllable] = {}
|
|
|
|
current_category_subtree = current_category_subtree[syllable]
|
|
|
|
|
|
|
|
return category_tree
|
2024-02-06 21:44:43 +01:00
|
|
|
|
2024-02-10 17:59:16 +01:00
|
|
|
NodeCategory_to_category_label = {
|
|
|
|
# Inputs/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_INPUTS: "Inputs",
|
|
|
|
NodeCategory.MAXWELLSIM_INPUTS_SCENE: "Scene",
|
|
|
|
NodeCategory.MAXWELLSIM_INPUTS_PARAMETERS: "Parameters",
|
|
|
|
NodeCategory.MAXWELLSIM_INPUTS_CONSTANTS: "Constants",
|
|
|
|
NodeCategory.MAXWELLSIM_INPUTS_LISTS: "Lists",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Outputs/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_OUTPUTS: "Outputs",
|
|
|
|
NodeCategory.MAXWELLSIM_OUTPUTS_VIEWERS: "Viewers",
|
|
|
|
NodeCategory.MAXWELLSIM_OUTPUTS_EXPORTERS: "Exporters",
|
|
|
|
NodeCategory.MAXWELLSIM_OUTPUTS_PLOTTERS: "Plotters",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Sources/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_SOURCES: "Sources",
|
|
|
|
NodeCategory.MAXWELLSIM_SOURCES_TEMPORALSHAPES: "Temporal Shapes",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Mediums/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_MEDIUMS: "Mediums",
|
|
|
|
NodeCategory.MAXWELLSIM_MEDIUMS_NONLINEARITIES: "Non-Linearities",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Structures/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_STRUCTURES: "Structures",
|
|
|
|
NodeCategory.MAXWELLSIM_STRUCTURES_PRIMITIVES: "Primitives",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Bounds/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_BOUNDS: "Bounds",
|
|
|
|
NodeCategory.MAXWELLSIM_BOUNDS_BOUNDFACES: "Bound Faces",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Monitors/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_MONITORS: "Monitors",
|
|
|
|
NodeCategory.MAXWELLSIM_MONITORS_NEARFIELDPROJECTIONS: "Near-Field Projections",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Simulations/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_SIMS: "Simulations",
|
|
|
|
NodeCategory.MAXWELLSIM_SIMGRIDAXES: "Sim Grid Axes",
|
2024-02-10 17:59:16 +01:00
|
|
|
|
|
|
|
# Utilities/
|
2024-02-19 14:28:35 +01:00
|
|
|
NodeCategory.MAXWELLSIM_UTILITIES: "Utilities",
|
|
|
|
NodeCategory.MAXWELLSIM_UTILITIES_OPERATIONS: "Operations",
|
2024-02-10 17:59:16 +01:00
|
|
|
}
|
2024-02-14 12:33:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Protocols
|
|
|
|
####################
|
|
|
|
class SocketDefProtocol(typ.Protocol):
|
|
|
|
socket_type: SocketType
|
|
|
|
label: str
|
|
|
|
|
|
|
|
def init(self, bl_socket: bpy.types.NodeSocket) -> None:
|
|
|
|
...
|
|
|
|
|
|
|
|
class PresetDef(pyd.BaseModel):
|
|
|
|
label: str
|
|
|
|
description: str
|
|
|
|
values: dict[SocketName, typ.Any]
|
|
|
|
|
2024-02-19 14:28:35 +01:00
|
|
|
SocketReturnType = typ.TypeVar('SocketReturnType', covariant=True)
|
|
|
|
## - Covariance: If B subtypes A, then Container[B] subtypes Container[A].
|
|
|
|
## - This is absolutely what we want here.
|
|
|
|
|
|
|
|
#@typ.runtime_checkable
|
2024-02-14 12:33:40 +01:00
|
|
|
#class BLSocketProtocol(typ.Protocol):
|
|
|
|
# socket_type: SocketType
|
|
|
|
# socket_color: BlenderColorRGB
|
|
|
|
#
|
|
|
|
# bl_label: str
|
|
|
|
#
|
|
|
|
# compatible_types: dict[typ.Type, set[typ.Callable[[typ.Any], bool]]]
|
|
|
|
#
|
|
|
|
# def draw(
|
|
|
|
# self,
|
|
|
|
# context: bpy.types.Context,
|
|
|
|
# layout: bpy.types.UILayout,
|
|
|
|
# node: bpy.types.Node,
|
|
|
|
# text: str,
|
|
|
|
# ) -> None:
|
|
|
|
# ...
|
|
|
|
#
|
|
|
|
# @property
|
|
|
|
# def default_value(self) -> typ.Any:
|
|
|
|
# ...
|
|
|
|
# @default_value.setter
|
|
|
|
# def default_value(self, value: typ.Any) -> typ.Any:
|
|
|
|
# ...
|
|
|
|
#
|
|
|
|
|
|
|
|
@typ.runtime_checkable
|
|
|
|
class NodeTypeProtocol(typ.Protocol):
|
|
|
|
node_type: NodeType
|
|
|
|
|
|
|
|
bl_label: str
|
|
|
|
|
|
|
|
input_sockets: dict[SocketName, SocketDefProtocol]
|
|
|
|
output_sockets: dict[SocketName, SocketDefProtocol]
|
|
|
|
presets: dict[PresetID, PresetDef] | None
|
|
|
|
|
|
|
|
# Built-In Blender Methods
|
|
|
|
def init(self, context: bpy.types.Context) -> None:
|
|
|
|
...
|
|
|
|
|
|
|
|
def draw_buttons(
|
|
|
|
self,
|
|
|
|
context: bpy.types.Context,
|
|
|
|
layout: bpy.types.UILayout,
|
|
|
|
) -> None:
|
|
|
|
...
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, ntree: bpy.types.NodeTree) -> None:
|
|
|
|
...
|
|
|
|
|
|
|
|
# Socket Getters
|
|
|
|
def g_input_bl_socket(
|
|
|
|
self,
|
|
|
|
input_socket_name: SocketName,
|
|
|
|
) -> bpy.types.NodeSocket:
|
|
|
|
...
|
|
|
|
|
|
|
|
def g_output_bl_socket(
|
|
|
|
self,
|
|
|
|
output_socket_name: SocketName,
|
|
|
|
) -> bpy.types.NodeSocket:
|
|
|
|
...
|
|
|
|
|
|
|
|
# Socket Methods
|
|
|
|
def s_input_value(
|
|
|
|
self,
|
|
|
|
input_socket_name: SocketName,
|
|
|
|
value: typ.Any
|
|
|
|
) -> typ.Any:
|
|
|
|
...
|
|
|
|
|
|
|
|
# Data-Flow Methods
|
|
|
|
def compute_input(
|
|
|
|
self,
|
|
|
|
input_socket_name: SocketName,
|
|
|
|
) -> typ.Any:
|
|
|
|
...
|
|
|
|
def compute_output(
|
|
|
|
self,
|
|
|
|
output_socket_name: SocketName,
|
|
|
|
) -> typ.Any:
|
|
|
|
...
|