Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 11-03-2003, 05: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 11:13 PM.
kbrown is offline   Reply With Quote
Old 11-03-2003, 06: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, 06: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, 07: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, 03: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, 04: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, 08: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 11:12 PM.
kbrown is offline   Reply With Quote
Old 16-04-2003, 02: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, 08: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, 09: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, 10: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, 12:32 PM   #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, 11: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, 01: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, 07: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
Reply


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 07:26 PM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 04:41 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.