SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / createDynChain - MEL for creating semi-dynamic chains
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 11-03-2003, 04:54 PM   #1
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default createDynChain - MEL for creating semi-dynamic chains

Hello fellow MELlons :p

I started working on this mel script since I needed some long chains with many chain links on my Andrea Gail project. Regular dynamics were out of the question because they would have slowed down my work pretty badly.

The script has been coming along pretty nicely and I though I'd post it here for beta testing. Be aware that I've been working on this only for few days so it may contain some fundamental bugs

Here are some results I've got with the script:

1. http://kotisivu.mtv3.fi/karppa/temp/dynChain3.avi (600kB, divx)
- The backmost chain is a direct result of the script.
- The chain in the middle has only one modification done to it: turned the last "control cube" from passive rigid body to active.
- The frontmost chain is like the backmost but the last control cube has been hand-animated.

2. http://kotisivu.mtv3.fi/karppa/temp/dynChain4.avi (586kB, divx)
- This is a classic child swing. I created two chains, turned their end control cubes into active rigid bodies and hinge constrained the poly cube to them. I encountered one problem with the script while doing this: The script creates a gravity field for each chain. This really isn't necessary and I'll propably change this in future releases.

Anyway, here's the script. Open it up in a text editor, the documentation is there. Please read it through before asking questions.

Comments, bugs, critique, suggestions, anything is more than welcome...

(Attachment removed. Newer version can be found here: http://www.simplymaya.com/download_p...id=29&type=mel)
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!

Last edited by kbrown : 03-06-2003 at 10:13 PM.
kbrown is offline   Reply With Quote
Old 11-03-2003, 05:12 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Forgot to mention that this is not a script to take coding examples from . I still need to read the mel book i received yesterday. Many things are still unclear to me so I guess this is sort of a spaghetti-code-hack :p But it works
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 11-03-2003, 05:46 PM   #3
adldesigner
Registered User
 
adldesigner's Avatar
 
Join Date: Sep 2002
Location: CCS, Venezuela
Posts: 3,363
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Hehehe K-man, this is the part in which I fall apart. I know logic, but Iīve never been able to "unscramble" computer code. Iīll leave that for you guys.
__________________
adldesigner
Caracas, Venezuela
Hell .. not gone perse, but with a certainly lower post count per day.

adldesigner is offline   Reply With Quote
Old 11-03-2003, 06:57 PM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Hehe, thanks adl... I guess... :p

Anyway, I opened a page for this script on my site so you can find updates in one place and it's easier for me to maintain too...

Link in signature...
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 12-03-2003, 02:46 PM   #5
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Hmm... 2 downloads... Was this a waste of time?
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 12-03-2003, 03:21 PM   #6
adldesigner
Registered User
 
adldesigner's Avatar
 
Join Date: Sep 2002
Location: CCS, Venezuela
Posts: 3,363
Thanks: 0
Thanked 9 Times in 9 Posts
Default

I wouldnīt think so K-Man. Recognition doensīt come as fast as someone would expect ... but eventually it does. However if it does what it does as stated then itīs one hell of a script. <adldesigner resists the urge to reinstall Maya and try it out, goes for a beer in the kitchen instead>

<Holy sh*t! (after seeing the DIVX movies)>
__________________
adldesigner
Caracas, Venezuela
Hell .. not gone perse, but with a certainly lower post count per day.

adldesigner is offline   Reply With Quote
Old 20-03-2003, 07:00 PM   #7
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Lol... I forgot about this thread. I've updated the script (actually some time ago). Here's what I've done:

- Added a null (locator) for each chain with custom attribute connections to the essential chain behaviour attributes.
- A simple UI added
- No need to use straight curves any more
- Uses one gravity field for all chains created
- Added basic control on the amount of rings created per chain
- Added ability to use instanced chain rings (can be slower but uses less memory)

More info on my site and in the script file...

(Attachment removed. Newer version can be found here: http://www.simplymaya.com/download_p...id=29&type=mel)
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!

Last edited by kbrown : 03-06-2003 at 10:12 PM.
kbrown is offline   Reply With Quote
Old 16-04-2003, 01:36 PM   #8
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

It's definatley not a waste of time to post this!! It's nice to have a fellow techy!! I'm really getting into MEL scripting. It's good to not always see the same character modelling (not that there's anything wrong with that) etc etc that you always see in the WIP if you know what i mean!

Check out the link in my sig to see the latest animation I am doing with MEL/C++
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 17-04-2003, 07:30 AM   #9
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Thanks for the kind words. I guess my script is for too specific use and thus hasn't been so popular. Anyway, it has served the purpose I designed it for. I uploaded the script to highend and from there it has been downloaded almost 250 times so I'm actually very happy
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 30-05-2003, 08:52 PM   #10
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Updated to 0.4a. It's an alpha because I'm not sure if the new feature is usable or not...

Here you go:
http://www.simplymaya.com/download_p...id=29&type=mel
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 03-06-2003, 09:23 AM   #11
Hugh
Registered User
 
Hugh's Avatar
 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cool - just downloaded it - will take a look this afternoon.....

When I first read it, I thought it was something similar to a script that I'm working on at the moment, but then realised that it does have it's differences...

If you're interested in seeing the results of my script, then take a look at:
http://www.unframedstudios.com/maya/ears.avi (650k DivX)
http://www.unframedstudios.com/maya/tailTest.avi (770k DivX)

It generates motion down the chain from the 'control joint' at the root. The initial idea was to do something that would automate a rabbit's ears - although I then realised that it would work well with tails as well.

If you want to have a play with an early beta of the script, you can download it from:
http://www.unframedstudios.com/maya/createEars.mel

Source the script, select the first joint that you want to be dynamic (there MUST be at least one parent joint) and run startCreateEar();

Have a play with the UI settings - the defaults are currently the ones that I found worked best for the ears....

There is still a lot of error checking missing, so please don't try to break it - you will find it very easy to do!
__________________
Hugh Macdonald

UnFramed Productions
Goodnight Opus - TD Lead

VFXTalk.com - Online Compositing Community - Admin
Hugh is offline   Reply With Quote
Old 03-06-2003, 11:32 AM   #12
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Nice, I'll have a look later today when I get home.

Thanks!
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 03-06-2003, 10:09 PM   #13
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I tested your script Hugh and it worked like charm. Interesting setup it generates. Care to explain it a bit?
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 04-06-2003, 12:29 AM   #14
Hugh
Registered User
 
Hugh's Avatar
 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure...

It all runs using dynamics - it creates IK handles for each joint, and then constrains these to active rigid bodies.

Each of these bodies is affected by gravity, but it's the 'attractor' field that does all of the work.

The attractor field is initially positioned in the same place as the IK Handle - but it is parented to two joints up the chain from the join that the IK handle is attatched to. This means that the joint with the IK handle is always trying to get back into a certain position relative to the joint above it.

The script doesn't actually use parenting like I've described - it creates other cubes which it point and orient constrains, and then parents to these - this was because the guy I originally wrote this script for couldn't change his joint hierarchy....
__________________
Hugh Macdonald

UnFramed Productions
Goodnight Opus - TD Lead

VFXTalk.com - Online Compositing Community - Admin
Hugh is offline   Reply With Quote
Old 04-06-2003, 06:34 AM   #15
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

What can I say... Cool
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem solving many dynamic objects in a pile? rohiniduggal Dynamics & Special Effects 3 14-01-2011 06:26 PM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 03:41 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.