External scripting interface to MoI  1-20  21-31

Next
 From:  Dave Morrill (DMORRILL)
3341.1 
After one of those "Eureka!" moments, following several days of intense hair-pulling, I finally decided to abandon my attempts at trying to use MoI's Internet Explorer component support to script MoI. There were just too many roadblocks, including silent script failures, poor documentation (by Microsoft), etc. Instead, I've decided to try a different approach based on scripting MoI using a simple external interface.

The potential advantages of this approach are that you can easily do any or all of the following:

- Script MoI using your favorite text editor.
- Create user interfaces to MoI using your favorite programming tools or IDE.
- Debug your code using tools you are already familiar with.

Now obviously this is going to be of interest only to programmers or people familiar with some kind of scripting, so for the majority of MoI users, there's probably nothing of immediate interest here.

But my early "proof of concept" results were so encouraging that I decided to create a short screencast showing a few quick examples of using an off the shelf text editor to script MoI on the fly. Here's the link: http://dmorrill.com/videos/link_test.html.

- 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
Next
 From:  Brian (BWTR)
3341.2 In reply to 3341.1 
Michael
To elaborate my comments!

Brian
  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:  DannyT (DANTAS)
3341.3 In reply to 3341.1 
Very cool stuff there Dave, I can see the powerful potential to what your doing.
Now all you have to do is make it non programmer friendly ;)

Cheers
~Danny~
  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
3341.4 In reply to 3341.1 
Hi Dave, setting it up to work with your own favorite text editing environment is a cool idea!

- 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)
3341.5 In reply to 3341.4 
Yes, and it handily bypasses all those problems of trying to get a low-function Javascript editing widget working inside of the IE ActiveX component. Overall a win-win situation.

For my next trick, I'm going to try creating a simple external application with a user-friendly UI that talks directly to MoI (no text editor involved).

- 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
Next
 From:  NightCabbage
3341.6 
Very cool Dave :)

I've been looking forward to procedural / scripting for MoI since - I've had so many situations where it would have been useful!

I'm highly anticipating your release ;)
  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:  Jamie (FUTUREPROOF)
3341.7 
Hi Dave

Looks really promising. good fun and MoI looked fast running the scripts. Are you planning to share this when you are happy with its function? It would be good to have a play with it, good to see an easy way to load and edit scripts.

It would be good if there was a library of scripts to base new ones on and learn from. Maybe a scripts thread on the forum.

Regards

Jamie
  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:  candide
3341.8 
Good work!
  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)
3341.9 In reply to 3341.8 
Here's the first example of a custom external program driving MoI via the external script interface:



If there's any interest, I'll post another video tomorrow showing this program in action...

- Dave Morrill
Attachments:

  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:  okapi
3341.10 In reply to 3341.9 
Great work Dave.
If I am understanding this right, this would be a visual interface for scripting or for creating parameter driver dependencies in MOI?
This would be fantastic.
  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:  NightCabbage
3341.11 
I'm interested!! :D
  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)
3341.12 In reply to 3341.11 
For the one guy *cough* NightCabbage *cough* that expressed interest, I've added a new video showing a Python user interface added to the lattice script used in the previous video. Same link as before: http://dmorrill.com/videos/link_test.html.

- 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
Next
 From:  BurrMan
3341.13 In reply to 3341.2 
>>>>>To elaborate my comments!>>>>>>>>>>

Absolutely NO idea whats being discussed and so far off base it made me Laugh!
  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:  Brian (BWTR)
3341.14 In reply to 3341.13 
Prototype??????

Brian
  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:  Dan (CORNYSH)
3341.15 In reply to 3341.12 
>For the one guy *cough* NightCabbage *cough* that expressed interest

We're all interested Dave, just too shy to put our hands up.
Looks potentially very useful I must say.

Dan
  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:  Nick (BODINI)
3341.16 In reply to 3341.1 
wow, thats cool!
  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:  falcon76
3341.17 In reply to 3341.15 
I'm really interested too!!!

Can you, please, explain how do you have done the graphic interface for the script? It's really amazing.
  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:  Jamie (FUTUREPROOF)
3341.18 
i'm also interested, but would like to know what you are going to do with it. Are you going to build something to sell or for sharing or is it for show?

Jamie
  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)
3341.19 
OK, day 3 since the "Aha!" moment, and things are really starting to get interesting. Here's a new screenshot:



I'm writing a Python script now that displays a tree view of all the MoI Python scripts in a certain sub-tree of your file system. You can then select the scripts you are interested in by clicking on them and, if you want, run any or all of them simultaneously (as illustrated in the screenshot). Still early going on this, but it's coming along pretty fast. Maybe a new video tomorrow...

>We're all interested Dave, just too shy to put our hands up.
>Looks potentially very useful I must say.
>
>Dan

Might be a sub-optimal strategy. One of the things I'm trying to figure out by posting here is if there is much interest in this sort of stuff within the MoI community.

>Can you, please, explain how do you have done the graphic interface for the script? It's really amazing.

falcon76, I'll be adding more technical details as it gets fleshed out a bit more. Things are moving pretty fast at the moment, and everything is in quite a bit of flux. As a quick tidbit, here is the current Python script for the random lines UI shown in the screenshot:
""" Create a set of random lines within a specified volume. """
from traits.api import Range, View, Item, SliderEditor
       
slider = SliderEditor( body_style = 25 )

class RandomLines ( MoIScript ):
    lines = Range( 1, 1000, 100 )
    x     = Range( 1, 100, 20 )
    y     = Range( 1, 100, 20 )
    z     = Range( 1, 100, 20 )
    view  = View(
        Item( 'lines', editor = slider ),
        Item( 'x',     editor = slider ),
        Item( 'y',     editor = slider ),
        Item( 'z',     editor = slider )
    )

And here is the corresponding Javascript code that MoI executes:
clear();
_( do_for( %(lines)d, function() {
    return line(
         random_pt( %(x)d, %(y)d, %(z)d ), 
         random_pt( %(x)d, %(y)d, %(z)d ) );
} ) );

Just FYI, the Python stuff is based on a package I've been working on for the last eight years (hint: from traits.api...).

>i'm also interested, but would like to know what you are going to do with it. Are you going to build something to sell or for sharing or is it for show?
>
>Jamie

Don't know yet. I guess that is part of what I'm trying to figure out now. Depends upon how much interest there is and what people are looking for. Right now I've got more ideas than fingers to type with :-)

- Dave Morrill
Attachments:

  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:  NightCabbage
3341.20 
This thing will be SO useful!!
  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:  1-20  21-31