Anim8or Community

General Category => ASL Scripts => Topic started by: DoctorStopMo on December 22, 2007, 03:01:19 pm

Title: Script Request: Chain Link Maker
Post by: DoctorStopMo on December 22, 2007, 03:01:19 pm
I don't know how feasible this idea is, but I'm just going to throw it out there and hope that there's a script writer that's talented enough to fulfill it.  I'd like a tool where I could draw out a path (not quite like a spline, because I'd like to be able to easily manipulate the points in 3D space, sort of like with the Add Points tool) and then import a chain link object.  The script would take my chain link and create a chain from it along the designated path, alternately rotating the links so that they're at 90 degrees to each other.  It would make building chains (see below) a lot easier:

(http://doctorstopmo.250free.com/OrcWarriorGood1.jpg)

Anyone think they can manage it?
Title: Re: Script Request: Chain Link Maker
Post by: headwax on December 22, 2007, 03:39:30 pm
Wow

So you made this model!

Yowza, that's amazing work.

Sorry I can't write scripts.....
Title: Re: Script Request: Chain Link Maker
Post by: sciwizeh on January 03, 2008, 09:06:48 pm
wow that model is awesome

i don't think what you are requesting is possible, not with anim8ors capabilities, i doubt even a pov-ray macro can (don't hold me to that one, there may be one for pov-ray) but in anim8or, no.

sorry, but awesome model!
Title: Re: Script Request: Chain Link Maker
Post by: bluescreenboy on January 26, 2008, 12:05:50 pm
That must of taken a long time to model.  Sorry, though, I can't write ASL for beans
Title: Re: Script Request: Chain Link Maker
Post by: BOB_I_Ts on January 28, 2008, 12:11:36 am
Its possible to make alignment script that align and possibly orientate "separate" meshs along bezier curve spline/path ,I think Llyr Carter write a script that generate loft mesh from splines ! ,each mesh would have to have unique name for script to kno which to align !.
Title: Re: Script Request: Chain Link Maker
Post by: Aarangend on March 23, 2008, 11:48:35 pm
Two words:
Holy crap.
That looks amazing!!!! Man how did you do that? and how long did it take?  I am really new and I want to build something just like that.  Man I am like drooling!
Oh yeah and I can't help you on the script... sorry.
Title: Re: Script Request: Chain Link Maker
Post by: Steve on June 06, 2008, 01:23:44 am
DoctorStopMo, check out the split functions added in v0.97b  and the script example on the scripts page.  You should be able to make some great chains with these!
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 09, 2008, 08:07:35 pm
Attached below is a script to create chains that follow splines. [Thank you Steve for spline-following ASL ability!].

The script basically creates torii alternating at right angles along the spline.  The parameters of the torii can be changed: the size, width, number of sides, number of segments per torii.  The script currently makes each link a separate mesh to allow easier edits (easily changed if desired).  This editing ability comes in handy if the spline turns more rapidly than the diameter of the link.

Try it out.

Let me know if you have any questions.
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 09, 2008, 08:21:15 pm
Fabulous script there NickE!
I have one criticism for you and a request.
Crit:  Every alternating chain link that is created has flipped normals.  Can you fix this?
Request.  Would it be possible to create oblong chain links as well?  Perhaps some kind of option would be available? (that would be awesome)
What you've done already is awesome, so great job.

Edit:
Another thing I noticed is that the script doesn't seem to take into account the thickness or hole size when creating the chain.  So if you create different widths of chains, the chains intersect.  It would be nice if the script did its best to make the chains go through one another.  It wont be possible all the time with certain settings of course, but say the hole were too small for the chain to go through, it would just do the best it could perhaps having it go straight through the center.
Once again, fabulous job so far.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 09, 2008, 09:02:43 pm
Good catch on the flipped normals, Hihosilver.  The fixed script is attached.  Oblong links will take a little longer since that shape cannot be explicitly described by a parametric equation like a torus.  I'll see what I can do.
Title: Re: Script Request: Chain Link Maker
Post by: karate5662 on June 09, 2008, 09:13:48 pm
perhaps you could make the link, stretch it, and then rotate it and place it on the spline.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 09, 2008, 11:08:15 pm
I have fixed the link spacing error.  Read the comments in the script for hints on proper relationships between link thickness and link diameter.

