How do you access the object that a PointerProperty points to? I have created a PointerProperty so that I can specify a target object that I want a my script to act on, but I can't seem to find any information about how to actually use the pointer property once I have it.
I have created the property in the register() function:
bpy.types.Scene.targetObject = PointerProperty(type=bpy.types.Object)

And I'm drawing it successfully in my tool's control panel:

But how do I actually operate on the selected object? ie:
# throws error &quot;AttributeError: 'tuple' object has no attribute 'name'
print(bpy.types.Scene.targetObject.name)
bpy.types.Scene has a property targetObject that is a PointerProperty. That means instances of bpy.types.Scene have a property targetObject that is a bpy.types.Object (or None).
# This prints the targetObject for the current scene
print(bpy.context.scene.targetObject)