godotengine / godotengine/godot
SpriteFrames.get_frame_texture() return the whole spritesheet instead of one frame texture
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproductible in v4.3.stable.official [77dcf97d8], v4.2.2.stable.official [15073afe3], v4.2.1.stable.official [b09f793f5]
### System information
Windows 10 - Godot v4.2.2.stable.official [15073afe3] | Forward+
### Issue description
I used the "Add frames from sprite sheet" option in a SpriteFrames to add 4 frames, like this :

I expect `sp.get_frame_texture("default", 2)` to return only the frame 2 (the green "3") but it returns instead the whole spritesheet.

### Steps to reproduce
- Create a SpriteFrame
- Use a spritesheet to create frames
- Create a debug MeshInstance3D pointed by a camera
- Use a script to set the debug mesh texture to the result of `get_frame_texture()` at game start
- Check that the displayed texture is not a tile texture, but the whole spritesheet texture
### Minimal reproduction project (MRP)
[Proof that SpriteFrames is busted.zip](https://github.com/user-attachments/files/17440689/Proof.that.SpriteFrames.is.busted.zip)
Contributor guide
Research direction
Start with the SpriteFrames.get_frame_texture() entry point and reproduce the issue using the linked minimal reproduction project, checking the result for frame 2 after importing the spritesheet. Done means the method returns the selected individual frame texture rather than the complete spritesheet, while preserving existing SpriteFrames behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100