PDA

View Full Version : Free LScript Pack: Coord Tools - No more writing down coord values!



Matt
01-27-2010, 08:55 PM
Hi all

I've updated my 'Mirror Stored Pack' to include more useful tools that are "stored coordinate aware" (Download at bottom of this post).

This pack is now called 'Coord Tools' as it's not just mirroring anymore. It now includes the following scripts, all of which work with the principle of storing the bounding box centre of any selection, be it a single point, edge, poly face or the whole object:


Store_XYZ_Coords.ls - Globally store any selections bounding box centre
Reset_XYZ_Coords.ls - Reset global coord to 0,0,0
Mirror_Stored_X.ls - Fast Mirror across X of global stored coord
Mirror_Stored_Y.ls - Fast Mirror across Y of global stored coord
Mirror_Stored_Z.ls - Fast Mirror across Z of global stored coord
Mirror_Stored_UI.ls - Mirror across global stored coord with options
Move_Stored.ls - Fast Move to global stored coord (first point on geometry as datum)
Moved_Stored_UI.ls - Move to global stored coord with options
Radial_Stored_UI.ls - Radially array using global stored coord for centre
Rotate_Stored.ls - Rotate using global stored coord for centre


Also included is a menu branch (as seen in screenshot) to make it easy for you to import into your config.

Here's a mini video tutorial showing it in action:

QT H.264 (38MB Zipped)
Coord_Tools_Pack_v1.0_Video_Tutorial.zip (http://www.pixsim.co.uk/LW_Scripts/Coord_Tools_Pack_v1.0_Video_Tutorial.zip)

http://www.pixsim.co.uk/LW_Scripts/gfx/Coord_Tool_Pack_v1.0.png

If anyone wants to make their own scripts work with this globally stored coord, use the following code to grab the values:


stored_x = number(globalrecall("stored_x", 0));
stored_y = number(globalrecall("stored_y", 0));
stored_z = number(globalrecall("stored_z", 0));
The '0' can be replaced with any default value you wish if the 'stored_x', 'stored_y', 'stored_z' variables are not present.

Hope you find them useful!

Cheers
Matt

wayne1 huffman
01-27-2010, 09:24 PM
Sweet! Thanks Matt- what versions will this work with?

Matt
01-27-2010, 09:32 PM
Sweet! Thanks Matt- what versions will this work with?

Oh now you're asking! :)

I guess the only pre-requsite for this to work is the LScript version that brought in the globalstore() and recall() functions. Have no idea when they came in. I have put version 2.3 of LScript in the scripts, but I really should go and check, because that might be higher than needed.

I guess the easiest thing to do is to try it and see if any errors are thrown up!

I don't see why it wouldn't work on versions lower than 9.x. They are LScripts, so are platform independant also.

OFF
01-27-2010, 09:43 PM
great tools! :)

Riff_Masteroff
01-27-2010, 10:13 PM
Thanks Matt. I just installed and interfaced them. They very well might be quite useful to me . . . have some detailed modeling work to do right now.

probiner
01-28-2010, 02:57 AM
Thanks matt, for sharing. You just answered to this post (http://www.newtek.com/forums/showthread.php?t=105455) in some extent =)

Cheers

Matt
01-28-2010, 03:02 AM
Thanks matt, for sharing. You just answered to this post (http://www.newtek.com/forums/showthread.php?t=105455) in some extent =)

Seems you and I share the pain of writing down coordinates for stuff!

It agree with your post though, not only for numeric entry but copy / pasting too (which these scripts) go some way to solve.

I know it's bad form to plug your own stuff, but I do find these incredibly speedy and useful, and I've found myself using them in allsorts of ways I never intended!

:)

npix
01-28-2010, 05:25 AM
Much appreciated Thanks!

Lewis
01-28-2010, 06:29 AM
This is fantastic tool, something twat LW should have/get years, years ago, I've often wished i could copy/paste X,Y,Z values of POINT info before starting Radial array or mirror tool for many projects but i had to write them down manually on paper/notepad or copy/paste one by one while activating/deactivating array tool (undo after every try).

Thanks Matt this will help more in everyday modeling sessions :).

