MOI Script API

Next
 From:  gav (MACDRACK)
3428.1 
Sorry if I missed it, but is there any docs covering the Script API?

Cheers.
Gav.
  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
3428.2 In reply to 3428.1 
Hi Gav, there is not any proper script API documentation, but there is a list available of all the properties and methods that are available to scripts.

For that check out the moi.idl file which is linked to from here:
http://moi3d.com/wiki/Scripting

It unfortunately takes quite a lot of effort to document an API, currently I'm more focused on documenting and generally working on the regular tools and UI and stuff like that instead.

At some point in the future when the more "regular end user" toolset is more refined, then I'll probably be able to spend some effort on scripting and API level documentation and support.

- 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:  gav (MACDRACK)
3428.3 In reply to 3428.2 
I can easily interpret the idl file, so that's fine.
And no problem, I too would rather see features and refinement over docs of this nature.

Cheers.
Gav.
  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:  Dave Morrill (DMORRILL)
3428.4 In reply to 3428.3 
You can also try visiting: <<hijacked URL removed>>

It's still a work in progress, but it might be easier than reading the IDL file...

EDITED: 3 Feb 2021 by MICHAEL GIBSON

  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:  gav (MACDRACK)
3428.5 In reply to 3428.4 
Much Better!

:-)

Cheers.

Gav.
  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:  Hamishk
3428.6 
The documentation suggests javascript. Its been a while since I've coded anything... Most recent would by perl or python

If I wanted to refresh those skills rather than learn javascript how would I interpret the docs?

In other words - If I want to refresh Python skills, for example, has anyone got a python script that calls some of the functions documented at <<Hijacked URL removed>> so I can figure out the calling protocol from Python to MOI functions a little quicker?

Or is it better to inhale deeply and learn a little javascript.

Any pointers to tutorials on MOI scripting? Or a howto?

Regards,
Hamish K

EDITED: 3 Feb 2021 by MICHAEL GIBSON

  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
3428.7 In reply to 3428.6 
Hi Hamish, currently there aren't any tutorials for writing MoI scripts, since making tutorials requires quite a bit of work.

The closest thing you can do currently is to examine existing scripts to figure out how they work, there are a bunch collected here:
http://kyticka.webzdarma.cz/3d/moi/

and also every command in MoI has a script part of it that controls its logic flow (like when to show different buttons, when to pick points, when to select objects, etc...) and all those command scripts can be found in the \commands subfolder under MoI's main installation folder.

For getting up to speed on the Javascript language, probably a good focus for that would be to do some simple web pages with script logic in them, there should be quite a lot of tutorials available online about that, for example check out here:
http://www.w3schools.com/js/default.asp

But really it is very early on in MoI's lifetime for trying to use it from a scripting perspective, I just have not had enough time yet to focus time and energy on that area of MoI in particular so you'll be left more to yourself when exploring that type of stuff, although definitely check out Dave's stuff linked to above since he's gathered quite a bit of info there.

- 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:  Dave Morrill (DMORRILL)
3428.8 In reply to 3428.6 
I don't know if you missed this link the first time it was posted: <<Hijacked URL removed>>

It shows some additional work I've done on creating an external scripting interface for MoI. In particular, it shows some examples of writing some python scripts for MoI.

I've also updated the MoI wiki scripting page (http://moi3d.com/wiki/Scripting) to link to this page, so it will be easier to find in the future...

EDITED: 3 Feb 2021 by MICHAEL GIBSON

  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:  Hamishk
3428.9 
Wow. very cool link David.

Given me something to think about. Thanks. (In amongst my university assignment which I am feeling a little guilty about...(
  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:  Mark Brown (MABROWN)
3428.10 In reply to 3428.8 
Thanks for the work you have put into this David.

There are a small number of things I would like to try scripting but I'm not a Java programmer and OO based languages do my head in. Is your interface able to be used from a procedural language?

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  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:  Dave Morrill (DMORRILL)
3428.11 In reply to 3428.10 
At this point there is still no way to avoid the use of Javascript in scripting MoI, even using the external scripting interface. With some additional work that requirement could be diminished, if not removed. But for now you would have to be able to use a bit of Javascript at the least.

Note that MoI uses Javascript, not Java. Of the two, Javascript is much easier to use. If you've seen any of Michael's "one-liner" scripts, you'll have a taste of what's involved. In practice, scripting MoI is not likely to use every nook and cranny of the Javascript language, so anyone should be able to get by with a fairly rudimentary knowledge of the language for most things.

If you look at some of the scripts linked from the MoI wiki Scripting page, and cross reference that against the API doc I've been working on, and can make any sense out of what you see, then you'll probably be able to use what's there now.

Just out of curiosity, what procedural language are you thinking you would want to use? There aren't that many choices anymore :-)

- Dave Morrill
  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:  Mark Brown (MABROWN)
3428.12 In reply to 3428.11 
Hi David,

Thanks for your response and advice. I'll take a look at Javascript and some of the examples as soon as I get the current 3D project out of the way.

I've spent years programming little (mostly useless!) things in Euphoria. I like the ease of use and the stability. It is open source these days. I have considered learning Lua as it looks a lot like Euphoria but just haven't found the time.

As a programmer I reckon I make a pretty good 3D modeler :)

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  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