MoI discussion forum
MoI discussion forum

Full Version: CustomUI

Show messages:  1-5  …  186-205  206-225  226-245  246-265  266-285  286-305  306-325  …  506-522

From: mkdm
8 Jan 2018   [#246] In reply to [#245]
Hello Michael!

I'm not Max but I write here my thoughts about your questions :)


1) "what should the directory containing scripts to execute at startup be called, maybe just plain "startup" ? I guess there should also be a "commands" and "scripts" directory that you could make there as well."

I would call it "autostart"

2) "But then will having MoI look in 2 different commands directories for things cause problems since currently there's only one that is identified by moi.filesystem.getCommandsDir() ? And what should happen if there is a file with the same name in both places, which one should be actually loaded?"

I would make another API called "moi.filesystem.getAlternativeCommandsDir()"
If there is a command with the same name in both places I think that the priority should go to the "standard" command folder,
or you could use a sort of "prefix" to force a command to be searched into a specific path.
For example "#something" could be used to execute the "something" command contained into the AppData "commands" or "scripts" folders,
while simply writing "something" will run the command from the standard location.

3) "Also when should startup scripts run - probably just before the main window is shown?"

Hmm....I think that startup scripts should run just immediately after that all the UI objects are accessible, just like the "document ready" of standard JavaScript or jQuery.


