View Single Post
Old 04-24-2021, 05:15 PM   #144
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by Rodilab View Post
When I set SWS "Startup actions" option with a ImGui script, script crash.

Basically, all ImGui functions return an error.
Do you know why ?
Fixing for next version, thanks!

This is what happens:
Code:
Timer cycle 1 (T=0ms)
|- Script defer callbacks
|- SWS startup action
|- |- Run script, create context
|- ReaImGui frame
|- |- Destroy unused context

Timer cycle 2 (T=30ms)
|- Script defer callbacks
|- |- Invalid ReaImGui context error
|- ReaImGui frame
Another way to trigger the problem:
Code:
reaper.defer(function()
  reaper.Main_OnCommand(reaper.NamedCommandLookup('_RS6b4644d86854e10895485f184942fb69ecc26177'), 0)
end)
As a temporary workaround until v0.3 is released, you could do something like GetTime right after the CreateContext call.

Last edited by cfillion; 04-26-2021 at 07:24 PM.
cfillion is offline   Reply With Quote