Editor progress week 14 - some more scripting

Posted on:July 17 2006

Last week I worked just a bit more on irrEdit, the Irrlicht Editor and improved various small details. I also added some more scripting functions and the possibility to insert menus and toolbar items into the editor via scripts, to make it extendable. I wrote documentation for the scripting interface which was the most difficult part :) Please take a look at it, are you missing something? It's not everything, but it should be possible to do pretty much with this already: modify everything of scene nodes and materials. Animators are still missing.
The cool thing about this is that those scripts are really useful, and not only a toy. Example:

So what's so cool about that screen shot? IrrEdit currently is not able to show the scene in wire frame mode. And the development version on the shot isn't either. So to test out the scripting stuff, I added a script which added a button enhancing the editor to toggle the wire frame mode. It looks like this:
WireframeModeOn <- false;

// toggles wirframe mode for one node and its children
function toggleWireframeForNode(node)
{
local materialCount = irrGetSceneNodeMaterialCount(node);

for (local i=0; i<materialCount; ++i)
irrSetSceneNodeMaterialProperty(node, i, "Wireframe",
::WireframeModeOn);

local childCount = irrGetSceneNodeChildCount(node);

for (local i=0; i<childCount; ++i)
toggleWireframeForNode(irrGetChildSceneNode(node, i));
}

// toggles wireframe mode for all nodes
function toggleWireframeForAllSceneNodes()
{
::WireframeModeOn = !::WireframeModeOn;

toggleWireframeForNode(irrGetRootSceneNode());
editorUpdateAllWindows();
}

Also cool: It was easier to write that script in 2 minutes than it would have taken to code it really in C++ into the editor. I hope that other people will use this scripting too and will contribute their stuff to make the editor better. :) Going to release that thing soon.





Comments:


When we can download the next version?
Lonerunner
Quote
2006-07-17 19:58:00


wow, that's cool stuff!
keep up the good work :)
bakkdoor
Quote
2006-07-17 19:59:00


"This example creates a new cube without default settings"
Guess you meant "with default settings", right?
matt
Quote
2006-07-17 21:12:00


You have to love scripting.
SkaCahToa
Quote
2006-07-17 23:03:00


That's pretty damn cool, Niko! As I understand you are unwilling to open the source code to the editor (note: I'm not complaining here!) - I was wondering if you would be willing to create an example project for integrating Irrlicht into wxWindows/wxWidgets.

Also, I am curious as to whether this will work in Linux (given the cross-platform capability of the underlying GUI library & Irrlicht). The method Acki(?) uses for embedding Irrlilcht in wxWindows is limited to the M$ Windows platform. Which is all well and good, but if I am limited to Microsoft platforms - I'll stick with Borland C++ Builder. If, however, you have got this working on Linux as well - this would mean a switch to wxWidgets for me!

--EK
Eternl Knight
Quote
2006-07-18 02:46:00


when the IrrEdit and irrlicht is mature? i has wait for it too long long time.
from long long time ago,i ... ...
true-hearted wat
Quote
2006-07-18 12:04:00


i hope this does get open-sourced soon, I really want to see if physics properties and sound source scene nodes could be added! :-)
buhatkj
Quote
2006-07-18 17:11:00


@matt: nope, its not a typo. If you want default settings, use editorAddSceneNode. :)
niko
Quote
2006-07-18 17:41:00


Bah. Why not use Python or Ruby for scripting?
But anyway. Great work.

Regards,
Armin
Armin Ronacher
Quote
2006-07-18 21:13:00


great stuff, niko!
lug
Quote
2006-07-19 07:06:00


While I too would have preferred embedding Python (and am in the process of embedding Stackless Python in my project), I think that Niko shoudl use whatever scripting language he feels comfortable with. While I'm not familiar with Ruby, Python does have it's "gotchas" that throw some people off.

Given that Niko has coded Irrlicht & IrrEdit in C++, a language using similar syntax & semantics makes sense as far as I can tell. Hell, the only reason I am using Stackless Python is to shortcut the use of tasklets in my simulation.

--EK
Eternl Knight
Quote
2006-07-19 13:55:00


Wow this is GREAT! If a powerful plug-in system is available to developers then we could see a very fast and realiable way to create games with irrlicht, just imagine irrEdit being able to work with soe physics engine.

Niko you'll gotta add GUI designing soon :P
Trunks14
Quote
2006-07-20 05:16:00


Add comment:


Posted by:


Enter the missing letter in: "Inte?national"


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons