Previous Thread  Next Thread

chat icon Time for a retarded question

division_6

Posted: Tue Apr 06, 2004 5:51 pm
Joined: 06 Apr 2004
Posts: 3
I've wanted to start scripting with blender, but I hate python. So I've been sitting around for the last year or so trying to figure out a way to open up blender and jam perl in there.

I think that if I look through the source and point it toward perl instead of python it follows that it should call the perl interpreter from that point on right?

Then if I use a nice little module I found on CPAN that allows you to use python classes in perl as if they where native perl objects, then I should have everything set up right?

Then if I need to run another person's script I can simply pass control to that script and it should execute right?

It's unfortunate that it won't be this easy. Bleh.

Any ideas thoughts or suggestions that don't involve breaking down and using the evil serpent?
Reply with quote


leinad13

Posted: Tue Apr 06, 2004 6:08 pm
Joined: 16 Oct 2002
Posts: 219
Python isnt that bad, just very specific. But i agree if you had the choice between 2 scripting languages well..... wow.
Even better would be if Blender had its own scripting language, like maya. That was easier to use than python. If you were to go into all this hassle to enable perl scripting y not look into creating bScript or blendScript etc....
(Get together with some scriptors and re-write / create a new scripting lang.)
_________________
-------------
Over to you boffins

L!13
Reply with quote


jesterKing

Posted: Tue Apr 06, 2004 6:25 pm
Joined: 18 Oct 2002
Posts: 1851
I don't see really the point of developing a new scripting language, when there are already tons of scripting languages "out there".

/jesterKing
Reply with quote


ideasman

Posted: Tue Apr 06, 2004 10:49 pm
Joined: 25 Feb 2003
Posts: 998
leinad13 wrote:
Python isnt that bad, just very specific. But i agree if you had the choice between 2 scripting languages well..... wow.
Even better would be if Blender had its own scripting language, like maya. That was easier to use than python. If you were to go into all this hassle to enable perl scripting y not look into creating bScript or blendScript etc....
(Get together with some scriptors and re-write / create a new scripting lang.)


I disagree with the comment that blender should have its own scripting language.

One of the resions I chose blender for my project last year was python- I had already tinkered with Python/OpenGL so it was not hard to learn.

Id be worried that adding more languages would fragment the script effort- I think really good python support would be more worthwhile.
(fix all the python/blender bugs and add more usefull python functions)

Its interesting to look at the Gimp- that supports C/Scheme/Perl and now Python- Im not drawing any conclusions here but Its not the beez-kneez to have lots of languages, thats all.

- Cam
Reply with quote


stiv

Posted: Wed Apr 07, 2004 5:15 am
Joined: 05 Aug 2003
Posts: 3645
division_6 wrote:

I think that if I look through the source and point it toward perl instead of python it follows that it should call the perl interpreter from that point on right?


It should be trivial to replace the 38,000+ lines of C code that implement Blender's Python interface.

A long afternoon at the most.
Reply with quote


leinad13

Posted: Wed Apr 07, 2004 10:06 am
Joined: 16 Oct 2002
Posts: 219
stiv wrote:

It should be trivial to replace the 38,000+ lines of C code that implement Blender's Python interface.

A long afternoon at the most.


Good point, i just would like to think that you dont have to learn Python in order to script for blender, Perl is a much bigger scripting language in my opinion i think anyway. Python is sort of dodgy in a couple of ways, but that could be because i dont know it enough.
_________________
-------------
Over to you boffins

L!13
Reply with quote


levon

Posted: Wed Apr 07, 2004 10:15 am
Joined: 31 Jul 2003
Posts: 413
leinad13 wrote:
stiv wrote:

It should be trivial to replace the 38,000+ lines of C code that implement Blender's Python interface.

A long afternoon at the most.


Good point, i just would like to think that you dont have to learn Python in order to script for blender, Perl is a much bigger scripting language in my opinion i think anyway. Python is sort of dodgy in a couple of ways, but that could be because i dont know it enough.



Good point, i just would like to think that you dont have to learn perl in order to script for blender
Reply with quote


division_6

Posted: Wed Apr 07, 2004 5:19 pm
Joined: 06 Apr 2004
Posts: 3
A couple of points.

1) I have no experiance with python, but with perl, the first line of the program is
#!/usr/bin/perl (or what ever your path is) with interpreter flags. So, if a little effort went into using perl as a scripting language as well, a little regex would be all that would be necessary to switch between the two.

2) The Perl6 dev team has taken an interesting direction on the VM. They are building a universal VM of sorts that is supposed to be able to act as the VM for java, TCL, Ruby, Perl and Python.

