I have an object A that is constrained to move on a path and I want to create still copies of it while it moves on the path. I tried the following code but it failed. In particular, it arbitrarily moves the object A itself and all the copies go crazy. Could you please help me fix this? Thank you!
A = context.active_object for i in range(1, copies_number+1): A.constraints["Follow Path"].offset_factor = (i-1) / (self.copies_number-1) A.constraints["Follow Path"].keyframe_insert(data_path='offset_factor', frame=i) copy = duplicate(A) #this is a function that I have introduce to duplicate objects bpy.context.view_layer.objects.active = copy bpy.ops.object.visual_transform_apply() for constraint in copy.constraints: copy.constraints.remove(constraint)