Friendlyskies AoI Forum

You are not logged in.

Announcement

#1 January 4, 2010, 6:44 pm

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

making a GUI for AOI

I reading tutorials for AOI scripting. And i'd like to know if Balise is the tool that you use for composing a GUI.

Does Balise runs on Windows? 

I'm never programmed in java, and there're so many thing to keep in mind that i want to start by scripting something for AOI. But it would be useful to have a GUI builder to make my learning bearable.

note: At the same time i'm getting into Swing... maybe by Netbeans, but this seems to be hardest because the IDE is too big.

Last edited by mayid (January 4, 2010, 6:45 pm)


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

#2 January 5, 2010, 12:38 pm

Vidiot
2000 posts? Insane.
From: Hamburg
Registered: November 3, 2004,
Posts: 2019
Reputation :   

Re: making a GUI for AOI

http://buoy.sourceforge.net/

I have no clue, but you might mean BUOY?
It´s the same creator than the one who did AoI.

Cheers
Harald


Don´t start chasing rainbows - get caught by them.
Deutsches Portal für Art of Illusion

Offline

 

#3 January 5, 2010, 12:51 pm

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

Re: making a GUI for AOI

I understand the following:

- Beanshell is a simpler syntax for Java
- Buoy is a GUI compouser, but in plain text
- Balise is (maybe) a graphical interface for using Buoy.

I founded Balise at the bottom of the page you posted, Vidiot.

I'm just trying to make up an idea of what is it all about. I'm re-reading Java basic tutorials, and getting further into AOI scripting path.


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

#4 January 5, 2010, 4:24 pm

fpgui
Moderator
From: France
Registered: November 2, 2004,
Posts: 958
Reputation :   
Website

Re: making a GUI for AOI

Balise is meant to compose a GUI for Java applications and plugins using Buoy. For scripting, there are some simple tools in AoI which cover most of the cases you're likely to need. Look in Coil Envelope script and Platonic Solid script (which is more complex in terms of UI) for the ComponentsDialog call which creates the UI dialog. The PlatonicSolid script mixes UIUtilities elements provided by AoI and (a bit more) complex stuff like Buoy lists (BList).

You can set a UI only for tool scripts, object scripts are evaluated at each render so you'd see the UI pop up at each render, quite annoying. You could write a UI for an object script in a tool script the sole purpose of which would be to edit the parameters stated in the object script code hypnodisk.

I hope this makes sense, don't hesitate to ask questions (some say there are no  silly questions, only dumb answers).


Francois

Offline

 

#5 January 5, 2010, 4:45 pm

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

Re: making a GUI for AOI

Look in Coil Envelope script and Platonic Solid script (which is more complex in terms of UI) for the ComponentsDialog call which creates the UI dialog.

Thanks, i will. And so i'll practice the GUI implementation.

By other hand, i think i'll focus on displaying info on scene. Grids and 3d vector appears on scene, and i'd like to print some text in there. By now i'm not a flowing coder so i can't get the info i want from selection / objects, but maybe you can tell me which methods to use to print on screen anything.


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

#6 January 8, 2010, 2:00 pm

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

Re: making a GUI for AOI

Nevermind my last question.

Now my focal point is to give a GUI  to some script that lacks of if, starting from Hairy.

Watching the Coil Envelope source i manage to make numeric field for entering the value. I don't know yet how to do the same for string and vars like this one:
gravity = new Vec3(0.0, -1, 0.0);

... but the main trouble is another. To run the GUI i saved Hairy in the tools folders. And now, when running, it can't find the "script" object.

http://aoi-castellano.com.ar/img_al_foro/ejemplos/hairyGUI.jpg

Having a GUI for hairy would be great, because by now it gives errors when there's no "hairy" object on scene. But if the GUI can ask for a name (making a list of available objects on scene) the this error wouldn't happen.


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

#7 January 8, 2010, 4:04 pm

fpgui
Moderator
From: France
Registered: November 2, 2004,
Posts: 958
Reputation :   
Website

Re: making a GUI for AOI

fpgui wrote:

You can set a UI only for tool scripts, object scripts are evaluated at each render so you'd see the UI pop up at each render, quite annoying.

And I ask you, what kind of script is Hairy, mmmmh ? Yessiiiiiir, an object script.

Solution, though a bit of a tough one for beginning scripting. Writing a tool script called Hairy Settings. Read the settings in the hairy scripted object. Show them in GUI, and save in Hairy script according to user modification. Job done.

But honestly you should try working on tool scripts first. Yet I have the feeling most of these (if not all) have a GUI already.

Homework.
Let's code a GUI editor for any object script. We need some conventions to know about parameters of the script we're editing. Basically we need a parameter section which would be signaled through a comment :
//@parameters
then signal each parameter through another tag like
//@parameter
we ought to know the parameter type too, like
//@parameter string
or
//@parameter float
then we need the text label to display before the value of the parameter in the GUI dialog, so :
//@parameter float "Smoothness"
then the next line represents the java variable with its value :
smoothness=0.5

So final variable declaration would be :
//@parameters
//@parameter float "Smoothness"
smoothness=0.5
//@parameter int "Number"
num=3
//@endparameters

We could select any scripted object, then select the GUI tool script. The GUI tool script would get object selection from the scene, check if its a scripted object, load the associated script (there is one script version per object), read parameters, edit them and save them back.

We'd have to modify object scripts so they follow convention above, but that is an easy part.


Francois

Offline

 

#8 January 8, 2010, 6:27 pm

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

Re: making a GUI for AOI

For sure i can modify the object scripts that way. After weekend.

By other hand, this solution is quite difficult to manage. Me, like an end user, will not feel comfortable following those steps.

try working on tool scripts first

I need a new intention now. Until i get more skilled.

I'll try out aoi API, and maybe i'll use some Beanshell code too, so to dive into the sea...


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

#9 January 13, 2010, 3:47 pm

fpgui
Moderator
From: France
Registered: November 2, 2004,
Posts: 958
Reputation :   
Website

Re: making a GUI for AOI

I am stupid ! I completely forgot about this :
[html]http://www.friendlyskies.net/aoiportal/content/view/27/45/[/html]

You can specify parameters for the object script without having to go for the hack I described above.


Francois

Offline

 

#10 January 14, 2010, 7:09 am

mayid
42
From: Argentina
Registered: March 29, 2009,
Posts: 1004
Reputation :   
Website

Re: making a GUI for AOI

Hi. So getParameterValue and setParameterValue are the functions to read and store parameters in the script files?

I 'll play around with scripts in these days.


Comunidad en español:
www.aoi-castellano.com.ar/ForoBB/index.php
Comunidad de aprendizaje.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson