MoI discussion forum
MoI discussion forum

Full Version: Script for quickly changing the theme from dark to light

From: Brianfox90
26 Dec 2023   [#1]
Help please. Two scripts are needed. The first script for quickly changing the theme from dark to light. The second script for quickly opening the "details" window
From: Michael Gibson
26 Dec 2023   [#2] In reply to [#1]
Hi Brian,

Set dark theme:
script: moi.ui.theme = "Dark";

Set light theme:
script: moi.ui.theme = "Default";

Open "Details..." dialog:
script: moi.ui.createDialog( 'ObjectPropertiesDialog.htm', 'resizeable,defaultWidth:700,defaultHeight:500' );

- Michael
From: Brianfox90
26 Dec 2023   [#3] In reply to [#2]
Thanks, Michael
From: Brianfox90
27 Dec 2023   [#4]
Where can I see what classes are in Moi in order to write scripts myself?
From: Michael Gibson
27 Dec 2023   [#5] In reply to [#4]
Hi Brian,

re:
> Where can I see what classes are in Moi in order to write scripts myself?

There isn't currently official documentation for the scripting API, because that takes a lot of work.

However, there is some information here:
https://moi3d.com/wiki/Scripting

Also though if you want to script something that is in the regular UI, you can open up the UI files and find how it is accessed.

For example the UI control for changing the theme is in GeneralOptions.htm inside the UI folder in the install. If you look in there you can find that it sets it using moi.ui.theme = value;

- Michael
From: Brianfox90
27 Dec 2023   [#6] In reply to [#5]
Thanks for the answer
From: Larry Fahnoe (FAHNOE)
27 Dec 2023   [#7] In reply to [#6]
Hi Brian,

In addition to Michael's answer, here is another very worthwhile contribution toward API documentation for MoI:
https://moi3d.com/forum/index.php?webtag=MOI&msg=10857.36

--Larry
From: Brianfox90
29 Dec 2023   [#8] In reply to [#7]
thank you very much!!!!