Lua and Blender = BLU

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

jesterKing
Site Admin
Posts: 1848
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Lua and Blender = BLU

Postby jesterKing » Mon Sep 19, 2005 10:29 am

The "scriptkiddies" among us may be happy to learn about BLU, an attempt to bring Lua scripting into Blender. Real scripting, like with Python is not yet possible, as there is no way yet to use Texts as Lua scripts, or load lua scripts from the UI, but there are already some modules implemented (partly), and test.lua (in the same dir as the blender executable, for now) uses that functionality.

I use BPy as a guide to BLU (kudos to the BPy team!), so it shouldn't be to difficult to take up Lua scripting when it is in a usable state (some undetermined moment in the future)

Anyway, I thought you'd like to know.

/Nathan

ideasman
Posts: 1000
Joined: Tue Feb 25, 2003 2:37 pm

Postby ideasman » Sat Sep 24, 2005 10:15 am

Hi, From using Gimp Its interesting to see how different scripting Languales can CoExist in the same application.

- Gimp has a C API thats wrapped by many different languages and I *think* much of the work is autogenerated.

If a new language is added into Blender it seems like we should be carefull and think about how it will co-exist with python.

Somthing that could be added into Blender is a Macro language that just hooks around existing UI functions, theres HEAPS of functions Blender/Python cant do that would be simple with a macro wrapper.
- Mabe rendered UI elements could be registered with LUA and lua could accsess them by the events system.

If somthing could be largely autogeneraged then its going to be heaps less work to maintain. - BPython alredy suffers from lack of development and much of whats needed is simply hack work, so it would be bad to have another API for LUA that is not that well maintained.

Im just not sure how usefull having an API that replicates python is. Python versioning is an issue but IMHO not a good enough resion to add another language alone.

- Cam

stiv
Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Postby stiv » Sat Sep 24, 2005 4:10 pm

Personally, I think this is cool, but then I have a fascination with languages both computer and human. This is an experimental project so it is a little early to be trembing in fear about its long term effects.

Autogenerating scripting interface wrappers from Blender's C API is a totally genius idea. The one fatal drawback is that Blender has no C API to wrap.

The first phase of the bpy project was provide access to Blender's database. The second phase is to provide access to functionality available thru the GUI - to Blender's commands, if you will. The new SpaceHandlers are one step along the way.

Note that as Blender becomes more 'wrappable' thru changes needed for Bpy, it becomes easier to add wrappers and interfaces for other languages like LUA. Perl, Python and Scheme co-exist in GIMP; no reason why they can not do so in Blender.

I have read interesting things about Lua and look forward to playing with it. Let the Babel begin!

jesterKing
Site Admin
Posts: 1848
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Postby jesterKing » Tue Sep 27, 2005 12:33 pm

ideasman wrote:If a new language is added into Blender it seems like we should be carefull and think about how it will co-exist with python.


This is one of the questions I posed on the BLU page.

ideasman wrote:Somthing that could be added into Blender is a Macro language that just hooks around existing UI functions, theres HEAPS of functions Blender/Python cant do that would be simple with a macro wrapper.
- Mabe rendered UI elements could be registered with LUA and lua could accsess them by the events system.


That indeed would be interesting to investigate.

ideasman wrote:Im just not sure how usefull having an API that replicates python is. Python versioning is an issue but IMHO not a good enough resion to add another language alone.


It is not the only reason, and I'm well aware that I'll probably using it alone (perhaps stivs too) for quite a while.

There are several more reasons either implicitly on the page, or not mentioned at all. Some reasons are personal, like "because I can", but I want also to investigate some processes in doing projects.

I've been looking for requirement software that could be used in OSS development. I've found now DRES (http://dres.sourceforge.net), which looks like a good candidate to start with. I'm interested to see how such a tool could help during the development and during testing. As a nice extra it could give some valuable documentation for old and new developers.

So apart from trying to interface with Lua there's some extra things I'm considering during this project (yes, I know, I could've also just picked up DbBlender and such, but I've put that a little later for possible integration with BLU).

Now you can see I tried starting a Use Case document, but doing it this way is not optimal - hence the search for tools that can assist. From there to requirement specification etc.

stivs wrote:no reason why they can not do so in Blender.

exactly ;)

stivs wrote:I have read interesting things about Lua and look forward to playing with it. Let the Babel begin!

rockrock.

/Nathan

greatwolf
Posts: 3
Joined: Tue Dec 04, 2012 3:43 am

Postby greatwolf » Wed Jan 02, 2013 3:20 pm

So I'm wondering whatever happened to this project? I'm very interested in seeing Lua scripting support in blender.

stiv
Posts: 3646
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Postby stiv » Wed Jan 02, 2013 4:48 pm

So I'm wondering whatever happened to this project?


Not a whole lot. An interesting experiment, but given the original implementation of blender python, it would have been a huge amount of manual work.

With the new python implementation using Blender's DNA/RNA, a lot of the work of creating bindings can be automated. But you still have to write a whole lot of code to interface with Blender's internals.

dertom
Posts: 3
Joined: Mon Sep 28, 2009 8:49 pm
Location: Germany

Postby dertom » Wed Jan 16, 2013 11:07 pm

At least they just added lua-highlighting!

@devs: Thx, a lot for that!


Return to “Coding Blender”

Who is online

Users browsing this forum: Google [Bot] and 0 guests