0
$\begingroup$

I want the cube on left to do same animation like the cube on right, but while affecting only the relative location of the left cube.

In my right cube I have "location" animation that moves up (as you can see by motion paths), then its parent "Empty" has rotation animation, which makes the cube on right look like it's following the path.

My mission is so to make the left cube to go up in his XYZ, then do a circle in its same location in same circle radius like the one of the right, how to achieve it? Some sort of mirror/copy relative animation

I want this to be generic, so that even if the right cube animation is different, the left cube will do the same in its relative location.

Image


I tried parenting the left cube to the right cube, and that works until the "Empty" object starts rotating which makes the right cube follow the path, because at that part it makes the left cube do a bigger radius circle, which is not the intended behavior.

You can also give me a scripting solution if you'd like.

Thank you!

$\endgroup$
2
  • $\begingroup$ did u try copy location (object constraint) with checked offset? $\endgroup$
    – Chris
    Sep 14, 2023 at 9:28
  • $\begingroup$ @Chris Nope I didn't, I am actually kinda a beginner so I'm not sure how to do it but I'll try to search about what you said thank you $\endgroup$
    – Itay
    Sep 14, 2023 at 10:04

2 Answers 2

0
$\begingroup$

The easiest way to create an offset is to parent the object.

Add an empty to the scene and parent the left cube to that empty. Then assign the action to the left cube so that you can see where it shouldn't be. Finally, move the empty, such that the left cube is where you want it to be.

The animation data is all in local space-- relative to the parent-- so that by moving the parent, you move the space in which you evaluate the keyframes.

$\endgroup$
0
$\begingroup$

A solution I made with script, for easy access I recommend to set this up as an addon with shortcut/hotkeys

        second_selected_obj, first_selected_obj = bpy.context.selected_objects

        # Add a "Copy Transforms" constraint
        copy_transforms_constraint = first_selected_obj.constraints.new(type='COPY_TRANSFORMS')
        copy_transforms_constraint.target = second_selected_obj
        copy_transforms_constraint.mix_mode = 'AFTER'

        first_x, first_y, first_z = first_selected_obj.matrix_world.translation
        second_x, second_y, second_z = second_selected_obj.matrix_world.translation

        res_x = abs(first_x - second_x)
        res_y = abs(first_y - second_y)
        res_z = abs(first_z - second_z)

        first_selected_obj.location = (res_x, res_y, res_z)
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .