Rename all objects and textures in a scene

I looking to rename all the textures and objects in a scene so I can rename them after they are marked for deletion.

Im hoping it’s something simple like

bpy.data.scenes[‘Scene’].objects.rename_all()
bpy.data.scenes[‘Scene’].images.rename_all()

Hello,

i don’t really understand what you are trying to do but this is how you can rename all objects:

for obj in bpy.data.objects:obj.name= <new name>

I’m not sure if this is what you wanna do.

I am making a custom script to help me in my workflow – essentially it imports animations textures and objects from different files when needed, but I then need to “flush” a scene and mark it for deletion-- this I can do with no problem, the problem comes up with the objects and texturs that are re-imported that happen to have similar names- so I need to rename all textures and objects in a scene to something like “junk00001” and then flush the scene.

and thanks that was way easier than I expected! works great!