Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 29-04-2013 , 06:32 PM
Registered User
Join Date: Apr 2013
Posts: 15

Drum Kick Rigging

Hey guys,

First of all, this is a great board and I learned a lot from the threads. Right now, I need some help.. I didnt find any related threads.

I want to animate a drum kick pedal. In general very simple I think. But.. How do I do this in maya?
I want the pedal to be pressed down, the chain pulled down and the hammer hits the bassdrum. Where must I put the joints? I am quite new in Maya.

Thanks a lot
Hans

# 2 29-04-2013 , 06:59 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Could you show a example..............dave




Avatar Challenge Winner 2010
# 3 29-04-2013 , 07:07 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
You could do this strictly with set driven keys. No joints needed.


Imagination is more important than knowledge.
# 4 29-04-2013 , 07:16 PM
Registered User
Join Date: Apr 2013
Posts: 15
Hi,

like in this example:

Bass Drum Pedal Animation - YouTube

@NextDesign: Do you mean I always have to set three objects (pedal, chain, hammer) by a keyframe everytime i want to use?
edit: I found "set driven keys" tutorial. checking it right now.

Set driven keys is exactly what I need! Thanks a lot!!


Last edited by Hansi3; 29-04-2013 at 07:56 PM.
# 5 29-04-2013 , 09:12 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988

Set driven keys is exactly what I need! Thanks a lot!!

Fantastic. There are better ways to do this if you're interested, but they're much more complicated. Set driven keys is a quick method, and in some cases that's all you need.


Imagination is more important than knowledge.
# 6 01-05-2013 , 04:49 PM
Registered User
Join Date: Apr 2013
Posts: 15
Further question: I have a locator (locator1) and I programmed via 'set driven key' everything I need to this locator. If I move the locator from Y=4 to Y=2 then the kick is animated correctly.
Now, I ve got a list in a textfile in which frame I want to use the kick.
Is it possible to make a script where all these locatormovements according to the frames are "saved" in maya? Iam new in programming as well... but I can imagine that this would work. This would save a lot of time.

Thanks a lot.

# 7 01-05-2013 , 07:01 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
How is your text file structured?


Imagination is more important than knowledge.
# 8 01-05-2013 , 07:16 PM
Registered User
Join Date: Apr 2013
Posts: 15
Hi NextDesign,

currently it is still an Excel file. But I can export it in different formats.
Its like:
Frame Kick1 Kick2
1.............x
2
3........................x
4
5.............x
6
7
8.............x
9
10
...

Cheers
Hans

# 9 01-05-2013 , 09:54 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Ok, and the periods are just spacing for the formatting on the site?


Imagination is more important than knowledge.
# 10 01-05-2013 , 09:58 PM
Registered User
Join Date: Apr 2013
Posts: 15
Yes, Sorry for the confusion. Without the periods, the "x"s would be on the left side.

However, I can change the format quickly. I can even put this into a code or something... if it is possible to "align" the keyline in maya..


Last edited by Hansi3; 01-05-2013 at 10:12 PM.
# 11 02-05-2013 , 03:29 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Sure, it's possible. I would recommend changing the format of the text file to make it easier to work with.

For example, having the frame number is fine, but not useful for the script. You could just use the column number in Excel as this instead. However the kicks pose a bit of a problem. Since the easiest way to write this out would be as a CSV file, you might get an empty column at the end, or in the middle, which complicates the code by trying to fix this. Instead, you can encode both kicks into a single number. For example:

Nothing = 0
Kick 1 = 1
Kick 2 = 2
Kick 1 & 2 = 3

Then you can do the following:

1) Save your table out as a CSV file
2) Go to the first frame (https://download.autodesk.com/us/maya...rrentTime.html)
2) Go through the file line by line (See this for help: https://www.scriptswell.net/2010/09/m...text-file.html)
3) For each line, tokenize it, using a comma as a delimiter. (https://download.autodesk.com/us/maya.../tokenize.html)
4) Go to time i, where i is line number
5) Convert the second value of the array (kick number) into an integer.
6) If the value equals 0, don't do anything. If it equals 1, set the locator to a certain position. If it equals 2, set it to another position. If it equals 3, set it to yet another position.
7) Key this position (https://download.autodesk.com/us/maya...tKeyframe.html)
8) Continue to loop until done.

So you'll have something like this (This is pseudo-code, and will not run!):
Code:
file = read filename

data = read file

go to time 1

for i = 0 to number of lines in data
{
    go to time i

    line = ith line of data

    tokens = tokenize line by comma

    kickVal = (int)tokens[1]

    if (kickVal == 1)
    {
        set locator to position 1
        set keyframe on locator
    }
    else if (kickVal == 2)
    {
        set locator to position 2
        set keyframe on locator
    }
    else if (kickVal == 3)
    {
        set locator to position 3
        set keyframe on locator
    }
}
Hopefully this helps you out.


Imagination is more important than knowledge.
# 12 02-05-2013 , 04:42 PM
Registered User
Join Date: Apr 2013
Posts: 15
Hi,

this is helpfull!
Just to confirm: Is this MEL? And second, is the syntax correct:
set loc1 to position 1
set keyframe on loc1

What if I want to move(translate) loc1 from position y=4 to y=2?
How would you write that?

Thanks a lot for your help!
Cheers
Hans

# 13 02-05-2013 , 04:43 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
No, ND means that the code is just a written description of the necessary algorithm, it's not proper syntax. You will have to convert it to MEL.

# 14 02-05-2013 , 04:53 PM
Registered User
Join Date: Apr 2013
Posts: 15
Ah ok. Thanks.

# 15 03-05-2013 , 01:54 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Tip: Everything you do in Maya is a MEL command. If you open up the script editor, and do something in the program, it will tell you the code for what you just did.


Imagination is more important than knowledge.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads