File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -466,14 +466,18 @@ Ref<OFFDocument4D> OFFDocument4D::_import_load_from_raw_text(const String &p_raw
466466 int current_vertex_index = 0 ;
467467 int min_items_per_line = 3 ;
468468 bool can_warn = true ;
469+ if (p_raw_text.contains (" \r " )) {
470+ WARN_PRINT (" OFF import: Warning: OFF file " + p_path + " contains carriage return characters (\\ r). Remove them to silence this warning." );
471+ can_warn = false ;
472+ }
469473 const PackedStringArray lines = p_raw_text.split (" \n " , false );
470474 for (const String &line : lines) {
471475 if (line.is_empty () || line.begins_with (" #" )) {
472476 continue ;
473477 }
474478 if (line.contains (" OFF" )) {
475479 // "OFF" by itself is 3D OFF.
476- if (line != " OFF" ) {
480+ if (line != " OFF" && is_digit (line[ 0 ]) ) {
477481 const int declared_dimension = line.to_int ();
478482 if (declared_dimension < 3 ) {
479483 min_items_per_line = declared_dimension;
You can’t perform that action at this time.
0 commit comments