PDA

View Full Version : Free LScript Pack: Mirror Stored v1.0



Matt
06-06-2007, 06:07 PM
This 'pack' consists of 5 Modeler scripts for aiding quick mirroring of selected geometry around the centre of previously stored coordinates.

I wrote these because I found myself constantly mirroring geometry on my models based around other parts of it, especially when I needed to mirror off the zero of any axis.

Previously I did this using another script I wrote that displayed the bounding box centre of any selection, I would then copy the centre coords of the axis I needed and feed it into the LightWave Mirror tool. Obviously this was a waste of time, and could easily be automated, hence these scripts!

Why not just use the LW mirror, or LWCAD mirror tools?

The native LightWave Mirror tool was no good to me in certain scenarios because:

- It doesn't have any snapping capability (for when you want to be very precise)
- It can be fiddley when the mirror centre is not on the zero of an axis
- You can only mirror in one axis at a time

LWCAD has a very good Mirror tool with snapping, but on large, or complex models it can be a little unresponsive at times and can require the need to zoom in to select the geometry to 'snap' around, while a very nice tool, sometimes it's just too involved for simple quick mirrors of geometry.

The advantages of these little scripts are:

- Simple to use
- Good for 'quick mirrors' off the zero of an axis
- Great for laying out regular geometry patterns by using other parts of your model to store mirror centres
- Remembers the mirror centre coordinates for repeated mirrors

They are not meant to be replacements for any other mirror tools, but complementary to them.

What's in the 'pack'?

The 'pack' consists of the following scripts (all fully commented in the source):

Store_XYZ_Coords.ls
Stores the bounding box X,Y,Z centre of any selected geometry (points, polys, edges)

Mirror_Stored_X.ls
Mirrors using the previously stored X axis centre (without dialog)

Mirror_Stored_Y.ls
Mirrors using the previously stored Y axis centre (without dialog)

Mirror_Stored_Z.ls
Mirrors using the previously stored Z axis centre (without dialog)

Mirror_Stored_XYZ_Dialog.ls
For mirrors in more than one axis, this script brings up a dialog box to allow the user to pick which axis to mirror, then mirrors using the previously stored axis centres. The UI displays the stored axis centres to the right of the axis toggles, these are for display only and can't be edited.

NOTE:
When using the 'Mirror_Stored_XYZ_Dialog.ls' script, every mirror axis selected uses one undo, as far as I can tell, there is no way around this using LScript.

Here's a quick movie showing how it can be useful for 'structured' projects like architecural or product design. Quick point, I realise in the movie, the first mirror I do would have been quicker to use the LW mirror tool on the Z axis, but I wanted to show how it could be used.

http://www.creactive-design.co.uk/temp/Mirror_Stored_Pack.mov

That's it! Hope you find them useful!

Regards
Matt Gorner

ShawnStovall
06-06-2007, 07:35 PM
Thanks!:thumbsup:

Matt
06-06-2007, 08:16 PM
Thanks guys!

Here's another little video which shows it in action a little better!

http://www.creactive-design.co.uk/temp/Mirror_Stored_Pack_2.mov

Matt
06-06-2007, 08:48 PM
Should be dead simple to do, especially as the array command in Modeler is an LScript I can modify!

Interestingly, looking at that Array script revealed there IS a way to group Modeler commands into ONE undo! So I've added that functionality!

Grab this small update:

Matt
06-06-2007, 08:55 PM
P.S. When you unpack the archive the folder says v1.0, it's not, it's v1.1, but this darn forum time limit to edit your posts is a royal PITA! And I can't change it!

Snosrap
06-06-2007, 09:04 PM
Hey Matt, These are great little plugs-Thanks!
Also I love your LW color scheme! Feel like sharing that as well? It's terrific, makes LW look a lot more professional.
Good job.

Snosrap

OFF
06-06-2007, 09:05 PM
Great tool!

Matt
06-06-2007, 11:22 PM
thats great, you know just after watching that I was thinking, this idea would be sweet extended to include radial array.
the ammount of times you want to radial array something round some point.
eg bolts round a wheel hub.

cheers

After some messing about and much frustration, I've managed to get it working.

Just need to do some tidying up, and then I'll post it.

In your example of a wheel, the only downside is that the wheel needs to be parallel to either the X, Y, Z axis, depending on which you use, otherwise it will be out of alignment if you had the wheels at say a 45 degree angle. If I could figure out how to radial array around a polygons normal vector I'd be quids in! I'm sure it's possible, but I ain't that good at coding, or maths!

Here's a video of it in action:

http://www.creactive-design.co.uk/temp/Radial_Array_Stored.mov

Matt
06-06-2007, 11:33 PM
Hey Matt, These are great little plugs-Thanks!
Also I love your LW color scheme! Feel like sharing that as well? It's terrific, makes LW look a lot more professional.
Good job.

Snosrap

Sure, no problem! Instructions in the ZIP file.

titane357
06-07-2007, 12:08 AM
eh Mat it is Lscript ? I'm going to be ugly with NT !!! WHAT ARE THEY DOING ALL DAY LONG ? bucket render ?(ahah)

