Comments (3)
see private note "Blender window size"
import ctypes
from bqt.blender_applications.win32_blender_application import get_process_hwnds
from ctypes import wintypes
user32 = ctypes.windll.user32
process_windows = get_process_hwnds()
for win in process_windows:
# get height and width
rect = wintypes.RECT()
user32.GetWindowRect(win.hwnd, ctypes.byref(rect))
height = rect.bottom - rect.top
width = rect.right - rect.left
print(height, width)
import bpy
print("height bpy", bpy.context.window_manager.windows[0].height, "width", bpy.context.window_manager.windows[0].width)
type | height | width |
---|---|---|
main window user32 | 2065 | 2124 |
main window bpy | 2009 | 2102 |
main window diff | 56 | 22 |
when qt wrapped window is 0 height. bpy returns 0
but qt returns 56 height. likely the title bar height
measure with powertoys returns 28 pixels height
windows, 150% scale on 3840 x 2160px
from bqt.
- also window moves position
from bqt.
turns out we didnt need the fancy ctypes stuff. we can just get size and pos from the blender window with bpy
works on all OS with no extra effort for us
from bqt.
Related Issues (20)
- technical writing kickoff HOT 20
- create page to explain black
- move demo code to wiki HOT 2
- alt/ctrl/shift not work well when there is an other window(like preference window) pop up HOT 2
- demo code not working because QApplication is None HOT 3
- Qthead: not correct context HOT 3
- Enabling QT will affect the capture of UI controls HOT 6
- bqt add-on plugget install error: SSL CERTIFICATE VERIFY FAILED HOT 4
- Cannot download bqt with plugget HOT 4
- blender window content stretches on rescaling of the window HOT 1
- [bug] drag vector properties will move mouse out of the position when using wrap mode
- bqt crashes with PySide2.QtWebEngineWidgets
- Tooltips on QPushButton widgets trigger a warning HOT 2
- auto parent bug HOT 1
- causes parent bug on buttonizer
- can't edit many value in same time HOT 2
- QFileDialog seems broken since 1.3.1 HOT 3
- qt_core.py might select the PySide version that is not intended HOT 1
- Crashes on setup test HOT 11
- unify requirements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bqt.