- if (!model_path.empty()) {
-
- if ( search_in_AI_path
- && (model_path.substr(model_path.size() - 4, 4) == ".xml")) {
- SGPath ai_path("AI");
- ai_path.append(model_path);
- try {
- model = load3DModel( globals->get_fg_root(), ai_path.str(), props,
- globals->get_sim_time_sec() );
- } catch (const sg_exception &e) {
- model = NULL;
- }
- } else
- model = NULL;
-
- if (!model.get()) {
- try {
- model = load3DModel( globals->get_fg_root(), model_path, props,
- globals->get_sim_time_sec() );
- } catch (const sg_exception &e) {
- model = NULL;
- }
- }