Thanks Matt !! :-)

Matt
06-07-2007, 12:41 AM
Yes there're just lscripts, but because they don't do much calculations, just invoke some modeler commands, they're fast enough.

Matt
06-07-2007, 12:50 AM
I've done it already! Just need to sort the interface out a little and comment the code for other people to check out.

Here's the video:
http://www.creactive-design.co.uk/temp/Radial_Array_Stored.mov

wavk
06-07-2007, 05:27 AM
so , the radial one is not in the 1.1pack right?

thanks for the tools!
nice!

mlon

Matt
06-07-2007, 06:08 AM
Not yet, will post update sharpish!

Matt
06-07-2007, 04:02 PM
Okay, I've added the Radial Array tool to this pack.

Had a right issue tracking down bugs in the 'Radial_Array.ls' script (the one that comes with LightWave - not the built in function, the LScript) which I was using as a reference.

In fact, it's a total pile, it doesn't respect selections, and it doesn't even radially array correctly!!!!! (The rotation increment was declared as an Integer which bawked with certain numbers, and hung LW with large duplication copies, I just changed it to a 'Number' variable).

See below.

The new pack is attached below, the other scripts haven't changed. As always, here's a video demo of it in action.

http://www.creactive-design.co.uk/temp/Radial_Array_Stored_XYZ.mov

Cheers
Matt

P.S. If anyone can come up with a better name for this pack, let me know! :D

Matt
06-07-2007, 04:54 PM
They probably didn't have the time to spend as much as I did on this lot! :) Still, that script pointed me in the right direction!

alifx
06-07-2007, 05:41 PM
Matt !
this script looks very good and handy
also it looks better than LW's orig tools.

thanks brother for this effort

Matt
06-07-2007, 06:03 PM
Hey Matt, These are great little plugs-Thanks!
Also I love your LW color scheme! Feel like sharing that as well? It's terrific, makes LW look a lot more professional.
Good job.

Snosrap

O.T. Forgot to mention, if you're on Windows XP go and grab the Zune Theme from Microsoft, gives you a much slicker, darker colour scheme. Better looking than the Blue, Olive Green and Silver ones IMO. Looks good with the colours I chose for my LightWave scheme.

The download is at the bottom right of this page:

http://www.zune.net/en-us/meetzune/software.htm

http://www.zune.net/NR/rdonlyres/2D2D5ACA-822B-492A-A2AC-7A56BFEE6B0A/0/325x231zunetheme.jpg

mikadit
06-07-2007, 07:08 PM
Thank you, those scripts will be useful to me. I'll test soon.

zapper1998
06-07-2007, 08:09 PM
O.T. Forgot to mention, if you're on Windows XP go and grab the Zune Theme from Microsoft, gives you a much slicker, darker color scheme. Better looking than the Blue, Olive Green and Silver ones IMO. Looks good with the colors I chose for my LightWave scheme.



Darn I have Win 2003 Server Pro not XP, Darn need to upgrade....
Thanks for the LScripts

Michael

Snosrap
06-07-2007, 08:20 PM
O.T. Forgot to mention, if you're on Windows XP go and grab the Zune Theme from Microsoft, gives you a much slicker, darker colour scheme. Better looking than the Blue, Olive Green and Silver ones IMO. Looks good with the colours I chose for my LightWave scheme.



Thanks Matt---Worked perfectly! NT needs to hire you to do their interface, you seem to have a good grasp of how to explain things as well - your instructions were spot on. Great plug by the way.

Thanks
Snosrap

dballesg
06-08-2007, 02:55 AM
O.T. Forgot to mention, if you're on Windows XP go and grab the Zune Theme from Microsoft, gives you a much slicker, darker colour scheme. Better looking than the Blue, Olive Green and Silver ones IMO. Looks good with the colours I chose for my LightWave scheme.

The download is at the bottom right of this page:

http://www.zune.net/en-us/meetzune/software.htm

http://www.zune.net/NR/rdonlyres/2D2D5ACA-822B-492A-A2AC-7A56BFEE6B0A/0/325x231zunetheme.jpg


Hi Matt,

Thanks for the scripts, really useful.

OT: Do you know if that theme works on XP 64 bits? I tried on my laptop, and even with the SP2 64 bits installed, doesn't recognize it and says that needs XP with SP2 :)

Best regards,
David

Matt
06-08-2007, 06:03 AM
Hi Matt,

Thanks for the scripts, really useful.

OT: Do you know if that theme works on XP 64 bits? I tried on my laptop, and even with the SP2 64 bits installed, doesn't recognize it and says that needs XP with SP2 :)

Best regards,
David

The theme will work on 64Bit Windows, they just didn't create an installer for it. Here are the files needed, read the folder names in the ZIP for instructions.

dballesg
06-08-2007, 06:38 AM
Hi,

Thanks a lot Matt! :)

Best regards,
David

Andyjaggy
06-09-2007, 09:42 PM
I like that theme, nice and dark and sleek. No need to upgrade to vista now :D