Here’s an example:
import bpy obj = bpy.context.active_object bpy.ops.object.duplicate() obj.select=False # Do something to currently selected object bpy.ops.object.delete() obj.select=True
Even though i’ve reselected the original object, it’s not actually selected. Which can be demonstrated by appending this to the previous.
obj2 = bpy.context.active_object print("name:",obj2)
Which will print ‘None’!
Q. How to make it the active object again?
Now, this technically works:
But, it still leaves the object dark orange (not light orange) and a panels poll function won’t recognise it as a singly selected object (of type).