@volter/editor-blender 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -856,24 +856,82 @@ function py(name: string): string {
856
856
  return JSON.stringify(name);
857
857
  }
858
858
 
859
- /** Blender's own name for each operator, as its undo history labels the step (`ot->name`). */
860
- const operatorNames = new Map<string, string>();
861
-
862
859
  /**
863
860
  * THE STEP'S LABEL IS THE OPERATOR'S OWN NAME, the one Blender's Edit menu shows: Add › Cone is
864
- * "Undo Add Cone", not "Undo Blender Python". Asked of Blender, not kept in a table here, because
865
- * its names do not follow the menu rows (a Point light is "Add Light").
861
+ * "Undo Add Cone", not "Undo Blender Python". Blender's names do not follow the menu rows (a Point
862
+ * light is "Add Light"), so they are Blender's, read from this build with
863
+ * `bpy.ops.<id>.get_rna_type().name` (`ot->name`) for every operator these menus run and every
864
+ * `object.*_add`. An id not here keeps the script door's label.
865
+ *
866
+ * A TABLE, NOT A QUESTION PER CLICK. Asking Blender first (a history-free execute before the
867
+ * operator) never answered on the browser-substrate page, so Add and Apply did nothing there
868
+ * (measured 2026-09-28 in the hosted tab; why that execute hangs there is not established).
866
869
  */
