PDA

View Full Version : LScript-to-Python converter



Gorbag
02-22-2012, 10:32 AM
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.

nickdigital
02-22-2012, 03:29 PM
Thanks! I'll definitely be checking this out.

Matt
02-23-2012, 08:50 AM
Excellent, thanks Bob!

BigHache
02-23-2012, 10:17 AM
Very cool, thank you!

ncr100
02-23-2012, 11:25 AM
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}.

Elmar Moelzer
02-27-2012, 10:46 AM
Hmm, the link seems to be dead. Any news on this?

Gorbag
02-27-2012, 01:15 PM
Should be back up now. The server was running, but the page wasn't loading. Don't know what is up with that.

Gorbag
02-27-2012, 03:38 PM
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):

Gorbag
02-27-2012, 04:34 PM
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:


++x;
x--;

should convert into:


x += 1
x -= 1

In addition, it should also handle assignments correctly. For example:


i = x++;

should produce:


i = x
x += 1

and:


d = --x;

should produce:


x -= 1
d = x

djlithium
02-28-2012, 03:30 AM
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?

Gorbag
02-28-2012, 01:45 PM
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?

Matt
02-28-2012, 04:49 PM
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.

djlithium
02-29-2012, 07:43 AM
Yup. That's exactly what I mean.
We did something similar with charlot (chco) and his scene fixing utility that converted hosed LWS files into fixed ones for EU LW users who got tied up in the , vs . issue a while back.

On top of that, there are a few Lscripters at L3D who could try help out a bit, specifically alexx, luke and petter as well as james.

Celshader
02-29-2012, 10:22 PM
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.

:boogiedow

Gorbag
03-01-2012, 10:16 AM
Yup. That's exactly what I mean.
We did something similar with charlot (chco) and his scene fixing utility that converted hosed LWS files into fixed ones for EU LW users who got tied up in the , vs . issue a while back.

On top of that, there are a few Lscripters at L3D who could try help out a bit, specifically alexx, luke and petter as well as james.

No, I would have no issue with posting just a link to it on other sites.

The reason I've set this up the way I have is so I can have a single location for fixes. I do not want the code scattered to the four winds for this reason. With this arrangement, when I make a fix or enhancement, it is instantly available as long as everybody comes here.

xchrisx
07-07-2012, 04:10 PM
Is the website no longer up?

vfxdomain
08-20-2012, 05:42 PM
Can you bring it back, pretty please? ;)

masterchief
11-14-2012, 03:28 PM
Bob,

Your page does not seem to be loading at all... please advise.

regards,
William

Gorbag
11-14-2012, 04:22 PM
Should be accessible again. The server was running, but for some reason, it was not responding. I've restarted it. Sorry for the inconvenience.

MSherak
05-20-2013, 04:18 PM
This still up???

Gorbag
05-21-2013, 09:33 PM
This still up???

Sorry. The machine it was running on is now dedicated with a VPN, so it's not accessible there.

I've migrated it to the LightWave3D Group's server infrastructure, so it should be available 24/7 now.

http://devnet.lightwave3d.com:21134/

The images on the page aren't serving correctly, but the rest should work as usual.

MSherak
05-22-2013, 12:03 PM
Thank you..

Was wondering... even on something simple like cloneHierarchy.ls in the generic folder this has always seem to time out or just not convert. is there something to be aware of?? There are a couple of lscripts that I would like to move over to python and they do not convert. wondering if I am running into the same thing as cloneHierarchy.ls

Thanks,
-M

jboudreau
03-05-2015, 07:22 AM
Sorry. The machine it was running on is now dedicated with a VPN, so it's not accessible there.

I've migrated it to the LightWave3D Group's server infrastructure, so it should be available 24/7 now.

http://devnet.lightwave3d.com:21134/

The images on the page aren't serving correctly, but the rest should work as usual.

Hi

Your link seems to be down again. Could you please put it back online

Thanks
Jason

Chrizto
08-21-2016, 12:25 PM
Sorry. The machine it was running on is now dedicated with a VPN, so it's not accessible there.

I've migrated it to the LightWave3D Group's server infrastructure, so it should be available 24/7 now.

http://devnet.lightwave3d.com:21134/

The images on the page aren't serving correctly, but the rest should work as usual.


Hmm... Up 24/6 maybe?
Today it's not up. Any chance of a new link or a link to a similar tool?

Gorbag
08-22-2016, 09:28 AM
Hmm... Up 24/6 maybe?
Today it's not up. Any chance of a new link or a link to a similar tool?

Try http://76.120.19.20:21134

Chrizto
08-22-2016, 01:34 PM
Try http://76.120.19.20:21134

Thanks! That one worked!

djlithium
03-04-2017, 06:23 PM
Hi Bob.
I've found an lscript in my collection here (proprietary) that has the timeout issue. What's the proceedure for getting you this Lscript that's causing the time out?