I would like to create a PropertyGroup Class with some of my own settings and then I would like to assign a settings instance to 4 different Environment Textures in my World.
This is what I would like to achieve for my Textures (example from Blender.org)
class MaterialSettings(bpy.types.PropertyGroup):
my_int: bpy.props.IntProperty()
my_float: bpy.props.FloatProperty()
my_string: bpy.props.StringProperty()
bpy.utils.register_class(MaterialSettings)
bpy.types.Material.my_settings = bpy.props.PointerProperty(type=MaterialSettings)
test the new settings work
material = bpy.data.materials[0]
material.my_settings.my_int = 5
material.my_settings.my_float = 3.0
material.my_settings.my_string = "Foo"
I defined my class:
class Env_Settings(bpy.types.PropertyGroup):
env_name: bpy.props.StringProperty()
env_rot: bpy.props.FloatProperty(default=0)
env_bright_cyc: bpy.props.FloatProperty(default=1)
env_bright_eve: bpy.props.FloatProperty(default=1)
but I'm having trouble to understand where to hung it under. I can't put it under:
bpy.types.World.env_settings = bpy.props.PointerProperty(type=Env_Settings)
because then I can only instance it once. (All other instances will get the same values). So, how can I define 4 instances of my Settings Property for the four Environment Textures in my World node group? Thanks for any suggestion.