How are bpy.types.* organized and created in C?

Take for example: ObjectShaderFx in file 'rna_object.c’
Where would I expect to see ObjectShaderFx used ?

Shouldn’t it be listed in the Python api under bpy.types?
If so, I don’t see it.

Also, how does “Object” relate to “ObjectShaderFx” in the code below ?
Specifically, how does it relate to it within the Python api ?

Also, shouldn’t I expect to exist a StructRNA RNA_ObjectShaderFx ?
I see other arguments for RNA_def_property_srna() that are defined as a StructRNA

        RNA_def_property_srna(cprop, "ObjectShaderFx");
	srna = RNA_def_struct(brna, "ObjectShaderFx", NULL);
	RNA_def_struct_sdna(srna, "Object");
1 Like

bpy.types. ObjectShaderFx seems to exist here. Not sure how you are checking this.

ObjectShaderFX is a part of Object, accessed as object.shader_effects. The usage of RNA_def_struct_sdna(srna, "Object"); means the struct members in C are part of the Object struct, but in Python we expose it as a separate one.

It does exists, but there is no declaration for it in RNA_access.h. That can be added if any C code needs to access it.

1 Like