No, despite the sound of . Update: you can use it to reference ID datablocks in Blender 2.79 and above, see the other answer.
PointerProperty, its purpose is not to store a pointer/reference to an ID datablock
It's used to organize a set of properties in a nice way, especially if your addon registers a lot of properties:
# Bad, clutters scene objects and may even conflict with other addons
bpy.types.Scene.my_prop_1 = bpy.props.IntProperty()
bpy.types.Scene.my_prop_2 = bpy.props.IntProperty()
bpy.types.Scene.my_prop_3 = bpy.props.IntProperty()
# Good, organize properties as a group
my_prop_1 = bpy.props.IntProperty()
my_prop_2 = bpy.props.IntProperty()
my_prop_3 = bpy.props.IntProperty()
bpy.types.Scene.my_addon = bpy.props.PointerProperty(type=MyAddonProperties)
# Access it e.g. like
What you are looking for is
bpy.props.IDProperty, but we don't have that (shame!)
These kind of properties need to be created in C, like
In Python, you can only store by name (
StringProperty). Use it together with a
CollectionProperty and layout.prop_search().
StringProperty isn't tied to the object's name. It's possible to abuse app handlers to check for name changes and to update the property accordingly, but I wouldn't consider it very safe nor efficient.