Skip to content

Commit c8bee7c

Browse files
[rmodels] Add a warning when loading an OBJ with multiple materials. (raysan5#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>
1 parent bae0af2 commit c8bee7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rmodels.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,6 +4092,12 @@ static Model LoadOBJ(const char *fileName)
40924092
model.materialCount = 1;
40934093
TRACELOG(LOG_INFO, "MODEL: No materials provided, setting one default material for all meshes");
40944094
}
4095+
else if (model.materialCount > 1 && model.meshCount > 1)
4096+
{
4097+
// TEMP warning about multiple materials, to be removed when proper splitting code is implemented
4098+
// any obj with multiple materials will need to have it's materials assigned by the user in code to work at this time
4099+
TRACELOG(LOG_INFO, "MODEL: OBJ has multiple materials, manual material assignment will be required.");
4100+
}
40954101

40964102
// Init model meshes and materials
40974103
model.meshes = (Mesh *)RL_CALLOC(model.meshCount, sizeof(Mesh));

0 commit comments

Comments
 (0)