Linking 2 objects in the middle of an animation


#1

Hello there. This is from a forum on the old CGTALK site. Im trying to set a Vray camera to follow an object in the middle of an animation. I have a object going around a sphere and I want to the camera to follw the object as it passes by the camera into another par of the scene.

Im able to do it with a link constraint using a normal camera, but foe some reason, it wont work with a vRay camera.

I would really appreciate any assistance that I get.

Thank you guys.


#2

Maybe a bit late, but anyways…

The simplest workaround would be to just key the camera’s position/rotation at every frame, to the rotation/position of an object that moves the way you want. Using align tool at every frame would be a bit tedious, so you could use a simple script instead (assuming you’re in max):


undo on 
(
	followingobj = $[1] -- use first selected object as the object that will be keyed
	objtofollow = $[2] -- use second selected object as the object that the first selected object will be keyed to
	tfrom = 0f -- from frame...
	tto = 100f -- to frame...
	for i = tfrom to tto do animate on at time i
		(				
			try followingobj.rotation = objtofollow.rotation catch print "Failed to set rotation."
			try followingobj.pos = objtofollow.position catch print "Failed to set position."
			-- if plant_sca.state then try obj.scale = objtofollow.scale catch print "Failed to set scale."  -- remove the starting "--" if you also need to key the scale
		)
)


#3

Did you try to link the VrayCam to a dummy and apply a Link Constraint to taht dummy?


#4

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.