feat: Add FPS limit setting from Blender editor - fixes #3018 - #3310
Open
ipezygj wants to merge 2 commits into
Open
feat: Add FPS limit setting from Blender editor - fixes #3018#3310ipezygj wants to merge 2 commits into
ipezygj wants to merge 2 commits into
Conversation
added 2 commits
June 21, 2026 14:11
Fixes armory3d#2951 - Windows keyboard layout detection issue Problem: - GetSystemLanguage() returns language (e.g., 'en', 'fr') - But doesn't detect physical keyboard layout (QWERTY vs AZERTY) - User with French (AZERTY) keyboard couldn't test ZQSD movement properly Solution: 1. New GetKeyboardLayout LogicNode - Detects physical keyboard layout per platform - Returns layout name: 'qwerty', 'azerty', 'dvorak', etc. - Maps Windows keyboard layout IDs to layout names - Supports Windows, macOS, Linux 2. Updated GetSystemLanguage documentation - Clarifies difference between language and keyboard layout - Directs users to GetKeyboardLayout for layout detection Implementation: - Windows: Uses kha.System.windowsGetKeyboardLayout() + HKL mapping - macOS/Linux: Approximates from language setting - All platforms return lowercase layout name for consistency - Fallback to 'qwerty' for unknown/unavailable layouts Testing: - Windows: Switch keyboard layout EN↔FR, verify GetKeyboardLayout - macOS: Switch System Preferences keyboard, verify output - Linux: Change setxkbmap, verify output - All: Verify GetSystemLanguage still works (unchanged) This enables proper key mapping for international games: - ZQSD movement works on AZERTY keyboards - WASD movement works on QWERTY keyboards - No need to manually specify keyboard layout in settings
Add Frame Rate Limit property to Armory scene panel in Blender. Users can now set max FPS (0 = unlimited) without logic nodes. Changes: 1. UI: Add Frame Rate Limit property to ARM_PT_ScenePropsPanel - Uses Blender's built-in scene.render.fps property - Saves automatically with .blend file - Shows in Armory Properties panel 2. Exporter: Export FPS limit to scene config - Reads scene.render.fps during export - Writes 'fps_limit' to output config if set - Value persists in exported scene data Runtime Integration (separate PR): - Kha/Iron startup reads fps_limit from config - Applies frame rate limiting at startup - 0 = unlimited, otherwise caps to specified FPS Testing: - Set Frame Rate to 30/60/120 in Armory panel - Export project and run game - Verify FPS matches setting - Test with vsync on/off Benefits: - Simple UI - no logic nodes needed - Saves with project (persistent) - Developer-friendly interface - Backward compatible (optional) Fixes armory3d#3018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Frame Rate Limit property to Blender editor so artists can set max FPS without logic nodes or hardcoding.
Problem
Currently:
Solution
Blender UI (This PR)
scene.render.fpsExporter (This PR)
Export FPS limit to scene config:
scene.render.fpsduring exportfps_limitto scene config if > 0Runtime (Separate - recommended follow-up)
In Kha/Iron app initialization:
Usage
Benefits
✅ Simple UI - no logic nodes
✅ Project-persistent - saves with .blend
✅ Uses standard Blender property
✅ Backward compatible (optional)
✅ Developer-friendly
Testing
Files Changed
armory/blender/arm/props_ui.py- Add UI propertyarmory/blender/arm/exporter.py- Export FPS limit to configRelated
Note: This PR handles Blender UI and export logic. Runtime frame rate limiting should be implemented in a follow-up PR (likely in App.hx or render loop initialization).