Skip to content

Conversation

@AlterSDB
Copy link
Contributor

Major update that stabilizes DFF model parsing by handling various reading errors related to different geometry section structures in models. Several important improvements and refinements have also been implemented.

Changes:

  • Added multi-clump support
  • Updated tests to support multi-clumps
  • Moved FrameData reading to a separate method
  • Fixed various geometry reading issues
  • Made BinMesh optional to prevent parsing errors in certain models
  • Added export of isTriangleStrip flag for correct geometry construction

AlterSDB and others added 30 commits May 31, 2025 22:32
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Add new readFrameData() method
Some models do not have BinMesh section at all, so we will not try to read it necessarily if it is missing.
For new version with multi-clump support
Allign reading geometry extensions.
*Fix reading empty / unknown sections while reading extension chunks.
*Clean up
Major update that stabilizes DFF model parsing by handling various reading errors. Several important improvements and refinements have been implemented.

Changes:
* Moved FrameData reading to a separate method
* Added multi-clump support
* Made BinMesh optional to prevent parsing errors in certain models
* Updated tests to support multi-clumps
* Added export of isTriangleStrip flag for correct geometry construction
* Fixed various geometry reading issues
@AlterSDB
Copy link
Contributor Author

Oh, sorry for the bunch of commits, I didn't know they would end up here

Copy link
Owner

@Timic3 Timic3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you! I've suggested a few format changes and addition of comments for magic numbers etc. The logic itself looks good👍.

With the output structure change, we will likely bump the package version to 2.0.0, because it introduces breaking changes.

Optionally, we can add multi clump model tests. But this is totally not necessary at the moment and can be done later on.

}
const startPosition = this.getPosition();

while (this.getPosition() - startPosition < clumpSize - 24) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment here explaining this. I assume 24 is the size of the clump header?

Copy link
Contributor Author

@AlterSDB AlterSDB Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a comparison that takes into account the size of two headers - the clump and the section.

It's acceptable to write it this way for clarity:
(this.getPosition() - startPosition) + 12 < clumpSize - 12

let relativePosition = 0;
while (relativePosition < sectionSize) {
const header = this.readSectionHeader();
relativePosition += header.sectionSize + 12;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment explaining the + 12. I think the rest is pretty self-explanatory (looping over extensions).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. 12 bytes is the header size

AlterSDB and others added 3 commits September 18, 2025 21:14
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
Co-authored-by: Timotej <20747466+Timic3@users.noreply.github.com>
@AlterSDB AlterSDB requested a review from Timic3 September 20, 2025 09:29
@Timic3 Timic3 merged commit a6473be into Timic3:master Sep 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants