I have a kind of theoric question.
I've registered a PropertyGroup
Class to the GreasePencil
class/type, lets call it Property_A
.
At the same time, this Property_A has Collection Property with different elements.
(So, I have an structure like):
a_grease_pencil_object.property_a.collection
My question is:
Having an element/instance of that collection, is it possible to know/get the original Grease Pencil where it is stored?
Some kind of tracing back where it belongs?
I'm new and Im not sure how bl_rna works, but maybe some kind of just getting the name of the Grease Pencil where the property is stored, so I can get it via bpy.data.grease_pencils[name]
?
(I need this since for some methods, I accesed the Grease Pencil by the active Grease Pencil. But now I have to loop over all the grease pencils (using bpy.data.grease_pencils
to change different things, and since those methods use the active GP, they dont work. So Im looking to replace that code for the thing Im asking).
Edit: Reformulating my question (maybe in a simpler way), I want to kind of get the data path of a property
So if I have element_zero = a_grease_pencil_object.property_a.collection[0]
somekind of method that could make something like:
element_zero.get_data_path()
And I get kind of:
bpy.data.grease_pencils["GPencil.011"].property_a.collection
So I know that I could get the name of the Grease Pencil object where it is from.
Thank you so much for the help, much appreciated!