Ciao!
From: Michael Gibson
9 Jan 2018   [#247] In reply to [#246]
Hi Marco, thanks for your feedback!

> I would call it "autostart"

I was thinking "startup" might have some chance at being more familiar since that's what Windows uses for a similar mechanism.


> I would make another API called "moi.filesystem.getAlternativeCommandsDir()"

Hmmm, maybe. But if it's always in the same place in appdata it should be possible to get it by moi.filesystem.getAppDataDir() + 'commands\\' already.

I'm just not entirely sure what side effects having commands being a combination of 2 folders will have - stuff in CustomUI that builds the scripts menu by enumerating the files in the commands directory would need some adjustment. I'm trying to think of anything else that might be sensitive to it.


> If there is a command with the same name in both places I think that the priority should go to the "standard" command folder,

The good part about doing this is that when a standard command gets updated with something new, it will run that new one. So someone won't wonder why they aren't seeing the new feature that was just released. The bad part is that it won't be quite as easy to override built in commands but maybe that's for the best anyway. Having a special syntax to choose one over the other doesn't really help because it would only apply to a shortcut key and not buttons in the side pane for example.


> Hmm....I think that startup scripts should run just immediately after that all the UI objects are accessible, just
> like the "document ready" of standard JavaScript or jQuery.

Yeah when the UI is finished loading that's when the main window is shown so just before that would probably be good.

Thanks, - Michael
From: mkdm
9 Jan 2018   [#248] In reply to [#247]
You're welcome Michael.

Have a nice day.
From: Barry-H
9 Jan 2018   [#249]
Hi,
can Max's UI be installed in version 4 beta portable.

Barry
From: Finema
9 Jan 2018   [#250] In reply to [#249]
Thanks a lot Max !
Just a little thing :
I have this error when i want to try Sudiv in the customUI2

ReferenceError: Can't find variable: _Subdiv_beta10

line 1

Thanks again...

edit :
i've replace _Subdiv_beta10 by _Subdiv_beta9 in 88 SubdivTools file and it's OK now.
From: MajorGrubert (CARLOSFERREIRAPINTO)
9 Jan 2018   [#251]
'CustomUI would stay active between different releases'

That would be great! Thanks Michael.

Thanks Max for the CustomUI update.

Carlos
From: bemfarmer
9 Jan 2018   [#252]
Nodeedit is disabled in the new custom UI. (?)
Move nodeeditor directory to AppData/.../moi, beside customui directory, then doubleclick on customui and remove dash in front of -97NodeEdit.htm. (?)

- Brian
From: Max Smirnov (SMIRNOV)
9 Jan 2018   [#253]
Hi Michael

>>I've been thinking that for the next beta how about if I have MoI look through some specific directory in AppData for any .js files and if any are found it will execute them.
It's a good idea. I thought about one file (something like autorun.js), but if you make a separate directory it will be much better. In this case the execution list should be sorted by name, so we can manage the order of execution.

>>I'll also put in an empty named container element in CommandBar.htm by default that can be used as a target for where to insert controls.
You can give a name to <flex> container.

>>A couple of issues are - what should the directory containing scripts to execute at startup be called, maybe just plain "startup" ?
Yes. Startup is a good name.

>>I guess there should also be a "commands" and "scripts" directory that you could make there as well. But then will having MoI look in 2 different commands directories for things cause problems since currently there's only one that is identified by moi.filesystem.getCommandsDir()?
In my opinion the moi.filesystem.getCommandsDir() command should point to commands directory with MoI's built-in scripts.
For a user commands directory you can add another command. something like moi.filesystem.getUserCommandsDir()
But do we need it? I think moi.filesystem.getAppDataDir()+"commands\\" will be enough.

>>And what should happen if there is a file with the same name in both places, which one should be actually loaded?
I think the current commands directory with MoI's built-in scripts should have higher priority.

>>Also when should startup scripts run - probably just before the main window is shown?
Yes.
I don't remember, does MoI have a command which refreshes MoI UI? It can be useful in some cases.
From: Max Smirnov (SMIRNOV)
9 Jan 2018   [#254]
Finema
>>I have this error when i want to try Sudiv in the customUI2
>>ReferenceError: Can't find variable: _Subdiv_beta10
Yes, _Subdiv_beta10 is not released yet ;) It's an experimental version.

Brian
>>Nodeedit is disabled in the new custom UI. (?)
It disabled by default.

>>Move nodeeditor directory to AppData/.../moi, beside customui directory, then doubleclick on customui and remove dash in front of -97NodeEdit.htm. (?)
You're right, now Nodeeditor can be stored in AppData directory

Barry
>>can Max's UI be installed in version 4 beta portable.
It should work right now, but you need to edit icon paths.
I'll add support of portable version later.

Marco
moritz

Thank you! :)
From: Finema
10 Jan 2018   [#255] In reply to [#254]
Thanks a lot max for your good job!
From: Michael Gibson
10 Jan 2018   [#256] In reply to [#253]
Hi Max, so I'll set that up for the next beta.

re:
> I don't remember, does MoI have a command which refreshes MoI UI? It can be useful in some cases.

There isn't a special MoI call for it but I think the built in HTML window.document.reload( true ); should work.

You can get all the things to reload by calling var panels = moi.ui.getUIPanels();

Or if there is a particular one you want var panel = moi.ui.getUIPanel( url );

- Michael
From: mkdm
10 Jan 2018   [#257] In reply to [#254]
You're welcome Max.

Have a nice day.
From: Marbleman
10 Jan 2018   [#258]
Thanks Max.....awesome!
From: Marbleman
17 Jan 2018   [#259]
Hi Max,

I have installed all and everything is working perfectly, except for one thing..... I have copied the contents only of the object folder and pasted it into the new objects folder.....all is showing and present except the objects are not in sequential order, or infact any order that I can tell. Please see screenshot attached. Have you any idea how I can force them to be read in a sequential and Alphabetical order?

Thank you

James Elliott

Image Attachments:
Screenshot 2018-01-17 17.42.23.png 


From: 4rw1n
17 Jan 2018   [#260] In reply to [#259]
where u download all of that objects??
From: Marbleman
17 Jan 2018   [#261] In reply to [#260]
I drew them!
From: Max Smirnov (SMIRNOV)
18 Jan 2018   [#262] In reply to [#259]
Hi James,

replace customui/mods/ObjLibrary.menu.htm file with this one
From: Marbleman
18 Jan 2018   [#263]
Hi Max,

Thank you, works a treat!

James
From: Frenchy Pilou (PILOU)
18 Jan 2018   [#264]
<< sequential and Alphabetical order?

What is a sequential order ? by date ? by size ?...
From: Hamish Mead (HAIRYKIWI)
31 Jan 2018   [#265]
Max, many thanks for CustomUI v2.

I'm after some help setting up the ExtScripts directory on OSX with MoI v4 beta Dec-12-2017 please. I'm probably just missing something quite obvious.

In the ExtScripts.cfg.htm file, at the following location on OSX:
/Users/xxxx/Library/Application Support/Moi/customui/mods/ExtScripts.cfg.htm

I wrote:



I tried with and without the tilda and changing forward to back slashes - still nothing.

I can only access the scripts in MoI v4, if I actually copy them to the MoI commands directory - i.e. this one:
/Applications/MoI v4 beta Dec-12-2017.app/Contents/Resources/commands



Any suggestions much appreciated, thanks :)

Show messages:  1-5  …  186-205  206-225  226-245  246-265  266-285  286-305  306-325  …  506-522