Just want to move Attachment Constraint keys

Hello Guys,

If you can please help me with this.

I basically have a bunch of point helpers with attachment constraint on a surface, obviously the attachment constraint sets a default key for you at frame 0.

All I wish to do is to tell maxscript select the attachment keys of the multiple objects and move the key to frame "X Number" lets say.

I was able to find out how to do this for the regular position controller,

- movekeys $point001.pos.controller 5

But i can't seem to tell max to do the same for the attachment constraint keys.

How to tell it to do so?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

Attachment controller is a specijal controler. You need a different approach here.
Here we go

fn nudgeAttachCtrlKeys node offset = if isKindOf node[3][1].track Attachment do
(
	if (number = node[3][1].track.keys.count) > 0 do
	(
		for i = 1 to number do
		(
			aKey = AttachCtrl.getKey node[3][1].track i
			aKey.time += offset
		)
		AttachCtrl.update node[3][1].track
	)
)

Let say we have dummy object "Dummy001" which is attached to Box using Attachment ctrl. This controller alreade have some keys and you need to offset the time by 10 frames for each key. Use next line to do this

fn nudgeAttachCtrlKeys $Dummy001 10

bga

ZalitZ's picture

It doesn't work the same way

Hi, Attachment Constraint keys can't be moved using the same method as regular keys. You have to use AttachCtrl methods. If you added your constraint manually, the constraint is on the second controller. The code should be :

newTimeValue = 10
myKey = AttachCtrl.getKey $point001.pos.controller[2].controller 1 --index is 1 if you just have one key
myKey.time = newTimeValue
AttachCtrl.update  $point001.pos.controller[2].controller -- Don't forget to update
barigazy's picture

...

Sorry i did'nt saw ZalitZ post. ;) It's the same solution

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.