hello , I am a total beginner in scripting for Blender and I tried to do a script that for all selected items makes the object name equal to the mesh name (I have a lot of objects in the scene and I need to automate this ).
I tried to create a really simple script
thanks! in fact I found the issue, I was using a good method but for pre-2.80 era. I redid the script , using the recent API and it works perfectly now
import bpy
for ob in bpy.context.selected_objects:
bpy.context.view_layer.objects.active = ob
bpy.context.object.data.name = bpy.context.object.name