zarti
01-28-2010, 06:52 AM
small, but tremendously useful ... even for those who have lwcad. thank you Matt! =)

Matt
01-28-2010, 07:06 AM
Thanks guys!

There does seem to be some oddness happening with the Rotate_Stored.ls script.

Currently it does this:

undogroupbegin(); // Group all changes under one undo


Do rotation stuff

undogroupend();

Sometimes it works, sometimes not. Could be the way I've done it, or undogroup functions are bust, not sure.

Lewis
01-28-2010, 07:18 AM
But array and move works fine with using only one UNDO/step.

Matt
01-28-2010, 07:18 AM
Make a requested change to the 'Radial_Stored.ls' script.

Instead of saying '# or Copies' in the UI, it now says 'Total', which makes more sense.

When you download the attached script, remove the '.txt' from the filename (needed to be able to upload without Zipping it).

Then replace over the old one.

Matt
01-28-2010, 07:22 AM
But array and move works fine with using only one UNDO/step.

They work differently because they fire their functions once, the Rotate_Stored.ls one is firing the Rotate command however many times you change it.

I need to look into it, I'm sure it's possible.

Gregg "T.Rex"
01-28-2010, 07:18 PM
Damn, Matt...
This is soooo sweet!
Thanks!

biliousfrog
01-29-2010, 02:22 AM
Do these work, or would it be possible to create something that works, in Layout?

Lewis
01-29-2010, 03:02 AM
Do these work, or would it be possible to create something that works, in Layout?

Best thing for arraying/cloning in layout for me is LOCO plugin from Kevin MacPhail. Sadly is 32bit only :(.

http://www.kevinmacphail.com/resources/pixelpot.html

Matt
01-29-2010, 03:19 AM
Do these work, or would it be possible to create something that works, in Layout?

I'll look into this (obviously would be limited only to item selection) and I'm not sure if you can interrogate the bounding box of an item in Layout.

Lewis
01-29-2010, 03:30 AM
I'll look into this (obviously would be limited only to item selection) and I'm not sure if you can interrogate the bounding box of an item in Layout.

This LOCO plugin works great with null objects so basically you position null object where you want and use radial array around It or any other object in scene but since Null can be just CROSS it has center same as one point :). So you could think about making nulls on mouse click (at desired position) or such thing if is doable :).

biliousfrog
01-29-2010, 05:36 AM
I just watched the video and have a better grasp on what the scripts do, very useful.

With regards to the Layout question I was thinking more along the lines of purely copying and pasting the position, rotation and scale from one object to another without doing each co-ordinate manually. I usually turn off parent in place, parent the object to the one I want to copy co-ordinates from, turn on parent in place and un-parent.

There might be something that already does that which I've missed.

archijam
01-29-2010, 07:33 AM
Pfft .. who writes down coordinates?

I make screen captures :P

This does indeed look awesome. This is something CORE could directly imitate - copying and pasting xyz and HPB info on the fly.

Nice!

digefxgrp
01-30-2010, 08:48 PM
Matt-

Unfortunately it looks like Radial_Array_Stored has a problem. The script is randomly stacking duplicate geometry amongst the clones. Iíve attached an image to help show whatís happening. The original disc is a single 24pt polygon.

Merging Points and Unifying Polys fixes things but Iím guessing this isnít a hidden ďbonus featureĒ of the script. :D

Seems like I came across this issue with one of the early Pictrix scripts from eons ago.

Matt
01-31-2010, 08:15 AM
Matt-

Unfortunately it looks like Radial_Array_Stored has a problem. The script is randomly stacking duplicate geometry amongst the clones. Iíve attached an image to help show whatís happening. The original disc is a single 24pt polygon.

Merging Points and Unifying Polys fixes things but Iím guessing this isnít a hidden ďbonus featureĒ of the script. :D

