As shown below, I have 2 nested spheres, each with a different material (inner = "1", outer = "2"). Ultimately, I need to select the inner sphere (material "1") via python scripting.
I've found a number of ways to select (or make active) one of the spheres. However, even though Blender says that it's selecting the correct sphere (indicated by orange line around center sphere), I don't believe it's active -- adding a modifier applies it to the outer sphere instead. That, and the material properties show the properties of the outer sphere.


obj.select_set(True)with a different method for checking selection:obj.select_get()– Will S Jan 05 '19 at 16:35bpy.context.view_layer.objects.active = bpy.context.scene.objects['Cube'](in 2020), see: https://blender.stackexchange.com/a/132829/31447 – brockmann Apr 01 '20 at 16:18