Page 1 of 2 12 LastLast
Results 1 to 15 of 27

Thread: LScript-to-Python converter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    39

    LScript-to-Python converter

    I don't know if anybody might find this useful, but I've put up an LScript-to-Python converter web page. It can be found there:

    http://www.bobhood.net:21134/

    Enter a script name, and paste your valid LScript code into it, and it will be run through a Python backend that will attempt to convert it into a LightWave Python plug-in.

    This is by no means a perfect converter. It simply attempts to get your LScript as near as possible to a usable LightWave Python plug-in. You are going to have to do further work to get it all the way.

    Bear in mind some points:

    • Some LScript code will cause the converter to fail.
    • I will continue to work on the converter if/as I have time, but this is provided simply as courtesy.
    • If your script is successfully processed, it is not retained. If it fails for some reason, a copy is cached on the server so that I can use it to identify/correct issues with the converter. If you'd rather not have your code retained for this reason, please do not use the converter. If you're conversion has failed and you do not want a copy of your code cached, please let me know the name of the script you used in your conversion attempt, and I will delete it.
    • This is not officially supported or sanctioned by NewTek. I wrote this as a courtesy to LScript users, and I alone am responsible for it. That said, I am not responsible for damages, perceived or real, that result from your use of this converter.

  2. #2
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Thanks! I'll definitely be checking this out.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  3. #3
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,055
    Excellent, thanks Bob!
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  4. #4
    Kamehameha Chameleon BigHache's Avatar
    Join Date
    Sep 2006
    Location
    Future Past Life
    Posts
    1,899
    Very cool, thank you!

  5. #5
    "OH NO!", Joseph Joestar ncr100's Avatar
    Join Date
    Feb 2003
    Location
    San Francisco
    Posts
    1,100
    Blog Entries
    2
    Thanks Bob - just playing around with this.

    I found the "conditional expression" operator {x = (4 > 5) ? 6 : 7} needed to be rewritten {x = (4 > 5) if 6 else 7}.

    I found also the "post-increment" operator {x++} needed to be expanded {x = 1 + x}.
    -Nick
    audio: Ö ¤ wk Py

  6. #6
    Hmm, the link seems to be dead. Any news on this?
    Yes, my Avatar shows a volume rendering...
    VoluMedic Creative Edition only USD 299 !
    www.volumedic.com

  7. #7
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    39
    Should be back up now. The server was running, but the page wasn't loading. Don't know what is up with that.

  8. #8
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    39
    I corrected a generation error that Elmar brought to my attention with regard to Generic scripts. They now generate the proper entry function, which is:

    def process(self, ga):

    instead of:

    def generic(self):

  9. #9
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    39
    Quote Originally Posted by ncr100 View Post
    I found also the "post-increment" operator {x++} needed to be expanded {x = 1 + x}.
    I've put in detection and conversion of pre- and post-increment and decrement operators. So, things like:

    Code:
    ++x;
    x--;
    should convert into:

    Code:
    x += 1
    x -= 1
    In addition, it should also handle assignments correctly. For example:

    Code:
    i = x++;
    should produce:

    Code:
    i = x
    x += 1
    and:

    Code:
    d = --x;
    should produce:

    Code:
    x -= 1
    d = x

  10. #10
    Hey Bob!
    This is pretty slick and incredibly important to keep alive and accessible to as many people as possible. Are you ok with us posting this on Liberty3d.com as a prominent function and do you need help at all with this?
    DJ Lithium | KAT! =^..^=

    Black Tiger Recordings
    http://www.blacktigerrecordings.com
    Founder and Citizen of Liberty3d.com
    www.liberty3d.com

  11. #11
    Geist im Maschine Gorbag's Avatar
    Join Date
    Jul 2003
    Location
    Lakewood, CO
    Posts
    39
    Quote Originally Posted by djlithium View Post
    Hey Bob!
    This is pretty slick and incredibly important to keep alive and accessible to as many people as possible. Are you ok with us posting this on Liberty3d.com as a prominent function and do you need help at all with this?
    Define what you mean by "posting this." Do you mean posting a link to it on other sites?

  12. #12
    Valiant NewTeKnight Matt's Avatar
    Join Date
    Feb 2003
    Location
    San Antonio, Texas, USA
    Posts
    13,055
    Quote Originally Posted by Gorbag View Post
    Define what you mean by "posting this." Do you mean posting a link to it on other sites?
    I imagine that's what he means Bob.
    UI / UX Designer @ NewTek
    __________________________________________________
    www.pixsim.co.uk : LightWave Video Tutorials & Tools


  13. #13
    Red Mage Celshader's Avatar
    Join Date
    Feb 2003
    Location
    Burbank, California
    Posts
    1,817

    Thank you!!!!!

    Quote Originally Posted by Gorbag View Post
    This is by no means a perfect converter. It simply attempts to get your LScript as near as possible to a usable LightWave Python plug-in. You are going to have to do further work to get it all the way.
    Thank you so much for this. Thanks to your converter, I just learned two new Layout commands that I hope to use in my future scripts:

    lwsdk.LWSceneInfo().filename -- the path to the scene file itself.

    lwsdk.LWSceneInfo().RGBPrefix -- the render output path.

    Jen's 3D -- LightWave stuff.
    Jen's 2D -- my comic book.

    Python is my smashing board. LightWave is my S.M.A.K.

  14. #14
    automator of tasks xchrisx's Avatar
    Join Date
    Jul 2003
    Location
    Nevada
    Posts
    593
    Blog Entries
    6
    Is the website no longer up?
    My Lscript Collection | LinkedIn
    3D Generalist IGT

  15. #15
    Registered User
    Join Date
    Jan 2011
    Location
    Israel
    Posts
    16
    Can you bring it back, pretty please?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •