Skip to content

Fix UV animated textures not working on custom loaded DFF models - #5275

Open
TheCrazy17 wants to merge 3 commits into
multitheftauto:masterfrom
TheCrazy17:fix/dff-uv-anims
Open

Fix UV animated textures not working on custom loaded DFF models#5275
TheCrazy17 wants to merge 3 commits into
multitheftauto:masterfrom
TheCrazy17:fix/dff-uv-anims

Conversation

@TheCrazy17

@TheCrazy17 TheCrazy17 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the missing leading UV anim dictionary read to CRenderWareSA::ReadDFF, the path used by engineLoadDFF and engineReplaceModel, so custom loaded DFF models with UV animated textures play those animations instead of staying static.

https://streamable.com/08znl7 (Now you can use SA:MP animated objects, for example)

Motivation

ReadDFF opens its own stream and parses the clump directly, with no upstream code reading the leading UV anim dictionary chunk first. Native streaming already handles this in ConvertBufferToObject, but engineLoadDFF/engineReplaceModel never got the same treatment, so a custom loaded model with UV animated textures streamed in without ever setting the dictionary those animations need, leaving them static.

Fixes #5151

Test plan

Just replace any object with a model that has UV-animated textures.

uvbboards.zip

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

MatFX needs the per-material UV transform flag, not just the atomic
one, and the UV anim dictionary chunk preceding the clump must be read
before RpClumpStreamRead. Fixes both DFF loading paths.
ConvertBufferToObject, LoadAtomicFile's only native caller, already reads
it; only ReadDFF's engineLoadDFF/engineReplaceModel path still needs it.
@Lpsd

Lpsd commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note for maintainers: please do not merge until I have approved

Comment thread Client/game_sa/CFileLoaderSA.cpp Outdated
Comment thread Client/game_sa/CRenderWareSA.cpp Outdated
@Fernando-A-Rocha

Copy link
Copy Markdown
Contributor

2026 is truly an epic year for MTA

@Kinimel

Kinimel commented Aug 28, 2026

Copy link
Copy Markdown

It could be even more epic, it's going to be legendary.

Also makes the UV anim dict schema address constexpr.
@FileEX FileEX added the bugfix Solution to a bug of any kind label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for DFF UV Animations

5 participants