Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #transfers the of one object to another
- import bpy
- def transfer_object_name(obj_source, obj_target):
- # Check if both objects are valid
- if obj_source and obj_target:
- # Copy the name from the source to the target
- obj_target.name = obj_source.name
- print(f"Object name transferred from '{obj_source.name}' to '{obj_target.name}'.")
- else:
- print("Invalid objects provided.")
- # Get the selected objects
- selected_objects = bpy.context.selected_objects
- # Ensure two objects are selected
- if len(selected_objects) == 2:
- object_a, object_b = selected_objects
- # Call the function to transfer object name
- transfer_object_name(object_a, object_b)
- else:
- print("Please select exactly two objects: 'Object A' and 'Object B'.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement