View Full Version : Am I a real LScript Dummy?!?...

08-01-2003, 04:35 PM
Hi everybody,

I'm beginning to use LScript in these days: I'm definitely not a programming rookie, nevertheless I'm pathetically failing again and again to accomplish a simple task as reading the points belonging to a polygon...

Here's the code fragment:

mypoly = polygons[1];

// offending statement
// error message: invalid object reference


where I tried to display the coordinates of the first point of the first polygon of the object on the current layer (a single square!)

Any help reeeeally appreciated.


08-01-2003, 05:46 PM
Uh, if it makes you feel better, i'm just as dumb...
"mypoly.layer" works, "mypoly.isCurve()" works, but not "mypoly.points" or "mypoly.points[]" or "mypoly.points[1]"...

Because i had those problems consistently i only use the SDK now...you get a LOT of examples with it and it's much clearer what it actually does, since it has to follow the C rules obviously...

08-02-2003, 03:46 AM
Thanks Lynx3d,

that relieves me quite a bit...

Anyway, what do you mean with, er... SDK (I know it stands for software development kit: but attached to what and available where?...). You even mention tutorials: can you provide some links, plz?

Thanks again.

08-02-2003, 05:46 AM
You can find it here:
(you haveto go to the community page -> developer, and not to the download page...)

Tutorials...there is one tutorial, it guides you through a modeler plugin starting from a simple command execution for making a box to an interactive tool for creating your own box (with UVs etc)
but that's pretty much it with tuts, for the rest you have to read the documentation and examine the mentioned example .c files (most of them have more or less usefull comments though)

It's a bit more code than just type "editbegin()" and start processing, you have to compile it and the compiled result is platform dependant, but it will run a lot faster and you have less limitations (however bob hood works hard to give LScript the same functionality)

08-02-2003, 12:46 PM
Check the examples in the LScript documentation... where the Weld and WeldAverage scripts are shown... They do a weld after looking for the last point and then moving all the other points there... and merging them...

Tom Speed
08-02-2003, 03:18 PM

No you're not a dummy, you're just learning :)


mypoly=polygons[1]; // first selected Poly


// 'data' becomes an array of information about the Poly
// data[1] is always the name of the surface applied to this Poly
// data[2] to data[size(data)] contain the Point IDs this Poly is made of

for(n=2;n<=size(data);n++) // Point IDs start at [2]
info(pointinfo(data[n])); // display 'this' Points position



08-03-2003, 03:44 AM
Thanks to everybody,

you've been very supportive, I'm really grateful.
I'll practice your advices as soon as possible (I'm leaving for a few days vacation in Iceland): for the sake of information, I'm trying to figure out a "home made" hair generator so I need to control object cloning in a certain way.

All my best.


(by the the way, I'm modelling a certain big bad green giant you probably already heard about... Hope to show you soon something in the work in progress section. )