@lovelace_lol/embody 0.0.1 → 0.0.2

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.
@@ -9,11 +9,14 @@ export * from './cc4';
9
9
  import type { Profile } from '../mappings/types';
10
10
  export { extendPresetWithProfile, mergePresetWithProfile, } from '../mappings/extendPresetWithProfile';
11
11
  export { BETTA_FISH_PRESET, AU_MAPPING_CONFIG, FISH_AU_MAPPING_CONFIG } from './bettaFish';
12
+ export { EMBEDDED_PRESETS, getEmbeddedPreset, } from './registry';
13
+ export type { EmbeddedPresetId } from './registry';
12
14
  export { BONE_NODES as FISH_BONE_NODES, BONE_BINDINGS as FISH_BONE_BINDINGS, COMPOSITE_ROTATIONS as FISH_COMPOSITE_ROTATIONS, EYE_MESH_NODES as FISH_EYE_MESH_NODES, } from './bettaFish';
13
15
  /**
14
16
  * Preset types that can be passed to Embody
15
17
  */
16
- export type PresetType = 'cc4' | 'skeletal' | 'fish' | 'custom';
18
+ import { type EmbeddedPresetId } from './registry';
19
+ export type PresetType = EmbeddedPresetId | 'skeletal' | 'custom';
17
20
  /**
18
21
  * Get a preset by type name.
19
22
  * This allows frontend to pass a string instead of importing the full preset.
@@ -0,0 +1,57 @@
1
+ import type { Profile } from '../mappings/types';
2
+ /**
3
+ * Authoring registry for presets embedded in the Rust/Wasm package.
4
+ *
5
+ * Preset IDs are data identifiers. Runtime code must look them up through the
6
+ * generated Wasm registry rather than branching on individual characters.
7
+ */
8
+ export declare const EMBEDDED_PRESETS: {
9
+ readonly cc4: Profile;
10
+ readonly fish: {
11
+ bones: readonly ["Armature_rootJoint", "Bone_Armature", "Bone.001_Armature", "Bone.009_Armature", "Bone.027_Armature", "Bone.029_Armature", "Bone.031_Armature", "Bone.028_Armature", "Bone.030_Armature", "Bone.032_Armature", "Bone.010_Armature", "Bone.012_Armature", "Bone.014_Armature", "Bone.016_Armature", "Bone.011_Armature", "Bone.013_Armature", "Bone.015_Armature", "Bone.017_Armature", "Bone.002_Armature", "Bone.003_Armature", "Bone.004_Armature", "Bone.005_Armature", "Bone.020_Armature", "Bone.025_Armature", "Bone.026_Armature", "Bone.039_Armature", "Bone.040_Armature", "Bone.041_Armature", "Bone.042_Armature", "Bone.043_Armature", "Bone.044_Armature", "Bone.045_Armature", "Bone.019_Armature", "Bone.023_Armature", "Bone.024_Armature", "Bone.034_Armature", "Bone.036_Armature", "Bone.038_Armature", "Bone.018_Armature", "Bone.021_Armature", "Bone.022_Armature", "Bone.033_Armature", "Bone.035_Armature", "Bone.037_Armature", "Bone.046_Armature", "Bone.048_Armature", "Bone.050_Armature", "Bone.047_Armature", "Bone.049_Armature", "Bone.051_Armature", "Bone.006_Armature", "Bone.007_Armature", "Bone.008_Armature"];
12
+ boneBindings: Record<number, import("..").BoneBinding[]>;
13
+ actionInfo: Record<string, import("..").AUInfo>;
14
+ name?: string;
15
+ animalType?: string;
16
+ emoji?: string;
17
+ auToMorphs: Record<number, import("..").MorphTargetsBySide>;
18
+ auToBones: Record<number, import("..").BoneBinding[]>;
19
+ boneNodes: Record<string, string>;
20
+ bonePrefix?: string;
21
+ boneSuffix?: string;
22
+ morphPrefix?: string;
23
+ morphSuffix?: string;
24
+ suffixPattern?: string;
25
+ leftMorphSuffixes?: string[];
26
+ rightMorphSuffixes?: string[];
27
+ morphToMesh: Record<string, string[]>;
28
+ auFacePartToMeshCategory?: Record<string, string>;
29
+ mappingSections?: import("..").MappingEditorSection[];
30
+ visemeKeys: import("..").MorphTargetRef[];
31
+ visemeSystemId?: string;
32
+ visemeSlots?: import("..").VisemeSlot[];
33
+ visemeBindings?: Record<string, import("..").VisemeBinding>;
34
+ visemeMeshCategory?: string;
35
+ visemeJawAmounts?: number[];
36
+ auMixDefaults?: Record<number, number>;
37
+ auInfo?: Record<string, import("..").AUInfo>;
38
+ eyeMeshNodes?: {
39
+ LEFT: string;
40
+ RIGHT: string;
41
+ };
42
+ compositeRotations?: import("..").CompositeRotation[];
43
+ meshes?: Record<string, import("..").MeshInfo>;
44
+ continuumPairs?: Record<number, {
45
+ pairId: number;
46
+ isNegative: boolean;
47
+ axis: "pitch" | "yaw" | "roll";
48
+ node: string;
49
+ }>;
50
+ continuumLabels?: Record<string, string>;
51
+ annotationRegions?: import("..").AnnotationRegion[];
52
+ disabledRegions?: string[];
53
+ hairPhysics?: import("..").HairPhysicsProfileConfig;
54
+ };
55
+ };
56
+ export type EmbeddedPresetId = keyof typeof EMBEDDED_PRESETS;
57
+ export declare function getEmbeddedPreset(presetId: string): Profile | undefined;
package/dist/three.cjs CHANGED
@@ -7254,17 +7254,20 @@ var BETTA_FISH_PRESET = {
7254
7254
  actionInfo: AU_INFO2
7255
7255
  };
7256
7256
 
7257
+ // src/presets/registry.ts
7258
+ var EMBEDDED_PRESETS = {
7259
+ cc4: CC4_PRESET,
7260
+ fish: BETTA_FISH_PRESET
7261
+ };
7262
+ function getEmbeddedPreset(presetId) {
7263
+ const normalized = presetId.trim().toLowerCase();
7264
+ return EMBEDDED_PRESETS[normalized];
7265
+ }
7266
+
7257
7267
  // src/presets/index.ts
7258
7268
  function getPreset(presetType) {
7259
- switch (presetType) {
7260
- case "fish":
7261
- case "skeletal":
7262
- return BETTA_FISH_PRESET;
7263
- case "cc4":
7264
- case "custom":
7265
- default:
7266
- return CC4_PRESET;
7267
- }
7269
+ const compatibilityId = presetType === "skeletal" ? "fish" : presetType;
7270
+ return compatibilityId ? getEmbeddedPreset(compatibilityId) ?? CC4_PRESET : CC4_PRESET;
7268
7271
  }
7269
7272
  async function getPresetWithProfile(presetType, profile) {
7270
7273
  return extendPresetWithProfile(getPreset(presetType), profile);