I am using the the CollectionProperty
class to store a list of properties, so something like this:
class MyPropertyGroup(bpy.types.PropertyGroup):
name = bpy.props.StringProperty(name="Property Name", default="Something")
value = bpy.props.IntProperty(name="Property Name", default=22)
bpy.utils.register_class(MyPropertyGroup)
bpy.types.World.my_collection_prop = bpy.props.CollectionProperty(type=MyPropertyGroup)
Then in an Operator
I am calling the add()
method to create additional properties:
class MyOperator(bpy.types.Operator):
# some irrelevant code here...
def execute(self, context):
my_prop = context.world.my_collection_prop.add()
my_prop.name = "test"
my_prop.value = 123
Now my problem is doing the opposite of add()
.
How do I go about removing an instance from a CollectionProperty
?