I am still working on how to make an oblong link.
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 10, 2008, 01:54:35 am
You've done a fabulous job!  This is really fabulous.  Keep it up!
Title: Re: Script Request: Chain Link Maker
Post by: Tanzim on June 10, 2008, 02:45:36 am
Um, I think I found another problem:
Title: Re: Script Request: Chain Link Maker
Post by: kreator on June 10, 2008, 04:42:27 am
Thanks Nicke For that fab Script,,, another great way of saving time when modelling!
Tanzim: I think you should try the latest script
Title: Re: Script Request: Chain Link Maker
Post by: Tanzim on June 10, 2008, 09:18:57 am
That was the latest script (chain_maker_3)
But I'll try again.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 10, 2008, 09:27:12 am
Tanzim (and everyone),

The script will only work in the latest version: 0.97b.  Steve added that functionality to that version.  It will not work in any earlier version.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 10, 2008, 12:44:34 pm
Attached is the latest version of chain_maker.  It now has functionality for elongated chains in the $stretch parameter.  If the $stretch parameter is set to zero, you will get the round links.

Please post questions and comments.
Title: Re: Script Request: Chain Link Maker
Post by: spicy on June 10, 2008, 01:39:40 pm
Cool script there NickE!
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 10, 2008, 06:39:11 pm
Attached is yet another version of chain_maker.  This one fixes the flipped normals problem of version 4 posted earlier today.
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 11, 2008, 03:48:14 am
Thanks NickE!  Here's a render with your script (I rotated a few links after to make it more natural.)
(http://img365.imageshack.us/img365/7787/chaintestfh5.jpg)
Title: Re: Script Request: Chain Link Maker
Post by: spicy on June 11, 2008, 01:27:08 pm
Cool chains guys, hiho where did you get your chain texture from?
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 11, 2008, 07:39:16 pm
Spicy:  I made the chain texture myself.  Though you can download it from this thread:  http://anim8or.org/forums/index.php/topic,675.0.html (http://anim8or.org/forums/index.php/topic,675.0.html)

NickE:  There was another request from anim8or.org that I completely agree with if it isn't too much trouble:
It would be nice to have a pop-up box that asks for options like a parametric shape, nonetheless, kudos to NickE, for a great script.

Then we could have options as in a parametric script to fill in that we could see update instead of guessing and checking using the script.  It would be awesome, but if it's not possible no worries because you've done great already!
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 12, 2008, 01:27:53 pm
I have adapted the chain_maker.txt script to be a parametric plugin script.  There are some issues, though.  I am going to do another post with questions about scripts to try to resolve these issues.

It seems that parametric plugin scripts have a couple of "features" that make using the chain_maker parametric plugin a little more challenging:

To activate a plugin, you select the icon, then click or click-drag in the editor window.  This, in effect, does two things:
1) De-selects anything you have previously selected (this makes sense, since the script is creating a new shape that is automatically selected)
2) Sets the origin point of the parametric shape created by the script (also makes sense, since most of the parametric shape scripts use a drag sizing method)

The chain_maker parametric script can work around (1), but you have to rename the path you want to follow so that it is pre-pended with the word "chain".  For example: rename "path02" to "chainpath02".  Click on the "chain path" icon, then click anywhere in the editor window.  The chain that is created will follow the path, but be offset to whereever you clicked.  You will have to manually move it back into position.  I designed the icon to help you remember that you have to rename the path you want to follow.  I toyed with the idea of having the script rename the path back to just "pathXX" after creating the chain, but decided against it.

Another issue is that the created parametric object is a single shape.  Even if you have multiple paths all renamed chainpathXX, the chains created will all be one shape, even though they follow different paths.  To do the inevitable tweaking of a few links that do not turn the corners properly, you must convert the parametric shape to a mesh.  You can then access individual links by going to point editor mode, using the face selector to select a face of the link you want to adjust.  Use "G" to "grow" the selection to the full link.  Then use "t" to select the edges.  You can now move, rotate, delete, etc. that individual link.  Whew!

