Hi
What I am trying to do is to make an object disapear when another one reaches a certain location on X axis.
What I did was
Create an action where the cube is visible in the first frame and invisible in second one. I am keyframing the restrict view property in the outliner.
Create an action constraint for a cube, targeting a sphere. When the sphere reaches the location 5 (x axis), the cube should disapear.
I did a test whe a rotation action, which worked. I cannot make it work with restrict view action.
I attached a blend file to illustrate.
Can someone please help me?
Wrong action selected. Select CubeAction(contains keyed view restriction) instead of disapear(this action belongs to Sphere and makes its movement) under second action constraint(Action.000).
Object’s layer changing cannot either be driven by action constraint. I would like to create some relationship between meshes and actions so the rigging the entire scene would be simplified. It is a project of a complex machine and I would like I could increase or reduce the timing of the entire process. That’s why simply animating the restrict view or layer change would not be enough. Thanks anyway.
Two thoughts… I’m playing with a machine that transforms into another one and I’m using the layer change to hide parts as the transformation takes place. Everything, even the layer changes can be adjusted time wise in the f-curve editor, so if you scale the animation by 2x on the x-axis there, you’ve doubled the time the animation will take place in, and the layer changes get scaled as well time wise, so it all still hapens in sync.
But really, if you are using the action constraint, why not just use that to hide the object? At the frame of the action, used by the action constraint, where you need the object to disappear, move it to a position behind the camera and key it’s location.
Strangely enough Layer visibility cannot be driven properly. Not sure why.
But you can add a driver to ‘Restrict Renderability’ in the outliner, driven by the Sphere X-location. For visual feedback you can add the same driver to ‘Restrict Visibility’, also found in the outliner.
Thank you all for the tips. I definitely could not create the action constraint to a restrict view/renderability or layer change. I had to go back and create the action const to the location, moving the object to a place behind the camera, as suggested by revolt_randy. If anyone has news on creating actions to restrict view, please, let me know. Thank you all.
Oh, wait, I forgot to put a warning on there about my method… It may not work with sampled motion blur used at rendering time. The reason is quite simple: Sampled motion blur works by rendering ‘in between’ frames and overlaying on top of each other to produce the final blurred result. Well a move from in front of the camera to behind the camera in 1 frame, so it appears to happen instantly, will cause a blurred trail of the object moving from on camera to behind camera at render time while rendering the frame where the drastic switch in position happens. 2 ways to work around this: render the offending frame without motion blur - once combined with the other frames at a frame rate of 24 fps, a single frame without motion blur would hardly be noticeable. 2nd way would be to render out a vector pass, render without sampled motion blur, and use compositing nodes and vector blur node to create the motion blur.
Again, you CAN put a driver on the ‘Restrict Renderability’ and ‘Restrict Visibility’ of an object, using the sphere’s x-location as the driver. There is no need for an action constraint.
Indirect way but it works.
In my example Cube disappears when Monkey reaches a point.
Cube’s RestrictView is driven by animated Empty(Z-up movement). Empty is driven by Monkey via Action constraint. Empty as helper object may be moved to invisible layer.
Cheers.
Changing the CubeAction to scale 1 at frame 1 scale 0 at frame 2 (and ofcourse using cubeAction as the action in action constraint) in the blend file of the original post and it works fine. Have found that setting the scale to 0 is a simple way to make an object “disappear”.