Yeah !!! I did it !!! :D

Apparently I was doing it wrong , by returning the message in
doesNotUnderstand , this is why the next MNU was returned by Object instead
of my parser class.

Say bye bye to ugly nil syntax , Ephestos now supports normal pharo
messaging.

This ugly thing

 EphParser bpy:nil data:nil objects:'[ "Cube" ]' location:
 '=(0.0,0.0,0.0)' .

has turned to this

EphCParser  bpy ; data ; objects:'["Cube"]' location:'=(0.0,0.0,0.0)' ; e.

or this

EphCParser  bpy  data objects:'["Cube"]' location:'=(0.0,0.0,0.0)'; e.

or you can use parentheses . You can send all keywords as single message as
I do in the example or separate them with parentheses to different messages
, it does not matter because the parser unites them into a single string
anyway. Message e, formulates the python string and marks the end of pharo
command.

Means that now I offer full python support with no weird pharo syntax :)
New parser is called EphCParser if you want to give it a try, I am still
working on it to make sure it works well in all scenarios.

this is an example of using python globals for making the code shorter

EphCParser x:'=1.0' ; e.
EphCParser cube:'=bpy.data.objects["Cube"]';e.
EphCParser cube ; location:'=(x,0.0,0.0)' ; e.

You may wonder , "why not use pharo variables instead ?" . Well you can do
that too ;)

cube := EphCParser bpy data objects:'["Cube"]'.
cube  location:'=(x,0.0,0.0)' ; e.

I will try to test the new parser a bit more and I will work on 1)
receiving data from Blender 2) python errors triggering the pharo debugger
and  3) buffer together multiple lines of python code for complex stuff
like class and function definition etc 4) support BGE .


On Sun, Jul 20, 2014 at 10:06 PM, Damien Cassou <[email protected]>
wrote:

> On Sun, Jul 20, 2014 at 7:34 PM, kilon alios <[email protected]>
> wrote:
> > With the help of Damien I was successful in creating a parser for pharo
> to
> > python syntax. Using pharo messages you can now construct automagically
> > python strings and pass it to blender . This way you no longer need to
> type
> > in python syntax to do python stuff. So a big thanks to Damien. Note this
> > method of course is slower because of parsing and heavy usage of regex
> > string matching.
>
>
> are you sure you need to pass 'nil' everywhere? In
> #doesNotUnderstand:, you could check for the number of arguments and
> generate something appropriate based on that.
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm."
> Winston Churchill
>
>

Reply via email to