The upside to having a parametric script, though, is that you can immediately see the results of tweaking the parameters and get that chain looking just as you like it.

So, it is do-able, just less than convenient and intuitive.  Also, you can use the parametric plugin version to find the parameters you like best for your application and then edit the other version to reflect those parameters.

Please let me know what you think.
Title: Re: Script Request: Chain Link Maker
Post by: karate5662 on June 12, 2008, 03:34:49 pm
it works quite well, nice work.

I found that to make a single link part of another mesh, you can select a single face on that particular link, then you can use Shift+G to grow the selection to the full link. tho make it a seperate mesh, you can Shift+G.
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 12, 2008, 09:28:51 pm
karate:  you can simply press 'c' instead of pressing "shift + g" repeatedly.
Title: Re: Script Request: Chain Link Maker
Post by: karate5662 on June 12, 2008, 10:17:18 pm
I just copied what he had in the post above mine.
Title: Re: Script Request: Chain Link Maker
Post by: Steve on June 13, 2008, 03:06:14 am
Nice chains, guys!  NickE, mind if I post the script on the Anim8or scripts page?  Anh hihosilver, can I use your render?
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 13, 2008, 09:09:29 am
Steve,

I'd be honored.  Thank you.
Title: Re: Script Request: Chain Link Maker
Post by: 3Dgeek11 on June 13, 2008, 10:34:16 am
hey, I was wondering one little question about scripts:

Are you allowed to use scripts made by people like NickE and other people in commercial work? just wondering.

Great work, NickE!

Great render, hihosilver. how'd you get the shadow?
Title: Re: Script Request: Chain Link Maker
Post by: RudySchneider on June 13, 2008, 11:17:04 am
hey, I was wondering one little question about scripts:

Are you allowed to use scripts made by people like NickE and other people in commercial work? just wondering.

Why wouldn't you?  A script is just a tool, an extension of the tool set that's already inherent in Anim8or.  Besides, that's exactly why folks create scripts in the first place --- to make certain tasks a bit easier!
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 13, 2008, 06:44:30 pm
Attached are the new versions of the scripts.  The only change is the provision to have alternating links of different sizes.

There is a the parametric version and a command version.  They work the same as described earlier in this thread.

Enjoy!
Title: Re: Script Request: Chain Link Maker
Post by: hihosilver on June 14, 2008, 04:42:52 am
I would be honored as well Steve!
Title: Re: Script Request: Chain Link Maker
Post by: 3Dgeek11 on June 14, 2008, 04:03:01 pm
Thanks, RudySchneider. :D
Title: Re: Script Request: Chain Link Maker
Post by: Steve on June 14, 2008, 06:15:36 pm
OK it's posted.  Check it out!
Title: Re: Script Request: Chain Link Maker
Post by: siragin on June 18, 2008, 01:38:34 pm
I have a wierd question. with the new chain link maker, wouldn't you be able to make hair easier. if you are just connecting a mesh along a spline, you just draw simple lines alone the characters head and use the script to connect the hair mesh. Other programs do that.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 19, 2008, 12:26:31 am
Siragin,
If you look at the topic about copy along a spline, there is a script that copies a generic mesh along a spline.  That would work for the hair application you are talking about.  My next script will probably be to simulate the functionality of the grassgen program that copies a generic mesh at the points of a second mesh with parameters for the number of copies per point, their scaling, and orientation.
Title: Re: Script Request: Chain Link Maker
Post by: Steve on June 19, 2008, 02:14:49 am
3Dgeek11 - I missed your quetion.  As far as I'm concerned you can use anything and everything related to Anim8or in commercial works.  I don't put any restrictions on how you can use Anim8or or what you make with it.  However if you use somebody elses work you need their permission.  That said, if they post it on the web and don't explicitly put restrictions on it (for scripts, look at them in a text editor) then the same rule would apply I would think.  If in doubt, ask.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 19, 2008, 11:10:29 pm
Any script I post here is in the public domain.  It is not copyrighted or restricted in any way.  I do it because I love it and appreciate the opportunities and community that Steve has created with his very hard work.

