PDA

View Full Version : Rest On Ground Plugin



gamedesign1
09-02-2016, 07:08 PM
Hi All

I made my first plugin today. It's a Rest On Ground plugin that works specifically for the Y axis and it works for both polygon and point selections.
If you are interested then please feel free to use it and let me know how you get on with it.

Rest On Ground Y (https://ufile.io/56c06)

Surrealist.
09-03-2016, 12:43 AM
Pretty cool. So you know you can upload zip right here. I am getting a warning by going to that site. So just to be safe, can I ask you to upload it here?

JohnMarchant
09-03-2016, 02:18 AM
Same here Big Red Flag

gamedesign1
09-03-2016, 02:43 AM
Sorry guys I didn't realize you could upload files here, I thought it was just images :)
Here is the plugin again :)
134282

cove
09-03-2016, 11:41 AM
Sorry guys I didn't realize you could upload files here, I thought it was just images :)
Here is the plugin again :)
134282

Hi gamedesign1
Ive been trying your plugin out and it works fine.
I can see this plugin being very usefull. Thanks.

gamedesign1
09-03-2016, 12:19 PM
Hi gamedesign1
Ive been trying your plugin out and it works fine.
I can see this plugin being very usefull. Thanks.

That's great, thanks for letting me know :)
You're very welcome :)

js33
09-03-2016, 12:51 PM
If you are just learning that's cool but why don't you try to make something we haven't already had forever.
Is it using Lscript, Python or C?

gamedesign1
09-03-2016, 01:16 PM
If you are just learning that's cool but why don't you try to make something we haven't already had forever.
Is it using Lscript, Python or C?

But there wasn't a plugin that did Rest on Ground without having to select options from a panel and then click ok. There was one out there that did points, but not polygons. So I thought I'd make one that did both :)

daforum
09-03-2016, 01:43 PM
So how does it work? Anything specific to know when using it?

jeric_synergy
09-03-2016, 01:58 PM
If you are just learning that's cool but why don't you try to make something we haven't already had forever.
Dood, not cool. It's hard enough to get started.

And like he said, it's axis specific. I find axis-specific tools to be BIG time savers: MIRROR-X, for example. It's nice to have the super-generic Mirror Tool, but frankly I never use it. And it's a thousand times more difficult to code.

gamedesign1
09-03-2016, 02:05 PM
So how does it work? Anything specific to know when using it?

It will find the lowest point on your geometry and then move it down so it sits at 0 on the Y. It works with polygon and point selections and also if you don't select anything. Its simple, but I find it really handy.

Surrealist.
09-03-2016, 05:25 PM
Actually this is kinda handy.

Feature request:

A rest on ground y centered.

That way saving you two clicks. Most of the time I find I want an object centered X and Z and also rested on the ground. So in this case the defaults for the original Rest on Ground are what I want.

Can you make that?

gamedesign1
09-03-2016, 07:08 PM
Actually this is kinda handy.

Feature request:

A rest on ground y centered.

That way saving you two clicks. Most of the time I find I want an object centered X and Z and also rested on the ground. So in this case the defaults for the original Rest on Ground are what I want.

Can you make that?

Yeah that shouldn't be a problem. I'll give it a go when I get a moment.

Surrealist.
09-03-2016, 07:26 PM
Cool. :)

Kryslin
09-03-2016, 08:39 PM
"Fire and Forget" lScripts are always useful. And, they're good stepping stones to larger and more complex plugins, as you learn how Lightwave does (and does not) work.

Lord knows how many of them I have lurking around, including many of the same functions. :)

js33
09-03-2016, 09:34 PM
I wasn't trying to belittle his efforts. It's just there are a lot of plugins that do similar or the same thing so it would be cool to combine a lot of them into more powerful plugins.


Dood, not cool. It's hard enough to get started.

And like he said, it's axis specific. I find axis-specific tools to be BIG time savers: MIRROR-X, for example. It's nice to have the super-generic Mirror Tool, but frankly I never use it. And it's a thousand times more difficult to code.

js33
09-03-2016, 09:37 PM
double

cove
09-04-2016, 01:52 AM
So how does it work? Anything specific to know when using it?
Once you have downloaded it yourself and tried it then be aware that the plugin does need time to process
when applying it to complex objects.
I mention this as it can appear that modeler has locked up.
Simple objects the effect is instant. Medium complexity 2 to 6 seconds. The longest ive had to weight so far
is 30 seconds with high poly objects.

Have also found a use for this plugin that may avoid the need to use the Chronosculpt for post editing but need
to do one more test to confirm this. Will post the result if it works.

gamedesign1
09-04-2016, 02:02 PM
Once you have downloaded it yourself and tried it then be aware that the plugin does need time to process
when applying it to complex objects.
I mention this as it can appear that modeler has locked up.
Simple objects the effect is instant. Medium complexity 2 to 6 seconds. The longest ive had to weight so far
is 30 seconds with high poly objects.

Have also found a use for this plugin that may avoid the need to use the Chronosculpt for post editing but need
to do one more test to confirm this. Will post the result if it works.

Thanks Cove. To be honest I hadn't tested it on really complex objects. How many polygons roughly?

I just did a test with 24,000 polygons and it took about 5 seconds. So I will try and streamline it :)

jeric_synergy
09-04-2016, 02:16 PM
You may be able to retrieve the b.box of the selected elements-- that should speed things up.

gamedesign1
09-04-2016, 02:20 PM
You may be able to retrieve the b.box of the selected elements-- that should speed things up.

OK cheers I will take a look at it

Kryslin
09-04-2016, 02:37 PM
That would be the boundingbox(); function - returns 2 vectors, representing the corners of the box.

So...
var bbox[2];
bbox = boundingbox();
move(<0,-bbox[1].y,0>);

Should do the trick.

This could probably be compressed down into fewer lines...
var bbox = boundingbox();
move(<0,-bbox[1].y,0>);

(I make no guarantees that any of this will actually work).
I've found it's often better to the Lightwave handle any heavy lifting (like translating 26K points), instead of lScript.

gamedesign1
09-04-2016, 03:55 PM
That would be the boundingbox(); function - returns 2 vectors, representing the corners of the box.

So...
var bbox[2];
bbox = boundingbox();
move(<0,-bbox[1].y,0>);

Should do the trick.

This could probably be compressed down into fewer lines...
var bbox = boundingbox();
move(<0,-bbox[1].y,0>);

(I make no guarantees that any of this will actually work).
I've found it's often better to the Lightwave handle any heavy lifting (like translating 26K points), instead of lScript.


Thanks for the pointers Kryslin :)
Here you go guys, its RestOnGroundY and RestOnGroundYCenter

jeric_synergy
09-04-2016, 04:21 PM
Thanks for the pointers Kryslin :)
Here you go guys, its RestOnGroundY and RestOnGroundYCenter
Was it faster?

gamedesign1
09-04-2016, 04:27 PM
Was it faster?

Yep, loads! :)

Kryslin
09-04-2016, 04:50 PM
Glad to have helped.

squarewulf
09-06-2016, 12:04 PM
Lightwave already has this functionality though, just hit F3.

cove
09-06-2016, 02:04 PM
Thanks Cove. To be honest I hadn't tested it on really complex objects. How many polygons roughly?

I just did a test with 24,000 polygons and it took about 5 seconds. So I will try and streamline it :)

Here is the image i could not post in private message showing motorbike used [Harley] to test first and latest
version of your simple but effective plugin.

gamedesign1
09-06-2016, 03:07 PM
Here is the image i could not post in private message showing motorbike used [Harley] to test first and latest
version of your simple but effective plugin.

That's great thanks for doing a test on it.