Seems like I came across this issue with one of the early Pictrix scripts from eons ago.

That's odd, I just tried it here and got what you had.

Changed the code from:


radial_angle = number( 360 / copies );

for(LOOP = 1;LOOP < copies;++LOOP)
{
copy();
rotate( radial_angle, selected_axis, radial_centre );
paste();
}

To: (as it is in the Radial_Array.ls script that ships with LW)


radial_angle = number( 360 / copies );
copy();
for(LOOP = 1;LOOP < copies;++LOOP)
{
rotate( radial_angle, selected_axis, radial_centre );
paste();
}

But that just does copies on top of each other.

So I changed it back again to what I had before. Then it seemed to work, tried multiple times, all was fine.

Very odd.

selkit
01-31-2010, 09:34 AM
Hey Matt.
So simple and so usefull script. should be sticky !
Thanks you very much.

omichon
02-02-2010, 01:37 AM
Very handy, and will save some trees ;)
Thanks Matt !

For those looking for a way to copy/paste coords in Layout, there is "Vector Copy & Paste" from Dstorm (Win32/64 and MacPPC)
http://www.dstorm.co.jp/english/plugin/layout.htm#VectorCopy

loriswave
02-02-2010, 02:06 AM
For those looking for a way to copy/paste coords in Layout if you want try other my Script ALP Animation Tool copy and paste coords in layout, also paste x,y,z separatly and have option for world or local calculate.

Matt
05-30-2010, 07:05 AM
Okay, I finally figured out why sometimes the Radial Array part of this pack duplicated geometry and sometimes did not.

I would test it in the way it was intended to be used, i.e. store coord centre, select geometry to array, run plugin.

Using it this way never revealed the incredibly obvious, can't see the wood for the trees problem that would occur when you run it _without_ selecting some geometry!

The script basically does:

loop until number of copies

copy (assumes something would be selected, but never checked)

rotate

paste
end loop

Which basically meant if you ran it with _nothing_ selected then it would copy the copies for each step!!!

DOH!

It now checks to make sure you definately have something selected to avoid this!

Apologies for any issues this may have caused!

sampei
05-30-2010, 07:17 AM
wow cool ! grazie mille ;)

Lewis
05-30-2010, 08:18 AM
Thanks Matt, nice update :).

JohnMarchant
05-30-2010, 08:33 AM
As usual Matt your a (Mon)Star :):):)

MentalFish
05-31-2010, 12:27 PM
Cool script Matt, thanks for the live-demo of it :)

3dworks
05-31-2010, 12:53 PM
many :thumbsup:

markus

kojean
05-31-2010, 09:05 PM
Thanks for the update.

Riff_Masteroff
05-31-2010, 09:12 PM
and Matt, thanks again. It has been quite valuable to me in use.

Matt
06-01-2010, 02:25 AM
Good to know others find these as useful as I do, I use them all the time! Look at me, plugging myself, shameless!

:D

Matt
06-01-2010, 09:10 AM
Another update, sorry, I know it's a pain updating scripts, especially if you have multiple LW versions installed!

Added the ability to array and keep the orientation of the original object. Could be useful to some. Also added a few checks in there for things, nothing major.

Cheers
Matt

omichon
06-01-2010, 09:29 AM
Updates with improved functionalities are always welcome :)
Thanks Matt !

JohnMarchant
06-01-2010, 09:32 AM
Thanks Matt :):)

daforum
06-01-2010, 05:50 PM
Thanks Matt!

nickdigital
06-01-2010, 06:37 PM
Very impressive script(s). Thanks for sharing.

How do you import the cfg file? Do I just copy/paste those lines into my Modeler cfg file?

MUCUS
06-02-2010, 01:21 AM
Thank you so much Matt, the "select, open info panel, copy/paste" method was really a pain, excellent work!:thumbsup:

Matt
06-02-2010, 03:46 AM
Very impressive script(s). Thanks for sharing.

