Переглянути джерело

[rmodels] Add a warning when loading an OBJ with multiple materials. (#4271)

* Update raylib_api.* by CI

* Add a temp warning about material assignments during OBJ loading if the file has more than one material. To be replaced when the OBJ translation code is fixed.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
pull/4273/head
Jeffery Myers 6 місяці тому
committed by GitHub
джерело
коміт
c8bee7c439
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: B5690EEEBB952194
1 змінених файлів з 6 додано та 0 видалено
  1. +6
    -0
      src/rmodels.c

+ 6
- 0
src/rmodels.c Переглянути файл

@ -4092,6 +4092,12 @@ static Model LoadOBJ(const char *fileName)
model.materialCount = 1;
TRACELOG(LOG_INFO, "MODEL: No materials provided, setting one default material for all meshes");
}
else if (model.materialCount > 1 && model.meshCount > 1)
{
// TEMP warning about multiple materials, to be removed when proper splitting code is implemented
// any obj with multiple materials will need to have it's materials assigned by the user in code to work at this time
TRACELOG(LOG_INFO, "MODEL: OBJ has multiple materials, manual material assignment will be required.");
}
// Init model meshes and materials
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));

Завантаження…
Відмінити
Зберегти