fix: renamed Tidy3D Web Runner to Importer

This provides consistency in the interface.
main
Sofus Albert Høgsbro Rose 2024-05-16 13:15:39 +02:00
parent 060f54bd94
commit e51ec8f43f
Signed by: so-rose
GPG Key ID: AD901CB0F3701434
3 changed files with 11 additions and 18 deletions

View File

@ -51,7 +51,6 @@ class NodeType(blender_type_enum.BlenderTypeEnum):
Viewer = enum.auto() Viewer = enum.auto()
## Outputs / File Exporters ## Outputs / File Exporters
Tidy3DWebExporter = enum.auto() Tidy3DWebExporter = enum.auto()
Tidy3DWebRunner = enum.auto()
## Outputs / Web Exporters ## Outputs / Web Exporters
JSONFileExporter = enum.auto() JSONFileExporter = enum.auto()

View File

@ -17,22 +17,16 @@
from . import ( from . import (
blender_constant, blender_constant,
expr_constant, expr_constant,
number_constant,
physical_constant,
scientific_constant, scientific_constant,
) )
BL_REGISTER = [ BL_REGISTER = [
*expr_constant.BL_REGISTER, *expr_constant.BL_REGISTER,
*scientific_constant.BL_REGISTER, *scientific_constant.BL_REGISTER,
*number_constant.BL_REGISTER,
*physical_constant.BL_REGISTER,
*blender_constant.BL_REGISTER, *blender_constant.BL_REGISTER,
] ]
BL_NODES = { BL_NODES = {
**expr_constant.BL_NODES, **expr_constant.BL_NODES,
**scientific_constant.BL_NODES, **scientific_constant.BL_NODES,
**number_constant.BL_NODES,
**physical_constant.BL_NODES,
**blender_constant.BL_NODES, **blender_constant.BL_NODES,
} }

View File

@ -33,7 +33,7 @@ log = logger.get(__name__)
# - Operators # - Operators
#################### ####################
class RunSimulation(bpy.types.Operator): class RunSimulation(bpy.types.Operator):
"""Run a Tidy3D simulation accessible from a `Tidy3DWebRunnerNode`.""" """Run a Tidy3D simulation accessible from a `Tidy3DWebImporterNode`."""
bl_idname = ct.OperatorType.NodeRunSimulation bl_idname = ct.OperatorType.NodeRunSimulation
bl_label = 'Run Sim' bl_label = 'Run Sim'
@ -44,10 +44,10 @@ class RunSimulation(bpy.types.Operator):
return ( return (
# Check Tidy3D Cloud # Check Tidy3D Cloud
tdcloud.IS_AUTHENTICATED tdcloud.IS_AUTHENTICATED
# Check Tidy3DWebRunnerNode is Accessible # Check Tidy3DWebImporterNode is Accessible
and hasattr(context, 'node') and hasattr(context, 'node')
and hasattr(context.node, 'node_type') and hasattr(context.node, 'node_type')
and context.node.node_type == ct.NodeType.Tidy3DWebRunner and context.node.node_type == ct.NodeType.Tidy3DWebImporter
# Check Task is Runnable # Check Task is Runnable
and context.node.is_task_runnable and context.node.is_task_runnable
) )
@ -60,7 +60,7 @@ class RunSimulation(bpy.types.Operator):
class ReloadTrackedTask(bpy.types.Operator): class ReloadTrackedTask(bpy.types.Operator):
"""Reload information of the selected task in a `Tidy3DWebRunnerNode`.""" """Reload information of the selected task in a `Tidy3DWebImporterNode`."""
bl_idname = ct.OperatorType.NodeReloadTrackedTask bl_idname = ct.OperatorType.NodeReloadTrackedTask
bl_label = 'Reload Tracked Tidy3D Cloud Task' bl_label = 'Reload Tracked Tidy3D Cloud Task'
@ -71,10 +71,10 @@ class ReloadTrackedTask(bpy.types.Operator):
return ( return (
# Check Tidy3D Cloud # Check Tidy3D Cloud
tdcloud.IS_AUTHENTICATED tdcloud.IS_AUTHENTICATED
# Check Tidy3DWebRunnerNode is Accessible # Check Tidy3DWebImporterNode is Accessible
and hasattr(context, 'node') and hasattr(context, 'node')
and hasattr(context.node, 'node_type') and hasattr(context.node, 'node_type')
and context.node.node_type == ct.NodeType.Tidy3DWebRunner and context.node.node_type == ct.NodeType.Tidy3DWebImporter
) )
def execute(self, context): def execute(self, context):
@ -87,9 +87,9 @@ class ReloadTrackedTask(bpy.types.Operator):
#################### ####################
# - Node # - Node
#################### ####################
class Tidy3DWebRunnerNode(base.MaxwellSimNode): class Tidy3DWebImporterNode(base.MaxwellSimNode):
node_type = ct.NodeType.Tidy3DWebRunner node_type = ct.NodeType.Tidy3DWebImporter
bl_label = 'Tidy3D Web Runner' bl_label = 'Tidy3D Web Runner/Importer'
input_sockets: typ.ClassVar = { input_sockets: typ.ClassVar = {
'Cloud Task': sockets.Tidy3DCloudTaskSocketDef( 'Cloud Task': sockets.Tidy3DCloudTaskSocketDef(
@ -269,8 +269,8 @@ class Tidy3DWebRunnerNode(base.MaxwellSimNode):
BL_REGISTER = [ BL_REGISTER = [
RunSimulation, RunSimulation,
ReloadTrackedTask, ReloadTrackedTask,
Tidy3DWebRunnerNode, Tidy3DWebImporterNode,
] ]
BL_NODES = { BL_NODES = {
ct.NodeType.Tidy3DWebRunner: (ct.NodeCategory.MAXWELLSIM_INPUTS_WEBIMPORTERS) ct.NodeType.Tidy3DWebImporter: (ct.NodeCategory.MAXWELLSIM_INPUTS_WEBIMPORTERS)
} }