3) I may be wrong in this one, but from what I've seen, Perl is a larger more robust language. Look at the sheer number of mods available on the CPAN archive. (I'm not arguing the choice to use python in blender, I'm arguing for perls useability)

4) The PDL::Graphics::TriD package would be perfect for blender because it's oriented toward 3d applications.

5) With Perl support for Gimp being extensive as it is, this could add a huge amount of flexability and functionality to artists. I'm thinking something along the lines of BodyPaint. (I think for 3dsMax)

So, as far as I can see, I don't really think that it would be that very damaging to blender to use perl as a scripting language as well as python. If done correctly, it could be very simple and beneficial to the community.

The only concern that I have is for dependencies. With perl, the easiest way to install a package is to use the CPAN script which checks and installs deps. Otherwise you have to play the circular dependancy game and download 40 different .pm files to get anything going.

Later,
division_6
Reply with quote


harkyman

Posted: Wed Apr 07, 2004 6:50 pm
Joined: 18 Oct 2002
Posts: 271
Is perl object oriented? I've used perl, php, vbscript, javascript, vba and now c (with the Blender source). Personally, I think that Python fits beautifully with Blender, as it is open source, high-level and object-oriented. If perl qualifies on those grounds, too, then I guess it's just a matter of personal preference and code inertia. Viva la Python!
Reply with quote


division_6

Posted: Wed Apr 07, 2004 8:31 pm
Joined: 06 Apr 2004
Posts: 3
Yes, perl is extremely OO. It supports hierchies, inheritance, polymorphism, abstract base classing, virtual constructors and destructors, virtual methods and run time type identification.

I'm saying that python isn't a good scripting language or that it isn't suited for blender. Hell, qbasic could be well suited with a little creative coding.

The point that I'm trying to say is that perl would make an excellent addition to blender.

I really don't know a great deal about python. I don't really care to. Perl can and does do anything that I personally want it to do already, has a HUGE support base, is well integrated into linux and many applications most notably Apache (which could also serve some purpose with the web plugin) have very good support and optimization for perl.

Another added bonus is that perl comes with a byte code compiler. How is that useful for blender scripting? I'm not really sure. I think, however, that with some clever bits of something or other it could be used in some fashion to do something.... I think.

Honestly, I only have the faintest idea of how to implement this. First, write xsubs for the API, then write a routine to choose either perl or python, then write the actual interface between blender and perl (event handlers, error handlers, stuff like that).

This seem to be on the right track?
Reply with quote


blendix

Posted: Wed Apr 07, 2004 9:18 pm
Joined: 16 Oct 2002
Posts: 129
I do not see what Perl offers over Python. Python can do pretty much all the things you mentioned. I do not believe that Perl will allow you to do somehow 'more' than you can do with Python. That said, I'm not against adding another scripting language.

You must know that there is no 'Blender API'. There are .h files of course, and some things are split up into separate modules, but it's not like you want to write direct interfaces for internal Blender functions. This is also why the Python team has so much work, they have to go into Blender's internal code and write functions based on it.

The current Python API is what comes closest to a 'Blender API', that you can use without fear of crashing Blender.

And then there is the (separate) game engine interface too, which is coded in c++, and Python is even mixed with the actual game engine code. Some kind of special base class is used that makes Python recognize the c++ classes, which doesn't make it easier for a second scripting language.
Reply with quote


ascotan

Posted: Thu Apr 08, 2004 9:10 am
Joined: 29 May 2003
Posts: 214
Quote:
Perl is a larger more robust language
So is C, but having artists write C code is asking a bit much. Python is a simple yet powerful scripting language. You dont need learn python to script in blender. Python is just there to give some extensiblity for low level things like string, etc. Jez, why not just force script writers to write scripts in APL? Smile
Quote:
Another added bonus is that perl comes with a byte code compiler.
Uggg.
You mean the perl VM would need to be distributed with blender? ... along with having to download perl & python???? I can hear it now "I downloaded perl X.y.z but my scripts don't work - what am I doing wrong?"

I think that having a second scripting lanuage available for users is a good idea, however,
1. I don't think most of the devs would like to be updating .xs files evertime things are added to python. The perl source would have to be a wrapper for the python API otherwise it will simply not get updated - no one is going to write python C API functions and perl XSubs too - or worse that perl and python will end up competing and not be the same API.
2. Removing the python API is not really a feasible option. People who have written scripts for blender such as the beast project/makehuman would be forced to rewrite their entire projects in perl scripts. Also the python API is shorly to become the 2nd largest module in the blender source code.

If you can write wrapper code for the python-API (which i dont think is possible) it might be worth considering, however, even if this was done someone (the python devs) would have to update both API's. Maybe there is a better way to do this. Question Then there is the concern of spliting the script writing community among perl and python script writers.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group