Jump to content

Max script needed - draw spline beween 2 dummies


erniesbot
 Share

Recommended Posts

Hi Chaps,

 

I am working on a project that requires the creation of hundreds of pylon towers, and am looking for a efficient method of linking wires between them.

 

This may be asking a bit much but ideally i want a script that:

 

Can draw a spline between 2 selected dummies, create a vertex in the centre of the spline and drop that vertex down in the Z axis by an amount based upon the distance beween to 2 points. So quite a lot really :)

 

Can anyone point me in the direction of a similar script, or one i may be able to modify to suit requirments?

 

Many thanks.

Link to comment
Share on other sites

Found it!

http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm

this is a collection of scripts by Neil Blevins

 

the one u need to use is called wirebundler i have just tested it and it works exactly how u want but it only worked on mesh objects and not dummy's so you need to attach a small sphere or box to your towers.

it dose kind of make the wires look a bit heavy and pulled down but not perfectly.

to achieve what you want you need to add another dummy object at a fixed distance from the main tower and have it at a lower Z (height) value, then copy your towers or array them so you will have this 3rd dummy object hanging in between every 2 towers and when you run the script the wire will have to go through this 3rd dummy and up again.

that should do the trick i think.

Link to comment
Share on other sites

This script is simple and does not provide an interface.

 

It creates a line in-between two objects with the mid point Z value being what ever you specify, (distance from mid point or a percentage of the distance). You can select two or many objects. be sure to select them in the correct order if you are selecting more than two.

 

Instructions are in the readme.txt file.

Link to comment
Share on other sites

Molson, Thanks again for the awesome script.

 

Just trying to figure out how to ajust the z value of the midpoint. Which script is it that I edit?

 

I have tried to edit both but get an error message "--Unknown property: "newSplineBetweenPoints" in indefined".?

 

Sorry but im an absolute scripting noob!

 

Cheers

Link to comment
Share on other sites

oops

forgot to add one thing

-right click the button and select "edit macro script"

 

add the following:

global molsonToolsfn

 

so that the macro script looks like this:

 

macroScript molsonToolsSplineBetweenObjects category:"Molson" buttontext:"SMid" tooltip:"Spline between objects"

(

global molsonToolsfn

molsonToolsfn.newSplineBetweenPoints middleZPercentage:25 middleZDist:0 lineNamePrefix:"lineBetween"

)

 

that should work

Link to comment
Share on other sites

Attached is the latest version. This one will work with any object type.

and the

"--Unknown property: "newSplineBetweenPoints" in indefined

error has been fixed.

 

if you have anymore errors, feel free to email me at:

molson (at) ice-edge.com

 

Thanks,

 

Mark

Link to comment
Share on other sites

Attached is a newer version.

This version includes a GUI so that you can change the properties much easier.

- Unzip the zip file into the root of Max

- Start Max

- Go to Customize>Customize user interface…

- Drag "Spline between objects UI" onto your toolbar

- Use that new button, ("SMidUI") from now on

 

I kept the old button, ("SMid") just in case you wanted to have a quick button and didn't want the UI.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...