PDA

View Full Version : confusion setting tangents to step


gonemad
10-18-2005, 11:35 PM
Hi guys(gals), I have a small problem that could just be something I'm confused about.

I have a camera that's parented to a dummy, the dummy bounces around to different locations in the scene and the camera changes FOVs at those locations. I have a script set up to automate that animation.

At the end of my script I'd like to set the key tangents for the animation to step. I've done it on the cameras fov using $camera.fov.keys.inTangentType = #step and $camera.fov.keys.outTangentType = #step. However, when I try the same type of thing on the dummy it gives me an error saying it dosn't have a .keys for the dummy. I've tried it on $dummy.transform.keys, .position.keys, and .rotation.keys. From what the way I'm reading it in the reference it should work but it's not.

Anythoughts?

Thanks.
-mad

magicm
10-18-2005, 11:54 PM
If the dummy has an xyz position controller, you can set the tangents like this:
BTW: This goes for all controllers that have 'sub controllers', so this probably also applies to the rotation controller of the dummy. (euler xyz)

x : .position.controller[1].controller.keys
y : .position.controller[2].controller.keys
z : .position.controller[3].controller.keys

Cheers,
Martijn

Bobo
10-19-2005, 12:05 AM
Hi guys(gals), I have a small problem that could just be something I'm confused about.

I have a camera that's parented to a dummy, the dummy bounces around to different locations in the scene and the camera changes FOVs at those locations. I have a script set up to automate that animation.

At the end of my script I'd like to set the key tangents for the animation to step. I've done it on the cameras fov using $camera.fov.keys.inTangentType = #step and $camera.fov.keys.outTangentType = #step. However, when I try the same type of thing on the dummy it gives me an error saying it dosn't have a .keys for the dummy. I've tried it on $dummy.transform.keys, .position.keys, and .rotation.keys. From what the way I'm reading it in the reference it should work but it's not.

Anythoughts?

Thanks.
-mad

For a couple of releases, all Position and Rotation controllers have been set to default to a master controller with 3 subcontrollers. So the Position is not a Bezier_Position as it was 5 years ago, it is a Position_XYZ with 3 Bezier_Floats assigned to the sub-controllers.
This is why you cannot directly set a tangent in the parent controller - there can be potentially 0 to 3 keys on the same frame, so it will let you do some operations like scaling keys etc. there, but you cannot access individual keys via the .keys property.

To access them, you have to go down one level, for example

$Dummy01.position.controller[1].controller.keys --this accesses the keys of the X position
$Dummy01.position.controller[2].controller.keys --this accesses the keys of the Y position
$Dummy01.position.controller[3].controller.keys --this accesses the keys of the Z position

gonemad
10-19-2005, 01:10 AM
I love how I post a question and almost immediately there is an answer waiting for me.

I was a little nervous about stepping into maxscripting, I don't think like a programmer at all, but you guys are making it a lot easier. Thanks.

CGTalk Moderation
10-19-2005, 01:10 AM
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.