|
|
|
05-22-2021, 05:47 AM
|
#201
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Rodilab
In order to create a custom widget (setting several color values in one widget), I would like to draw this :
|
Draw two gradients: white to color (left to right) + transparent black to opaque black (top to bottom). This is what Dear ImGui's picker code does:
Code:
local white = 0xffffffff
local black = 0x000000ff
local color = 0xff0000ff
r.ImGui_DrawList_AddRectFilledMultiColor(draw_list,
pos[1], pos[2], pos[1] + size, pos[2] + size, white, color, color, white)
r.ImGui_DrawList_AddRectFilledMultiColor(draw_list,
pos[1], pos[2], pos[1] + size, pos[2] + size, 0, 0, black, black)
A (perhaps simpler) alternative would be to overlay the extra draggable buttons over the native color picker.
Last edited by cfillion; 05-22-2021 at 05:57 AM.
|
|
|
05-22-2021, 07:03 AM
|
#202
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Nice !
Thank you (again)
|
|
|
05-25-2021, 11:47 AM
|
#203
|
Human being with feelings
Join Date: Dec 2015
Posts: 172
|
Hi! Is there any minimal Reaper C++ extension IMGui template available?
|
|
|
05-25-2021, 11:27 PM
|
#205
|
Human being with feelings
Join Date: Dec 2015
Posts: 172
|
Quote:
Originally Posted by cfillion
|
Cool! Thanks!
|
|
|
06-02-2021, 12:38 AM
|
#206
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Hi
Since 0.4.0 it is possible to save the position, size and dock of the context.
Is there a way to save only some of these parameters?
For example, save the position but not the size.
Thanks
Last edited by Rodilab; 06-02-2021 at 09:56 AM.
|
|
|
06-02-2021, 03:35 AM
|
#207
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Hi,
I found a bug in keyboard keycodes.
The keycodes of the number keys are wrong for me.
For example :
When I press "1" key, ImGui_IsKeyDown(ctx,38) return true. And ImGui_IsKeyDown(ctx,49) return false.
The key code should be 49. 38 is the up arrow. By the way, the top arrow also returns true with keycode 38.
The same with all key numbers.
Tested with macOS 10.15, ReaImGui 0.4, Reaper 6.29
|
|
|
06-04-2021, 03:04 PM
|
#208
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Released verson 0.4.1:
Code:
• Add a C++ extension example [p=2447754]
• C++ binding: add missing ImGui_Font declaration
• Demo: fix 'Scroll Offset' and 'Scroll To Pos' buttons in Layout & Scrolling->Scrolling
• Document CreateFont's supported generic font families
• macOS: improve keycode compatibility across various keyboard layouts [p=2450237]
• Update Dear ImGui to v1.83 (release notes at https://github.com/ocornut/imgui/releases/tag/v1.83)
• Workaround a possible race condition when detecting the splash screen [p=2450259]
• Windows: fix a crash when dragging files from some sources [p=2445786]
API changes:
• Add ConfigFlags_NoRestoreSize [p=2450209]
• Add TableSetColumnEnabled
Last edited by cfillion; 06-04-2021 at 04:00 PM.
|
|
|
06-05-2021, 03:22 AM
|
#209
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thank you! I've got to try the new font feature!
|
|
|
06-10-2021, 09:04 AM
|
#210
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Do I get this right, ImGui supports GPU hardware acceleration and therefore the GUI will be rendered entirely on the GPU?
|
|
|
06-10-2021, 10:09 AM
|
#211
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by _Stevie_
Do I get this right, ImGui supports GPU hardware acceleration and therefore the GUI will be rendered entirely on the GPU?
|
Yes. The CPU produces a list of textured triangles and sends them to the GPU for rendering into pixels on the screen.
(For the curious: See Tools -> Metrics/Debugger -> DrawLists in the demo or call ImGui_ShowMetricsWindow in your script. https://i.imgur.com/l1ei6Hy.png)
Last edited by cfillion; 06-10-2021 at 10:19 AM.
|
|
|
06-10-2021, 11:54 PM
|
#212
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Amazing, so in essence this means: ImGui is reducing the CPU load and puts it on the GPU and is therefore more efficient than using native Reaper gfx functions.
|
|
|
06-11-2021, 12:06 AM
|
#213
|
Human being with feelings
Join Date: Jan 2011
Posts: 1,167
|
Hi. Thank you so much cfillion. For all.
I already asked in Rodilab Color palette thread but anyway:
is it possible to hide script title bar?
|
|
|
06-11-2021, 10:04 AM
|
#214
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Daodan
Hi. Thank you so much cfillion. For all.
I already asked in Rodilab Color palette thread but anyway:
is it possible to hide script title bar?
|
Currently it should be possible using JS_ReaScript API hackery to modify the window's styles (I haven't tested).
In the future: yes*. It's part of the windowing improvements I'm working on for v0.5:
* = Unless major unexpected problems arises during development. https://www.monkeyuser.com/assets/im...root-cause.png
Last edited by cfillion; 06-11-2021 at 12:47 PM.
|
|
|
06-11-2021, 02:04 PM
|
#215
|
Human being with feelings
Join Date: Jan 2011
Posts: 1,167
|
Quote:
Originally Posted by cfillion
Currently it should be possible using JS_ReaScript API hackery to modify the window's styles (I haven't tested).
In the future: yes*. It's part of the windowing improvements I'm working on for v0.5:
|
Nice! Thank you.
|
|
|
06-13-2021, 10:08 AM
|
#216
|
Human being with feelings
Join Date: Sep 2019
Location: Berlin
Posts: 61
|
Debouncing
Is there a sensible way to debounce inside the frame() loop? Does rv return false if nothing changed for example or does it require some state management?
|
|
|
06-13-2021, 10:16 AM
|
#217
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Depends on what you're having a bouncing problem with. Can you elaborate?
|
|
|
06-18-2021, 02:08 AM
|
#218
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Released version v0.5-beta! Summary of the changes:
- Each Dear ImGui 'virtual window' (Begin/End) open in their own dedicated window
- Tooltips, popups and menus are visible even outside of their parent canvas boundaries
- ImGui windows can be docked into each other (in addition to into REAPER's dockers)
These improvements come at the cost of backward compatibility breakage (upgrade tips below). Because of this, v0.5 is marked as "beta" in ReaPack. It must be manually selected for installation in ReaPack's package browser. I'm currently planning on marking it as "stable" for automatic updates in a week.
Code:
• Create a dedicated platform window for each ImGui virtual window
• Demo: fix the size preset buttons in Examples->Constrained-resizing window
• Demo: move docking example to 'Window options'
• Fix removing focus using SetWindowFocusEx
• macOS: count vertical coordinates from the top of the primary monitor
• Switch to Dear ImGui v1.83's 'docking' branch
• Re-implement docking into REAPER using ImGui's docking branch's beta API
• Update the Lua, EEL2, Python and C++ examples
• Windows: detect HiDPI scaling changes when docked in REAPER (Per-Monitor v2 mode)
• Windows: fix positioning of the system's Input Method Editor (IME) on HiDPI monitors
API changes:
• Add Col_DockingPreview, Col_DockingEmptyBg
• Add ConfigFlags_DockingEnable, WindowFlags_NoDocking
• Add IsWindowDocked, GetWindowDockID, SetNextWindowDockID
• Add SetWindow* functions without a window name argument (renamed existing functions to SetWindow*Ex)
• C++ binding: allow omitting optional arguments (C++17 or newer required)
• CollapsingHeader: treat p_visible=false the same as p_visible=nil (= disable the close button)
• Make Begin/End consistent with the rest of the API (call End only if Begin returned true)
• Mark 'p_*' arguments as output values in the documentation
• Remove BeginPopupContextVoid, BeginMainMenuBar and EndMainMenuBar
• Remove ConfigFlags_NoRestoreSize, GetDisplaySize
• Remove GetNativeHwnd, IsCloseRequested, GetDock, SetDock
• Remove size/position/dock arguments of CreateContext
• Treat 'p_open=false' as input the same as 'p_open=nil' for compatibility with EEL2
New CreateContext
CreateContext no longer opens a window. The size, position and dock arguments have been removed. The 'label' parameter is used for state persistence and when docking into REAPER.
Code:
ctx = reaper.ImGui_CreateContext('My script', reaper.ImGui_ConfigFlags_DockingEnable())
Begin/End changes
Begin/End, BeginChild/EndChild and BeginChildFrame/EndChildFrame were the only three pair of functions for which End had to always be called even if the corresponding Begin returned false.
They now match the rest of Dear ImGui's functions. (This change is likely to be made in Dear ImGui in a future 1.8x release. I have emulated it in ReaImGui now to avoid breaking scripts again later.)
Code:
if reaper.ImGui_Begin(...) then
reaper.ImGui_End(...)
end
Removal of IsCloseRequested
The second return value of ImGui_Begin becomes false when the window was requested to be closed.
Code:
function loop()
local visible, open = reaper.ImGui_Begin(ctx, 'Window name', true)
if visible then
reaper.ImGui_Text(ctx, 'Lorem ipsum dolor sit amet...')
reaper.ImGui_End(ctx)
end
if open then
reaper.defer(loop)
else
reaper.ImGui_DestroyContext(ctx)
end
end
New docking API (again)
GetDock and SetDock have been replaced by (part of) Dear ImGui's beta docking API: GetWindowDockID, SetNextWindowDockID and IsWindowDocked.
These new functions are used for both Dear ImGui internal docking (ID > 0) and REAPER docking (ID < 0). See Demo -> Window options.
Code:
-- dock into REAPER's first docker on first use
reaper.SetNextWindowDockID(ctx, -1, reaper.ImGui_Cond_FirstUseEver())
if reaper.ImGui_Begin(...) then
Removal of ConfigFlags_NoRestoreSize
Use SetNextWindowSize instead (or SetNextWindowSizeConstraints for defining minimum/maximum sizes).
Last edited by cfillion; 06-18-2021 at 11:18 AM.
|
|
|
06-18-2021, 10:15 AM
|
#219
|
Human being with feelings
Join Date: Sep 2019
Posts: 85
|
This is awesome!
Do you have in plans to add support for images?
|
|
|
06-19-2021, 04:36 AM
|
#220
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Nice !
Big changes. I hope to find time to modify my scripts before the release of the stable v0.5.
Why remove GetNativeHwnd ?
|
|
|
06-19-2021, 01:41 PM
|
#221
|
Human being with feelings
Join Date: Sep 2019
Location: Finland
Posts: 755
|
Quote:
Originally Posted by Rodilab
Why remove GetNativeHwnd ?
|
I was also wondering this. I've been using GetNativeHwnd and comparing it to JS_Window_GetFocus to check if my ImGui context has focus, so I can visually indicate that. Is there a different/better way of doing this?
(Edit: to be clear, this is a fairly minor issue for me... Visually indicating focus isn't really something I can't live without. But it's a neat little feature to have, especially when your script has keyboard shortcuts and you want to know where your input is going...)
Last edited by elcalen; 06-19-2021 at 01:51 PM.
|
|
|
06-19-2021, 01:59 PM
|
#222
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by mtk
Do you have in plans to add support for images?
|
Yes. I don't know yet when it will happen though (v0.6? v0.7?).
Quote:
Originally Posted by Rodilab
Why remove GetNativeHwnd ?
|
Because each Begin() open a window, there is no longer a single window HWND per context for GetNativeHwnd to return. I haven't added a replacement because it isn't necessary anymore (I might add one if there's a good use-case).
The reasons for its existence were originally to allow manual external docking and using js_ReaScriptAPI for filling ReaImGui's lack of a window management API. External docking turned out to be buggy. And now Dear ImGui's window management API work on the real windows (rather than on pre-v0.5's "virtual windows").
Quote:
Originally Posted by elcalen
I was also wondering this. I've been using GetNativeHwnd and comparing it to JS_Window_GetFocus to check if my ImGui context has focus, so I can visually indicate that. Is there a different/better way of doing this?
|
ImGui_IsWindowFocused returns whether the current window has focus. See Demo->Widgets->Querying Status.
Last edited by cfillion; 06-19-2021 at 02:18 PM.
|
|
|
06-19-2021, 02:23 PM
|
#223
|
Human being with feelings
Join Date: Sep 2019
Location: Finland
Posts: 755
|
Quote:
Originally Posted by cfillion
ImGui_IsWindowFocused returns whether the current window has focus. See Demo->Widgets->Querying Status.
|
Last I checked, that didn't work. It works for windows *within* an ImGui context, but if I click in Reaper *outside* the demo context, the IsWindowFocused() line still reads 'true'... Has this changed in 0.5 (I haven't updated yet)?
|
|
|
06-19-2021, 02:27 PM
|
#224
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by elcalen
Has this changed in 0.5 (I haven't updated yet)?
|
Yes.
|
|
|
06-19-2021, 02:34 PM
|
#225
|
Human being with feelings
Join Date: Sep 2019
Location: Finland
Posts: 755
|
Ah, well, that should work then. I hope I'll manage to get around to updating my script next week...
|
|
|
06-21-2021, 09:03 AM
|
#226
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by cfillion
Released version v0.5-beta! Summary of the changes:
These improvements come at the cost of backward compatibility breakage (upgrade tips below). Because of this, v0.5 is marked as "beta" in ReaPack. It must be manually selected for installation in ReaPack's package browser. I'm currently planning on marking it as "stable" for automatic updates in a week.
|
Does this mean, that previous api-docs for it has become outdated and I should base my docs on the 0.5er api-docs instead from now on? Or does it stay the same and just some workflows change?
And shall I better wait for the actual release for a docs-update?
Last edited by Meo-Ada Mespotine; 06-21-2021 at 09:13 AM.
|
|
|
06-21-2021, 12:13 PM
|
#227
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Meo-Ada Mespotine
Does this mean, that previous api-docs for it has become outdated and I should base my docs on the 0.5er api-docs instead from now on? Or does it stay the same and just some workflows change?
And shall I better wait for the actual release for a docs-update?
|
New work should use the v0.5 API. The backward-incompatible API changes are few but they affect core functions. It's beta only in name for disabling ReaPack auto-update, giving time for scripts to be updated.
Last edited by cfillion; 06-21-2021 at 12:31 PM.
|
|
|
06-22-2021, 02:35 AM
|
#228
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Some questions I can't figure out on my own:
- Why when I dock this window it loses its background color?
Code:
r = reaper
script_name = 'Test ImGui'
function ImGuiBody()
r.ImGui_Text(ctx, 'Hello World !')
if r.ImGui_Button(ctx, 'Dock') then
change_dock = true
end
end
function loop()
if change_dock then
dock = ~dock
r.ImGui_SetNextWindowDockID(ctx, dock)
change_dock = nil
end
r.ImGui_PushStyleColor(ctx, r.ImGui_Col_WindowBg(), 0x333333ff)
local visible, open = r.ImGui_Begin(ctx, script_name, true, r.ImGui_WindowFlags_NoCollapse())
r.ImGui_PopStyleColor(ctx)
dock = r.ImGui_GetWindowDockID(ctx)
if visible then
ImGuiBody()
if not dock or change_dock then dock = r.ImGui_GetWindowDockID(ctx) end
r.ImGui_End(ctx)
end
if not open or r.ImGui_IsKeyDown(ctx,27) then
r.ImGui_DestroyContext(ctx)
else
r.defer(loop)
end
end
ctx = r.ImGui_CreateContext(script_name, r.ImGui_ConfigFlags_DockingEnable())
r.defer(loop)
- How to proceed to open correctly the window on the mouse cursor with Mac? The vertical coordinates are reversed.
Code:
r = reaper
script_name = 'Test ImGui'
function ImGuiBody()
r.ImGui_Text(ctx, 'Hello World !')
end
function loop()
local pos = {r.GetMousePosition()}
r.ImGui_SetNextWindowPos(ctx, pos[1], pos[2], r.ImGui_Cond_Once(), 0.5, 0.5)
local visible, open = r.ImGui_Begin(ctx, script_name, true, r.ImGui_WindowFlags_NoCollapse())
if visible then
ImGuiBody()
r.ImGui_End(ctx)
end
if not open or r.ImGui_IsKeyDown(ctx,27) then
r.ImGui_DestroyContext(ctx)
else
r.defer(loop)
end
end
ctx = r.ImGui_CreateContext(script_name, r.ImGui_ConfigFlags_DockingEnable())
r.defer(loop)
- Where is the .ini data of ReaImGui?
Thank you
|
|
|
06-22-2021, 02:56 AM
|
#229
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Rodilab
Why when I dock this window it loses its background color?
|
Docking in Dear ImGui embeds the window inside of another one. Because of this docked windows use the ChildBg color (same as a BeginChild() subwindow would). Try setting both WindowBg and ChildBg.
Quote:
Originally Posted by Rodilab
How to proceed to open correctly the window on the mouse cursor with Mac? The vertical coordinates are reversed.
|
This should work to convert the native macOS bottom-based Y to cross-platform top-based Y:
Code:
local cur_x, cur_y = r.GetMousePosition()
local primary_monitor_height = ({reaper.BR_Win32_GetMonitorRectFromRect(false, 0, 0, 0, 0)})[4]
cur_y = primary_monitor_height - cur_y
...however I'll look into adding a function to ReaImGui for this kind of coordinate conversion. I think it will be useful not only for flipping Y macOS but also for HiDPI scaling on Windows/Linux.
Quote:
Originally Posted by Rodilab
Where is the .ini data of ReaImGui?
|
<resource path>/ReaImGui. The .ini's filename is derived from the label given to CreateContext.
Last edited by cfillion; 06-22-2021 at 03:17 AM.
|
|
|
06-23-2021, 05:03 AM
|
#230
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Thanks a lot
One more question:
Why in the following example, the dock/undock works fine but is not saved for the next opening?
It always reopens with a DockID of 0.
Code:
r = reaper
script_name = 'Test ImGui'
function ImGuiBody()
r.ImGui_Text(ctx, 'DockID = '..dock)
if r.ImGui_Button(ctx, 'Dock') then
change_dock = true
end
end
function loop()
if change_dock then
r.ImGui_SetNextWindowDockID(ctx, ~dock)
change_dock = nil
end
local visible, open = r.ImGui_Begin(ctx, script_name, true)
dock = r.ImGui_GetWindowDockID(ctx)
if visible then
ImGuiBody()
r.ImGui_End(ctx)
end
if not open or r.ImGui_IsKeyDown(ctx,27) then
r.ImGui_DestroyContext(ctx)
else
r.defer(loop)
end
end
ctx = r.ImGui_CreateContext(script_name, r.ImGui_ConfigFlags_DockingEnable())
r.defer(loop)
|
|
|
06-23-2021, 11:29 AM
|
#231
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Rodilab
Why in the following example, the dock/undock works fine but is not saved for the next opening?
It always reopens with a DockID of 0.
|
Was the script restarted (eg. from the IDE) less than 5 seconds after docking? ImGui waits 5 seconds after a change was made before saving the settings to disk (or until DestroyContext is used).
(Demo -> Tools -> Metrics/Debugger (or ImGui_ShowMetricsDialog) -> Settings -> SettingsDirtyTimer)
Last edited by cfillion; 06-23-2021 at 11:58 AM.
|
|
|
06-25-2021, 12:45 AM
|
#232
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Indeed, that was my problem. Thanks
Another thing about the DockID :
All positive DockIDs seem to save themselves with the value 0.
This prevents me from knowing which was the last preferred dock position.
Exemple : - Window is docked on the top (DockID = -2)
- I undock the window, so DockID = ~DockID = 1
- I close the script, reopen it
- The window is indeed floating, but with DockID = 0
- When I dock again, the user expects the window to dock at the top, like last time. But DockID = ~0 = -1 so it dock on the right
I hope I am clear
|
|
|
06-25-2021, 03:02 AM
|
#233
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by Rodilab
All positive DockIDs seem to save themselves with the value 0.
This prevents me from knowing which was the last preferred dock position.
|
It's reset to 0 (undocked) when the dock ID doesn't exist. The previous dock ID should be stored separately, or the user presented with a choice of which REAPER docker to dock into (eg. menu or dropdown).
The dock ID represent a Dear ImGui dock space. Dock spaces are created (counting up from 1) when docking a window inside of another one in the same context by dragging their title bar. -1 to -16 are "special" as they are reserved by ReaImGui to correspond to a REAPER docker.
(Dear ImGui has an API for adding/managing custom dock spaces inside of windows, but it is still in beta and subject to change, so I haven't exposed it in ReaImGui yet.)
|
|
|
06-26-2021, 12:32 AM
|
#234
|
Human being with feelings
Join Date: Jan 2021
Location: Paris
Posts: 255
|
Quote:
Originally Posted by cfillion
The previous dock ID should be stored separately
|
Ok, I will. Thanks.
My scripts are ready now.
This v0.5 is very interesting, thanks for your work
|
|
|
06-28-2021, 10:16 PM
|
#235
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Released v0.5.1:
Code:
• Add a HTML documentation page (accessible from the demo: Tools->Documentation)
• Cleanup the documentation of many functions (proofread, add hyperlinks...)
• Demo: fix even/odd detection in Tabs->Advanced & Close Button
API changes:
• Add PointConvertNative [p=2456542]
• Remove redundant return values in the Python binding
• Rename wrongly named function PathFillConvex to DrawList_PathFillConvex
(REAPER's built-in documentation now lists incorrect return values in the Python signatures.)
Last edited by cfillion; 06-29-2021 at 11:52 AM.
|
|
|
07-01-2021, 02:02 PM
|
#236
|
Human being with feelings
Join Date: Sep 2019
Location: Berlin
Posts: 61
|
Demo script does not work anymore
Hi Cfillion,
This is really great work and very commendable for your documentation and efforts. Truly superb.
I was working on a big overhaul of the ReaCoMa package using ReaImGui once I saw it. I was retooling things using 0.4.1 which worked a charm, but now updating to 0.5.1 no windows seem to be drawing or created at runtime. I thought it might be my fault converting things over to the new APIs that emerged between these two versions, however, when I run the demo example this has the same problem. I'm on an M1 Mac using the arm64 build of the library (as provided by ReaPack). Any ideas on how I can help you debug this (or where I might be going wrong?)
EDIT:
Just to further rule out any of my meat-ware issues I tried the most basic script:
Code:
local ctx = reaper.ImGui_CreateContext('My script')
function loop()
local visible, open = reaper.ImGui_Begin(ctx, 'My window', true)
if visible then
reaper.ImGui_Text(ctx, 'Hello World!')
reaper.ImGui_End(ctx)
end
if open then
reaper.defer(loop)
else
reaper.ImGui_DestroyContext(ctx)
end
end
reaper.defer(loop)
Which has the same issue.
EDIT2:
Just to confirm that I think this is an ARM/MAC issue - the demo scripts all work on my windows machine running 0.5.1.
Last edited by jbradbury; 07-01-2021 at 02:11 PM.
Reason: More info
|
|
|
07-01-2021, 02:46 PM
|
#237
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
|
Quote:
Originally Posted by jbradbury
Just to confirm that I think this is an ARM/MAC issue - the demo scripts all work on my windows machine running 0.5.1.
|
I think so too. Or at least, it could be an issue happening only with specific versions of macOS (I primarily test on 10.14.6 and occasionally on 10.15.7). What is the exact macOS version number you are using? I can try installing that on a x86 virtual machine & debug from there.
(I hope the bug isn't unique to ARM because I don't have the means to debug on that.)
EDIT: Try adding this before the ImGui_Begin call to dock into REAPER (instead of opening a floating window):
Code:
reaper.ImGui_SetNextWindowDockID(ctx, -1)
...and add ConfigFlags_DockingEnable to the CreateContext line:
Code:
local ctx = reaper.ImGui_CreateContext('My script', reaper.ImGui_ConfigFlags_DockingEnable())
Does that show up?
EDIT2: I assume there aren't any ReaImGui error messages in the ReaScript console when the problem happens?
Last edited by cfillion; 07-01-2021 at 03:42 PM.
|
|
|
07-01-2021, 04:49 PM
|
#238
|
Human being with feelings
Join Date: Sep 2019
Location: Berlin
Posts: 61
|
No errors in the window at all. There might be a single frame flicker but its honestly so perceptually hard to discern I'm not sure if anything happens.
I'm going to go through your suggested steps tomorrow and let you know how I go
Happy to be debug for you if you can point me to parts of the code where it might be fixed or at least explored in some detail.
EDIT:
I am on 11.4 which might be part of the issue, although 0.4.1 worked without a hitch.
Last edited by jbradbury; 07-01-2021 at 04:51 PM.
Reason: OS
|
|
|
07-01-2021, 04:58 PM
|
#239
|
Human being with feelings
Join Date: Sep 2019
Location: Berlin
Posts: 61
|
Code:
reaper.ImGui_SetNextWindowDockID(ctx, -1)
...and add ConfigFlags_DockingEnable to the CreateContext line:
Code:
local ctx = reaper.ImGui_CreateContext('My script',
reaper.ImGui_ConfigFlags_DockingEnable())
Does that show up?
No luck trying these two things either — it produces the same behaviour as I described earlier. Here is a video just to contextualise it a bit.
http://permashare.jb.imap.cc/ReaCoMa/reaimgui.mp4
|
|
|
07-01-2021, 05:13 PM
|
#240
|
Human being with feelings
Join Date: Sep 2019
Location: Berlin
Posts: 61
|
I have just made a DEBUG build on my system (your instructions are really good by the way! A rarity).
I was able to get something to appear by following your advice, however, I cannot close this black window in the dock and if I run the script without the docking code in there, then modify the code to work with the docking API the old behaviour takes over again and nothing happens.
http://permashare.jb.imap.cc/ReaCoMa...d-reaimgui.png
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:06 AM.
|