How do you import the cfg file? Do I just copy/paste those lines into my Modeler cfg file?

No it's a menu Branch.

Configure your menus, right click on the tab you want the buttons to appear in, then choose 'Import Branch'. The buttons should then appear in that menu.

Matt
06-02-2010, 03:48 AM
Can I ask which other LightWave tools would be useful to work with stored coordinates?

If they are available to LScript and not beyond my capability, I'll add them in.

nickdigital
06-02-2010, 01:28 PM
No it's a menu Branch.

Configure your menus, right click on the tab you want the buttons to appear in, then choose 'Import Branch'. The buttons should then appear in that menu.

Ah got it to work...thx!

Matt
07-05-2010, 12:38 PM
Hi all

I've included my 'Measure_Points.ls' script which I never really saw much need to give away before, but now I've updated it to work in conjunction with the 'Move_Stored_UI.ls' part of this pack it might be worth it.

What it allows you to do is measure the distance between points (uses the first and last of any selection) it then displays the shortest distance (XYZ) but also the difference in just the X, Y or Z axis.

You can then store any of those distances for use with the 'Move_Stored_UI.ls' script.

This makes it perfect for accurate alignment where snapping tools can be cumbersome.

Here's a video to show it in action.

13.7MB QT H.264
Coord Tools Measure Update Video (http://www.pixsim.co.uk/LW_Scripts/Coord_Tools_Measure_Update.zip)

The update can be downloaded from here:

http://www.pixsim.co.uk/lightwave_lscripts.html

Hope you find it as useful as I do!

Cheers
Matt

Lewis
07-05-2010, 01:41 PM
Nice work (as always) Matt. It's really handy tool and it's visible that you also model in LW modeler and know it's shortcomings :).

cheers

Matt
07-05-2010, 03:45 PM
Nice work (as always) Matt. It's really handy tool and it's visible that you also model in LW modeler and know it's shortcomings :).

cheers

Thanks Lewis!

Cloak&Dagger
01-02-2011, 04:42 PM
Realise i am late to the party on this one but just wanted to say thanks Matt!

Been using these extremely useful tools today for an extended period and they have saved me bags of time.

Matt
01-02-2011, 06:00 PM
Realise i am late to the party on this one but just wanted to say thanks Matt!

Been using these extremely useful tools today for an extended period and they have saved me bags of time.

Thanks! Glad you found them useful! :)

Danner
02-21-2012, 10:39 AM
Matt. I started incorporating this into my workflow and I quite like this little gems. I just have one "small" request if you can find the time. Could you do a move x, move y move y ? (no UI) those are the ones I would use most to snap things into place. The way I imagine working with this is selecting destination, hitting the store coordinates shorcut, select points/polys/lines I want to move and then hit the move x shortcut. A very quick way to snap points to vertical lines for example.

Matt
02-22-2012, 01:34 AM
Matt. I started incorporating this into my workflow and I quite like this little gems. I just have one "small" request if you can find the time. Could you do a move x, move y move y ? (no UI) those are the ones I would use most to snap things into place. The way I imagine working with this is selecting destination, hitting the store coordinates shorcut, select points/polys/lines I want to move and then hit the move x shortcut. A very quick way to snap points to vertical lines for example.

Great idea, I'll get right on it for you!

I also updated one of my scripts to make moving stuff based on stored coords more intuitive, I'll include that too.

Matt
02-22-2012, 02:22 AM
Just so you have them quickly (will add to the main pack later) here are the scripts:

Move_X
Move_Y
Move_Z

Usage:

Store your target coord as normal using the Store_XYZ.ls script.

Select some points (only works on point selections at the moment).

Run whichever Move script you need.


Those points will be moved in that axis only.

Danner
02-22-2012, 07:02 AM
Excellent!
Thanx Matt, you are a bright star in the Lightwave universe.

Matt
02-23-2012, 07:51 AM
Excellent!
Thanx Matt, you are a bright star in the Lightwave universe.

Why, thank you Sir! :)