creating scripts for moi?
All  1  2-9

Previous
Next
 From:  Michael Gibson
2506.2 In reply to 2506.1 
Hi Rob, unfortunately I don't currently have any proper documentation available for doing that...

Basically right now you've just got to study existing commands and scripts, and try things out.

A couple of resources:

http://moi3d.com/wiki/Scripting - get the moi.idl file from here where you can see a listing of the various properties and methods that are available to a script.

And Petr's MoI page here:
http://kyticka.webzdarma.cz/3d/moi/

has a collection of a variety of different scripts and custom commands that have been gathered from prior discussions in the forum here.

If you look over that stuff you can kind of see what stuff is available for a script to do.

Also commands are actually implemented in script as well, you can check out the script file for commands in the \commands sub-folder inside of MoI's main installation folder, so that is another source of examples to study.

The script language used is JavaScript, and you should be able to find quite a few tutorials online for how that language itself works, since it is the script language that is used inside of web pages.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  rhodesy
2506.3 
Thanks michael,

with the risk of sounding completely stupid, what program do i use to create and open the .JS file? Done a bit of googling and still unsure, there seemed to be a lot of reference to HTML and web pages but unsure how this translates to creating the .JS file. Do you just write the code in say word or is there a specific program you use to create it?

Cheers and sorry for the very noob question!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
2506.4 In reply to 2506.3 
Hi Rhodesy,
You could just use a text editor and save with extension .js

You could use a wysiwyg editor or some other web code editor that can help with markup tags and intellisence.

As for the keyboard getting filled up, all the scripts can be put into a js file. And Michael will implement a command line area in a future release where you can type the name and it will run. So you will be able to have your own list to refer to or memory.

Who's got the collection of scripts? Michael, everytime you write one do you file it away?

Burr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2506.5 In reply to 2506.3 
Hi Rob,

Like Burr mentions you can just use any text editor, like for example Notepad that comes with Windows will work. Go to Start/Run and type in "Notepad" to launch it, then after you write some text save it with a .js file extension. (or an .htm extension if you are making an HTML file)

Notepad is pretty basic, you may want to look at Notepad++ or Notepad2 for some improved text editors.


> Do you just write the code in say word or is there a
> specific program you use to create it?

It is possible to do it in Word, if you make sure to choose "Plain text" as the file type when saving. But mostly Word is oriented towards making "rich text" documents and not simple plain text ones. Instead it tends to be better to use Notepad for plain text since that is all that it does and there is no need to worry about what kind of file is being created.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2506.6 In reply to 2506.4 
Hi Burr,

> Who's got the collection of scripts? Michael, everytime you
> write one do you file it away?

Petr has done a good job of collecting the majority of them here:
http://kyticka.webzdarma.cz/3d/moi/

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  rhodesy
2506.7 
Thanks guys got it up and running in notepad. Might try and find myself a book on JS to ease myself in! Don't be expecting much anytime soon!

With regards to the execution of scripts, michael were you thinking of having a script button (as mentioned before I think) that would just pull up your list of scripts that could be executed in the ui without a keyboard to make it more tablet friendly? It seems you have rightly gone to great lengths to make moi tablet friendly with the numberpad popup and minimal right clicking but then rely heavily on the keyboard to execute additional scripts. I don't think it will detract from the simple moi UI but is there as an option for those that need it.

Cheers
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
2506.8 In reply to 2506.7 
There is a script that does that called "Plugin Gallery". You can make images or button pics or just text if you want.

It's on the resources-petr's MoI page.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
2506.9 In reply to 2506.7 
Hi Rob,

> michael were you thinking of having a script button (as
> mentioned before I think) that would just pull up your list
> of scripts that could be executed in the ui without a keyboard
> to make it more tablet friendly?

Yeah I do have an idea for that - I would like to have a "Plug-ins" button on the bottom toolbar, probably next to the "Options" button which would pop up a menu (similar to how the File button works on the left side of that command bar), that has a list of all your scripts or custom commands in it.

But it is looking unlikely to be able to get that in for version 2.0, that particular one probably won't come until v3.

Also like Burr mentions, it is possible currently to set up a UI for a collection of plugins using that plugin gallery customization method, which involves altering MoI's default UI. I do want to make a method easier than that with a built-in menu but for now if you need to have it you can actually set it up that way.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-9