PDA

View Full Version : Why does this give a syntax error?


Mealing
11-15-2009, 12:31 PM
Hello, I'm running through one of the Digital Tutor's set of tutorials (the walk cycle course) and have hit a snag by part 2 hehe.

It's showing you how to set up a basic macro to make a keyframe of any of the selected attributes, sounds quite helpful :)

Anyway, as far as I can see I've copied it exactly, my code currently reads;

// Select objects

string $myObjects [] = ` ls -sl`;

string $myAttr [] = ` channelBox -q -sma mainChannelBox`;

// Start the loops

for ($myNode im $myObjects){
for ($myNodeAttr in $myAttr){
setKeyFrame( $myNode+"."+myNodeAttr );
}}

However whenever I try to execute this, I get the following syntax error;

// Error: for ($myNode im $myObjects){ //
// Error: "$myNode" is an undeclared variable. //
// Error: }}; //
// Error: Syntax error //

I've just sent them an email but I'd imagine they'll be fairly busy, just wondered if anyone here could shed some light?

s0ke
11-15-2009, 03:06 PM
Typo should be in :)
for ($myNode im $myObjects)

also setKeyFrame should be setKeyframe

Mealing
11-15-2009, 03:45 PM
So it should :)

Surprisingly I've already received a response from Digital Tutors, can't complain at that customer service can you :D

*edit*

There were a few other syntax erros actually, the final code is;


// Select objects

string $myObjects [] = ` ls -sl`;

string $myAttr [] = ` channelBox -q -sma mainChannelBox`;

// Start the loops

for ($myNode in $myObjects){
for ($myNodeAttr in $myAttr){
setKeyframe( $myNode+"."+$myNodeAttr );
}}


Thanks for the help!

CGTalk Moderation
11-15-2009, 03:45 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.