WIP checkpoint: fix static registry, uint32 type, GLTF API calls, ARRAY_BONES, missing slot handler
- avatar_slot_registry.gd: _slot_data/_slot_definitions made static (every caller uses AvatarSlotRegistry.method() on the class, never an instance, so the old instance _init() populating them was never invoked); moved registry build to static func _static_init() - avatar_catalog.gd: compute_loadout_hash() return type uint32 -> int (GDScript has no fixed-width uint type) - avatar_loader.gd: GLTFDocument.parse() (doesn't exist) -> the real append_from_buffer()+generate_scene() API; Error.parse_error() (doesn't exist) -> error_string(); Mesh.ARRAY_JOINTS (doesn't exist) -> Mesh.ARRAY_BONES; removed a dead 'mesh is MultiMesh' check that can never be true (MeshInstance3D.mesh is always Mesh, never MultiMesh); fixed _merge_node_into_avatar to recurse into a Skeleton3D's children (skinned meshes are commonly children of the skeleton in a GLB export, the old code returned before ever reaching them) - avatar_customization_ui.gd: added the missing _on_slot_button_pressed handler (referenced by a button connect, never defined -- just calls the existing _select_slot()) Verified: godot --headless --import + --quit is fully clean, and the avatar_customization.tscn scene now instantiates successfully. Remaining, scoped separately: avatar_visualizer.gd calls a AvatarLoader.load_slot() static async API and SlotItem/SlotResult types that don't exist -- AvatarLoader's real API (matching the project's own avatar.md spec: one canonical skeleton, attachments retargeted onto it) is instance-based load_base_body()/load_attachment(). AvatarVisualizer needs rewriting to use that real API; it's the one out of step with spec, not AvatarLoader.
This commit is contained in:
@@ -69,17 +69,20 @@ class SlotDefinition:
|
||||
is_body_part = p_is_body_part
|
||||
|
||||
|
||||
# Slot metadata lookup tables (indexed by SLOT_IDS position).
|
||||
# Slot metadata lookup tables (indexed by SLOT_IDS position). Static: every
|
||||
# caller uses AvatarSlotRegistry.method(...) directly on the class, never on
|
||||
# an instance, so this data has to be built once at class-load time via
|
||||
# _static_init() rather than an instance _init() that's never invoked.
|
||||
# Each entry: { category, mount_bones, exclusive, is_body_part }
|
||||
var _slot_data: Dictionary = {}
|
||||
var _slot_definitions: Array[SlotDefinition] = []
|
||||
static var _slot_data: Dictionary = {}
|
||||
static var _slot_definitions: Array[SlotDefinition] = []
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
static func _static_init() -> void:
|
||||
_build_registry()
|
||||
|
||||
|
||||
func _build_registry() -> void:
|
||||
static func _build_registry() -> void:
|
||||
_slot_data = {
|
||||
"head": {
|
||||
"category": "body_part",
|
||||
|
||||
Reference in New Issue
Block a user