BrickToPy Addon For BGE and Newbies


(juniorsla) #1

Hello guys
I’m making this addon named “BrickToPy”
This addon is very interesting and will help beginners understand a little scripts.
I’m converting a few sensors\actuators to code, and the final version is coming…
The function of this addon is to convert logic bricks to python

The video demonstrating the alpha version here:

I hope you like. Thanks :slight_smile:

ps: Sorry for my bad english, because i’m a brazilian…


(BluePrintRandom) #2

Nice Work!

I just wish python was half as fast as logic…

I wonder if you could make a “exporter” that made C++ ? or C? Lua?

this would make any engine usable as a export tool for blender ?


(Spirou4D) #3

Hi Juniorsla,

Where is the download link to try it, please?

Edit: 15/08/2014 23h: thanks juniorsla, I appreciate!


(cubedparadox) #4

This is very cool, I’d love to play with it a little :slight_smile:
What bricks have you converted so far?


(MrPutuLips) #5

Well… It works! :stuck_out_tongue:

Nice work, but I see some problems with this:

  • As BPR mentioned, the performance with Python is worse than logic bricks.
  • It uses some pretty uncommon terms for the variables: Generally obj/own is used instead of o, scene instead of cena (this means dinner according to Google translate?), and cont instead of c.
  • What happens when a brick has the same name as a predefined variable (like if you named an Always sensor “logic”)?

I like the way you are approaching this since people wouldn’t really need this if they are trying to use Python, so aiming it towards new users of Python is a great transition :slight_smile:


(juniorsla) #6

Hi BluePrintRandom, Thank you
I like the logic bricks, but i use scripts because is very efficient in multiple logics.
For example, the object properties : position, scale, color, name, and more…
Exporter? But, you want an exporter for export other game logics for bge, or export logic bricks to code for other game engine? I don’t understand what you want … sorry

Hi Spirou4D,
The addon still is in development… I’m waiting for the BGE 2.72, and the new sensors\actuators. But, i will cast an alpha version soon… Thanks

Hi cubedparadox, Thanks
I converted the following sensors\actuators for the moment:
__
Mouse_Sensor
Keyboard_Sensor
Property_Sensor

Visibility_Actuator
State_Actuator
Property_Actuator
Parent_Actuator
Message_Actuator
Game_Actuator
EditObject_Actuator
Action_Actuator
__

And i’m converting the joystick sensor in moment…

Hi MrPutuLips, Thanks
ohh… sorry, i’m using this terms because i’m an brazilian .
“o” is the abreviation of “own”, “c” is abreviation of “cont”.
The “cena” is “scene” in my language : Portuguese Brazil.
If a brick has the same name of an predefined variable? Well, in this case do not have any error, you had any error with this ?
Yes, the purpose is very simple : help the new users, understand the first code…

Thanks you all for the attention. More updates and others addons made by me, coming soon…


(smokythaklown) #7

WOOOOOWWWW!!! SO FLlPPING CRAZY HOW I NEED THIS RIGHT NOW!!! blend4web.com is in java script so all the logic bricks in my scene will be converted to a python script, which will be easy to convert into java from there thus resulting in almost no coding if i use a python to java converter with the minor adjustments afterwards. So shocked i stumbled upon this right now thank you so much i am going to check every couple of days for the release!!!


(BluePrintRandom) #8

if this process were automated, the bge would become a valid dev tool…


(sdfgeoff) #9

scene will be converted to a python script, which will be easy to convert into java

Sorry to bust your bubble, but, well, nope!

Interesting idea, but I’m afraid I fail to see the point of converting logic bricks to python. Can you explain why you are making this addon and who you think will use it?


(smokythaklown) #10

Hello reptilian eye ball, he is making it because it is usefull and people like me will use it (hope that answers your question). Rather then knowing how to porgram, you use logic bricks… so far you understand right, this man has made it so you can see what you have done in python script. MEANING, in the case where (blend4web.com) requires java scripts rather then python scripts it is very usefull to have the atual python script to convert to java… So far so good right, since there is existing python to java conversion me myself will be able to provide a web app built with blender without knowing python nor java. Too awesome, nobel peace of mind prize stuff here guys!


(smokythaklown) #11

BGE is a valid developer tool =D and thats automated enough for me!


(BluePrintRandom) #12

Yar, I think a python to C++ converter that did so in a GPL avoiding way, could allow the full power of BGE games to cross platform.

also a bge -> HTML 5 route would be nice

and a bge -> Java / Lua would be nice as well.

Bge is a valid tool don’t get me wrong, but the only real difference between blender and unity is cross-platform, and purchasable libraries, and pre made asset ‘templates’ etc.

BGE just needs a few little upgrades, (render call batching, and some screen space normal candy) - http://wiki.blender.org/index.php/User:Kupoman/BGE_Custom_Render_Pipeline_Proposal


(3d solar system builder) #13

I would love to be able to convert logic bricks into code for unity.I think converting logic bricks to code for jmonkey would be great.I think supporting as many game engines as possible this way would be really good.


(sdfgeoff) #14

python script to convert to java

I’m afraid programming doesn’t work like that. Particularly where non-standard API’s (such as blender and blend4web) are concerned.

Apologies for derailing the thread juniorsta


(VincentG) #15

Is it really that slow with Python? Do you recommend to use logic as much as possible?


(BluePrintRandom) #16

So,

100’s of python controllers = much slower then 100’s of logic controllers

1 python controller using lists to do same thing (*with clever programming) = faster then 100’s of logic bricks

so, adding 1000’s of particles managed by python (each = slow)

adding 1000’s of particles managed by logic - faster

adding 1000’s of particles, managed by 1 python script = fastest

I think

someone may have a better description.


(Exodus111) #17

Java does not equal Javascript.

They are very different programming languages. Javascript was named after Java mostly for popularity at the time, but it is something completely different.

Blend4web uses Javascript, not Java. Just thought you should know.


(Terra_Byte_Tech) #18

Please tell me this is still in development. :frowning: I really need this script for a game i’m working on. If you aren’t working on this anymore, could you atleast release what you currently have? Having a small number of logic bricks for a simple object is perfectly fine, but having AI work off of it is an absolute nightmare for processing speed.


(EndSSGamesStudio) #19

juniorsla
Legal!
eu vi isso em outro video fico muito bom, mais não tive a oportunidade de testa o addon, porque desistiu de continua-lo poderia realmente ajuda pessoas que ainda estão aprendendo python! :slight_smile: