I'm trying to add a Pointer Property in my code that would be able to reference an Integer Property that exists on some data block of some object.
What is the proper way of doing it? I thought it should be as simple as the code below, but it doesn't work.
I do use PointerProperties a lot to reference specific object types etc., but I'm not sure how to point to a simple Int Property. How should I do it?
Thank you so much and I apologize if this is a trivial question.
import bpy
class Example_Class(bpy.types.PropertyGroup):
int_pointer: bpy.props.PointerProperty(
type=bpy.types.IntProperty,
name="Int Property Pointer",
description = "This is the pointer to Int Property that exists somewhere else",
)
def register():
bpy.utils.register_class(Example_Class)
def unregister():
bpy.utils.unregister_class(Example_Class)
if name == "main":
register()
The error message is:
TypeError: PointerProperty(...) expected an RNA type derived from ID or ID Property Group
Error: Python: Traceback (most recent call last):
File "\Text", line 20, in <module>
File "\Text", line 12, in register
ValueError: bpy_struct "Example_Class" registration error: 'int_pointer' PointerProperty could not register (see previous error)

bpy.types.PropertyGroupor :class:bpy.types.ID." - Basically the same as what the error message tells you. – Blunder Dec 07 '22 at 01:24