Miorey / wow-model-viewer

A library for displaying interactive 3D models of World of Warcraft characters, items, and NPCs on your website using data from Wowhead. Customize the display with control over camera angles and animation.
https://miorey.github.io/wow-model-viewer/
57 stars 32 forks source link

using id 1 for race throws error #10

Closed Nercus closed 2 years ago

Nercus commented 2 years ago

If the id for human is chosen as race the following error gets thrown:

index.js:274 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Id')
    at getOptions (index.js:274:92)
    at optionsFromModel (index.js:194:27)
    at async generateModels (index.js:215:26)
Miorey commented 2 years ago

@Nercus can you link your code please ?

Nercus commented 2 years ago

sorry forgot that. Here is a simple codesandbox to switch between race values 1 (human) and 2 (orc). I actually discovered that other properties also throw the same error when value is set to 1.

https://codesandbox.io/s/cranky-bose-knj9jk?file=/src/App.vue

Miorey commented 2 years ago

your issue comes from "facialStyle": 5 it will work with 2 not all styles and colors are available for all races. you have to check your character definition in TC or AZ.

I think we can close this issue.

Nercus commented 2 years ago

Oh unfortunately I overlooked changing the other options. Thanks a lot for the help. Quick followup question: What is the meaning of the abbreviations TC and AZ, that you used?

Miorey commented 2 years ago

@Nercus TrinityCore / AzerothCore are two WoW emulators based on mangos (one of the first wow emulator). I create this library for my wow server armory, and I get the characters style from db with the values set by the official. So I never faced your issue or at the begging when I investigate how wowhead works.