External scripting interface to MoI

 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: