View Issue Details

IDProjectCategoryView StatusLast Update
0006610The Dark ModCodingpublic30.03.2025 18:18
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.12 
Target VersionTDM 2.14Fixed in VersionTDM 2.14 
Summary0006610: OBJ model import issues
DescriptionThe issues are:
1) Line starting with '#' must be treated as full-line comments, but parser only skips the '#' token.
2) As seen in idCollisionModelManagerLocal::LoadRenderModel, OBJ model can't be used to auto-generate collision model.
Additional Informationhttps://forums.thedarkmod.com/index.php?/topic/21628-211-obj-model-format/#findComment-500694
TagsNo tags attached.

Activities

stgatilov

stgatilov

30.03.2025 10:12

administrator   ~0016999

Speaking of point 1.
It turns out that idLexer::SkipRestOfLine does not simply fast-forward to the end of the line.
It still parses all the tokens on the line!
So if some token inside comment is malformed according to its rules, it becomes a parsing error.

Also right now only a/b/c faces are supported, i.e. with normals an texcoords specified explicitly.
I guess I can support implicit normals by computing them the standard way.
stgatilov

stgatilov

30.03.2025 18:06

administrator   ~0017000

The issues are fixed:
  r10970 Properly skip commented lines in OBJ, don't stop on syntax error in comments.
  r10971 Automatically generate collision models for OBJ models, just like for LWO/ASE.
Also I added test map to internal assets (not packaged into releases):
  r17327 Added test model in OBJ format and test map which showcases it.

As for implicit normals, I'm not sure I really want to support it.
The main idea of OBJ support was making it very explicit, i.e. you get in the engine exactly what your exporter wrote to the file.
Implementing implicit computations of normals somewhat breaks this paradigm.
Also, I guess some confusion can happen if OBJ file partially has normals and partially does not...

Issue History

Date Modified Username Field Change
15.03.2025 14:51 stgatilov New Issue
15.03.2025 14:51 stgatilov Status new => assigned
15.03.2025 14:51 stgatilov Assigned To => stgatilov
30.03.2025 10:12 stgatilov Note Added: 0016999
30.03.2025 18:06 stgatilov Note Added: 0017000
30.03.2025 18:18 stgatilov Status assigned => resolved
30.03.2025 18:18 stgatilov Resolution open => fixed
30.03.2025 18:18 stgatilov Fixed in Version => TDM 2.14