Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,17 @@ Vehicle *ScenarioReader::parseOSCVehicle(pugi::xml_node vehicleNode)
if (!modelIdStr.empty())
{
vehicle->model_id_ = strtoi(modelIdStr);

// If no explicit model3d was specified, update the 3D model path based on model_id
if (!model3d_attr && vehicle->properties_.file_.filepath_.empty())
{
std::string modelFilename = SE_Env::Inst().GetModelFilenameById(vehicle->model_id_);
if (!modelFilename.empty())
{
vehicle->SetModel3DFullPath(modelFilename, DirNameOf(SE_Env::Inst().GetOSCFilePath()) + "/../models");
}
}

if (SE_Env::Inst().GetOptions().IsOptionArgumentSet("record"))
{
CheckModelId(vehicle);
Expand Down
Loading