2024-02-26 16:16:06 +01:00
|
|
|
import bpy
|
|
|
|
import sympy as sp
|
|
|
|
|
2024-03-11 16:35:41 +01:00
|
|
|
from ... import contracts as ct
|
2024-02-26 16:16:06 +01:00
|
|
|
from ... import sockets
|
|
|
|
from .. import base
|
|
|
|
|
2024-03-11 16:35:41 +01:00
|
|
|
class PhysicalUnitSystemNode(base.MaxwellSimNode):
|
|
|
|
node_type = ct.NodeType.UnitSystem
|
|
|
|
bl_label = "Unit System"
|
2024-02-26 16:16:06 +01:00
|
|
|
|
|
|
|
input_sockets = {
|
2024-03-11 16:35:41 +01:00
|
|
|
"Unit System": sockets.PhysicalUnitSystemSocketDef(
|
2024-02-26 16:16:06 +01:00
|
|
|
show_by_default=True,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
output_sockets = {
|
2024-03-11 16:35:41 +01:00
|
|
|
"Unit System": sockets.PhysicalUnitSystemSocketDef(),
|
2024-02-26 16:16:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Callbacks
|
|
|
|
####################
|
2024-03-11 16:35:41 +01:00
|
|
|
@base.computes_output_socket(
|
|
|
|
"Unit System",
|
|
|
|
input_sockets = {"Unit System"},
|
|
|
|
)
|
|
|
|
def compute_value(self, input_sockets) -> dict:
|
|
|
|
return input_sockets["Unit System"]
|
2024-02-26 16:16:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################
|
|
|
|
# - Blender Registration
|
|
|
|
####################
|
|
|
|
BL_REGISTER = [
|
|
|
|
PhysicalUnitSystemNode,
|
|
|
|
]
|
|
|
|
BL_NODES = {
|
2024-03-11 16:35:41 +01:00
|
|
|
ct.NodeType.UnitSystem: (
|
|
|
|
ct.NodeCategory.MAXWELLSIM_INPUTS
|
2024-02-26 16:16:06 +01:00
|
|
|
)
|
|
|
|
}
|