If you have other script requests or ideas, I am happy to give it a try.

Steve, if you ever want help in developing the ASL (or any other part of Anim8or), I would love to help.
Title: Re: Script Request: Chain Link Maker
Post by: csf on June 20, 2008, 02:20:53 am
Thanks for all the great scripts. If your looking for a script to do what about a script that would extrude a cylinder with x diameter and y divisions along a path. I know there is the shape tool that makes the 2D shape to extrude but most of the time I don't find that accurate enough for what I want to do.
Title: Re: Script Request: Chain Link Maker
Post by: NickE on June 20, 2008, 01:26:18 pm
csf,

Attached is the requested script.  I have simply converted Steve's spline.txt script to a parametric script.  It creates a tube along a spline that must be named "tubepath".  You can adjust the number of sides, the diameter, and the number of divisions.

*** Remember to convert the parametric shape to a mesh before using it
      in any other objects, in figures, or scenes.  It is totally dependent
      on the original "tubepath" spline while it remains
      a parametric shape.  As Steve stated: parametric scripts were never
      intended to work this way. ***
Title: Re: Script Request: Chain Link Maker
Post by: csf on June 21, 2008, 05:37:01 pm
Thanks for the script that was fast. I have some cool ideas for all these spline scripts I will post some pics once there done.
Title: Re: Script Request: Chain Link Maker
Post by: 3Dgeek11 on June 24, 2008, 06:50:22 am
okay, sorry, but I can't figure out how to use the chain script? I made a path, then clicked the tool, and click the path? is that right? I can't figure it out, Thanks for any help. :)
Title: Re: Script Request: Chain Link Maker
Post by: karate5662 on June 24, 2008, 09:04:04 am
make a path and rename it "tubepath"
the do what you would normally do for a basic shape. you have to rename the path.
Title: Re: Script Request: Chain Link Maker
Post by: 3Dgeek11 on June 24, 2008, 10:37:16 pm
no, I'm talking about the "Chain" script. ;) unless that's what you meant..?

sorry, I should shut up and look in the topic and see his directions.
Title: Re: Script Request: Chain Link Maker
Post by: DoctorStopMo on July 14, 2008, 02:35:56 am
Woohoo!  I've been waiting for this one for a long, long time :).  Special thanks to NickE et al. for making this dream a reality!

I am having a little trouble making it work, though.  I have the chainmaker a8s file in my scripts directory.  I tried renaming a spline that I created "chainpath," then clicked the Chain Path button on the left, then clicked back in the modeling window.  Nothing happened.  What am I doing wrong?  Any help would be much appreciated - and I can show you the old warrior the way he was meant to be :).
Title: Re: Script Request: Chain Link Maker
Post by: NickE on July 14, 2008, 10:05:40 am
Sometimes I get that behavior too.  After verifying that the script actually ran by looking at the debug window, you might have to drag a little bit instead of just clicking in the modeling window.  If you are still having problems, post your .an8 file, and I will take a look.
Title: Re: Script Request: Chain Link Maker
Post by: DoctorStopMo on July 15, 2008, 12:42:32 am
All I can say is...THANK YOU!

(http://doctorstopmo.250free.com/OrcWarriorChainsNew.JPG)
(http://doctorstopmo.250free.com/OrcWarriorChainsNew2.JPG)
Title: Re: Script Request: Chain Link Maker
Post by: howitzer on July 15, 2008, 01:57:52 pm
Oh wow, excellent work DSM!
Title: Re: Script Request: Chain Link Maker
Post by: Steve on July 18, 2008, 03:09:38 am
DSM, your request for some help with chains in the original post for this topic inspired me to add the spline functions to ASL.  It was more work than I though at first but I was hopeful that it would wind up useful.  I must say, I haven't been disappointed.  The scripts everyone is writing are pretty cool and your model is fantastic.  Keep up the good work, everybody!