PDA

View Full Version : Lscript SDK???



petrockproducti
07-10-2006, 07:45 AM
I have been trying to get into LScript a little bit but I can't for the life of me find a document which features all the function calls and system variables I can tap into. My goal is to write a simple for loop which when applied to an object would cycle through all the other children of the parent object and store their respective distances away into an array.

I've seen some pretty cool stuff done with LScript, I have some fairly complex math/physics scripting background which I would like to start utilizing. I just have to get over the initial learning curve. Are the tasks I posit to do feasible with Lscripts limited function calls? Is there a document out there somewhere in the interether that can point me to what I am looking for?

art
07-10-2006, 07:56 AM
About the only official documents that I know of are the LScript Reference Guide and User Guide. Both pdfs should be somewhere in your Lightwave installation folder and/or on the installation disk. It is also useful to go through release notes:

http://www.newtek.com/lightwave/developer/LW80/8lwsdk/docs/lscript/index.html

They contain some info that is missing in pdfs.

Other that that you can ask for help on the forum. There are always some experts who would help you.

petrockproducti
07-10-2006, 08:16 AM
!!!
Thanks!!!

Dodgy
07-10-2006, 08:27 AM
Also, sign up for the Lscript mailing list, lots of helpful people on there.

[email protected]

art
07-10-2006, 10:01 AM
Dodgy, how does one sign up for that list and how does it work? (please forgive me my ignorance)

Dodgy
07-10-2006, 10:52 AM
Have a look here :)

http://lists.newtek.com/mailman/listinfo/lscript

art
07-10-2006, 10:59 AM
Thanks, easy enough

evenflcw
07-10-2006, 11:53 AM
For iterating through all items in a hierarchy check out visitnodes() in the release notes for lscript version 2.6. It basically helps you create a recursive function. You could also write this function yourself! Lscript function calls aren't THAT limited.

EDIT:
This question was asked in the LW9 section of the forum... so anybody know if lscript is getting an update intime for LW9.0 official release (14/15th of July)? I'm especially eager to know if edges will be made available in modeler and mesh creation in Layout.

Kurtis
07-10-2006, 05:56 PM
Here is a direct link to the official SDK for LightWave v9.
http://www.lightwave3d.com/developer/LW90/lw9sdk-063006.zip

At one time, Wordware (http://www.wordware.com/lightwave) was developing an LScript book. Not sure what happened to it though. You might want to contact them (http://www.wordware.com/computer/contact_us.shtml) and ask.

petrockproducti
07-10-2006, 11:09 PM
you guys rock!!!

petrockproducti
07-10-2006, 11:43 PM
For now as long as I can impliment some basic physics, I'm happy. I'll let you know when I make it to Jos Stan's Navier-Stokes implimentations.

art
07-11-2006, 07:35 AM
For now as long as I can impliment some basic physics, I'm happy. I'll let you know when I make it to Jos Stan's Navier-Stokes implimentations.
For that you might want to look into SDK. LScript could be too slow for you.
We always welcome new fluid solutions for lightwave :thumbsup:

RedBull
07-11-2006, 05:40 PM
Is there a document out there somewhere in the interether that can point me to what I am looking for?

Hmm by the sounds of it, you don't have the reference and userguide pdf's
http://www.newtek.com/lightwave/developers.php

I seem to remember some LW8 updates or maybe it was LW8 itself,
did not install the full Lscript documentation and only 295k placeholder versions. rather then the several megabyte PDF's that are on the CD and website. So make sure you have the 2 listed PDF's from the website.

The HTML docs are very useful in companion to the PDFs.
Also Lscript Commander in Layout can act as a reference in itself.
Many events are listed as you do them, and there is command sequence
window, which has commands listed in an A to Z format. Which can also aid in getting up to speed in Lscript.

Hope it helps.

petrockproducti
07-12-2006, 11:12 PM
For that you might want to look into SDK. LScript could be too slow for you.
We always welcome new fluid solutions for lightwave :thumbsup:

I understand the physics, I probably could have implimented it in Matlab, but... my grasp of any real programming language is tenuous at best. I would have to quit my day job, first...

art
07-13-2006, 08:04 AM
I understand the physics, I probably could have implimented it in Matlab, but... my grasp of any real programming language is tenuous at best. I would have to quit my day job, first...

Try lscript first. It is definetely easier to start with than SDK. I looked at one of Jos Stan's (Stam's?) papers on real time fluid. Looks easier than anything I've seen before (probably more limited too). I on the other hand only remotely understand the math behind it. I should have paid more attention in school when they covered the vector calculus :D

petrockproducti
07-14-2006, 12:16 AM
Alrighty, so I have something that is semi workable.

I have been using the info function to display various functions as they are parced in order to get a sense of what is going on under the hood.

My issue, however, is that the info window displays six times every time I load the lscript. Additionally, what is a good way of testing these things? I am creating a motion script and I have been applying it in the motion options window. Its kind of a pain to keep reloading the script as I build it... is there a refresh button? I suppose I could move this inquiry to its respective forum if that works best for you all here.

art
07-14-2006, 07:43 AM
I'd like to hear an answer/suggestions to this one too. I had problems debugging layout scripts as they are executed multiple multiple times over the course of action. If I tried to use "info" to see what's going on, i was getting many simultaneous popups, sometimes it just looped infinitely until LW crashed.
You can try to switch alert level to "expert" in lw8 or "low" in lw9 under options. Instead popups it will display the output in the info bar. No crashes. The drawback is that it does not pause the execution.
I also tried to output debug info to a file but it did not seem to always work (not in LW's calback functions that are constantly called ). Maybe I was doing something wrong.

faulknermano
07-14-2006, 08:36 AM
use the Diagnostic object agent.

if you dont know where to find, download:

http://thespread.ghostoutpost.com/LSCRIPT_DOCS.zip

and look at the experimental features rtf file.

art
07-14-2006, 08:40 AM
Thanks, I'll give it a try.

LightFreeze
07-15-2006, 09:54 AM
just checking that you are aware there is a debug() command that will run the script in the debugger? Which lets you set break points and watch variables etc.

petrockproducti
07-18-2006, 12:25 AM
I am now having issues with the get object agent:
ma.get(position,time); does not update as frames advance. Also, if I had my script attached to two objects, the number it returns will show the initial x value for one child object, but the y value for the other child object. These values do not update as the frames advance.

petrockproducti
07-18-2006, 12:42 AM
Wait, so let me get this straight, you can only use the get method to "get" the vector for a keyed variable??? Is there a way to get the current position as it has been set by the lscript???

faulknermano
07-18-2006, 01:24 AM
i use a workaround to this. in the create() function do something like:


mySelfOA; // global variable
create
{
...
mySelfOA = obj;
...
}


then, call this function:



getObjectPosition
{
mySelfOA.getPosition(Scene().currenttime);
return(this);
}

petrockproducti
07-18-2006, 02:33 AM
Hmmm... I have run a few variations on what you show there, and the getObjectPosition function returns a nil argument.

Seems kindof like a bug if a work around such as this is required...