867
- async function operatorLabel(body: string): Promise<string> {
870
+ const OPERATOR_NAMES: Readonly<Record<string, string>> = {
871
+ 'curve.primitive_bezier_circle_add': "Add B\u00e9zier Circle",
872
+ 'curve.primitive_bezier_curve_add': "Add B\u00e9zier",
873
+ 'curve.primitive_nurbs_circle_add': "Add Nurbs Circle",
874
+ 'curve.primitive_nurbs_curve_add': "Add Nurbs Curve",
875
+ 'curve.primitive_nurbs_path_add': "Add Path",
876
+ 'image.import_as_mesh_planes': "Import Images as Planes",
877
+ 'mesh.primitive_circle_add': "Add Circle",
878
+ 'mesh.primitive_cone_add': "Add Cone",
879
+ 'mesh.primitive_cube_add': "Add Cube",
880
+ 'mesh.primitive_cylinder_add': "Add Cylinder",
881
+ 'mesh.primitive_grid_add': "Add Grid",
882
+ 'mesh.primitive_ico_sphere_add': "Add Ico Sphere",
883
+ 'mesh.primitive_monkey_add': "Add Monkey",
884
+ 'mesh.primitive_plane_add': "Add Plane",
885
+ 'mesh.primitive_torus_add': "Add Torus",
886
+ 'mesh.primitive_uv_sphere_add': "Add UV Sphere",
887
+ 'object.armature_add': "Add Armature",
888
+ 'object.camera_add': "Add Camera",
889
+ 'object.collection_add': "Add to Collection",
890
+ 'object.collection_instance_add': "Add Collection Instance",
891
+ 'object.constraint_add': "Add Constraint",
892
+ 'object.curves_empty_hair_add': "Add Empty Curves",
893
+ 'object.curves_random_add': "Add Random Curves",
894
+ 'object.data_instance_add': "Add Object Data Instance",
895
+ 'object.delete': "Delete",
896
+ 'object.duplicate': "Duplicate Objects",
897
+ 'object.effector_add': "Add Effector",
898
+ 'object.empty_add': "Add Empty",
899
+ 'object.empty_image_add': "Add Empty Image/Drop Image to Empty",
900
+ 'object.grease_pencil_add': "Add Grease Pencil",
901
+ 'object.grease_pencil_dash_modifier_segment_add': "Add Segment",
902
+ 'object.grease_pencil_time_modifier_segment_add': "Add Segment",
903
+ 'object.lattice_add_to_selected': "Add Lattice Deformer",
904
+ 'object.light_add': "Add Light",
905
+ 'object.lightprobe_add': "Add Light Probe",
906
+ 'object.location_clear': "Clear Location",
907
+ 'object.material_slot_add': "Add Material Slot",
908
+ 'object.metaball_add': "Add Metaball",
909
+ 'object.modifier_add': "Add Modifier",
910
+ 'object.origin_set': "Set Origin",
911
+ 'object.particle_system_add': "Add Particle System Slot",
912
+ 'object.pointcloud_random_add': "Add Point Cloud",
913
+ 'object.quick_fur': "Quick Fur",
914
+ 'object.rotation_clear': "Clear Rotation",
915
+ 'object.scale_clear': "Clear Scale",
916
+ 'object.shaderfx_add': "Add Effect",
917
+ 'object.shape_key_add': "Add Shape Key",
918
+ 'object.speaker_add': "Add Speaker",
919
+ 'object.text_add': "Add Text",
920
+ 'object.transform_apply': "Apply Object Transform",
921
+ 'object.vertex_group_add': "Add Vertex Group",
922
+ 'object.volume_add': "Add Volume",
923
+ 'object.volume_import': "Import OpenVDB Volume",
924
+ 'surface.primitive_nurbs_surface_circle_add': "Add Surface Circle",
925
+ 'surface.primitive_nurbs_surface_curve_add': "Add Surface Curve",
926
+ 'surface.primitive_nurbs_surface_cylinder_add': "Add Surface Cylinder",
927
+ 'surface.primitive_nurbs_surface_sphere_add': "Add Surface Sphere",
928
+ 'surface.primitive_nurbs_surface_surface_add': "Add Surface Patch",
929
+ 'surface.primitive_nurbs_surface_torus_add': "Add Surface Torus",
930
+ };
931
+
932
+ function operatorLabel(body: string): string | undefined {
868
933
  const id = /bpy\.ops\.([a-z_]+\.[a-z0-9_]+)\(/.exec(body)?.[1];
869
- if (id === undefined) return 'Blender Python';
870
- const known = operatorNames.get(id);
871
- if (known !== undefined) return known;
872
- const answer = await blenderExecute(`import bpy\nprint(bpy.ops.${id}.get_rna_type().name)`, false);
873
- const name = answer.error === null ? answer.result.trim() : '';
874
- if (name === '') return 'Blender Python';
875
- operatorNames.set(id, name);
876
- return name;
934
+ return id === undefined ? undefined : OPERATOR_NAMES[id];
877
935
  }
878
936
 
879
937
  /**
@@ -902,7 +960,7 @@ async function runBlenderOperator(
902
960
  'made = [o.name for o in bpy.data.objects if o.name not in before]',
903
961
  'print("\\n".join(made))',
904
962
  ].join('\n');
905
- const answer = await blenderExecute(code, true, label ?? (await operatorLabel(body)));
963
+ const answer = await blenderExecute(code, true, label ?? operatorLabel(body));
906
964
  // THE ENGINE'S REFUSAL, VERBATIM. `session.py::execute` answers with the
907
965
  // traceback in `error` rather than raising, and a paraphrase here is how a
908
966
  // refusal becomes a shrug.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/editor-blender",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "AGPL-3.0-only AND GPL-3.0-or-later",
5
- "version": "0.1.25",
5
+ "version": "0.1.26",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -70,14 +70,14 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@modelcontextprotocol/sdk": "1.30.0",
73
- "@volter/blender-engine": "0.1.23",
74
- "@volter/editor-threejs": "0.5.85",
73
+ "@volter/blender-engine": "0.1.24",
74
+ "@volter/editor-threejs": "0.5.86",
75
75
  "zod": "^4.3.6"
76
76
  },
77
77
  "peerDependencies": {
78
- "@volter/editor-live": "0.5.85",
79
- "@volter/editor-project": "0.5.85",
80
- "@volter/editor-sdk": "0.5.85",
78
+ "@volter/editor-live": "0.5.86",
79
+ "@volter/editor-project": "0.5.86",
80
+ "@volter/editor-sdk": "0.5.86",
81
81
  "react": "^19.0.0",
82
82
  "react-dom": "^19.0.0",
83
83
  "three": "^0.180.0",