I'm writing an addon that needs to have the same properties as another operator (i.e the Alembic exporter properties). But I'm not sure how to register them? Normally I create a PropertyGroup and add my properties in the init.py file.
class MyProperties(bpy.types.PropertyGroup):
my_bool: BoolProperty(
name="A bool",
description="",
default = False
)
etc...
But how do I add properties that I have in a list?
def get_alembic_props():
props = []
for prop in bpy.ops.wm.alembic_export.get_rna_type().properties:
# In this example, just add bools.
if prop.type == "BOOLEAN":
new_prop = bpy.props.BoolProperty(
identifier = prop.identifier,
name=prop.name,
description=prop.description,
default=prop.default
)
return props
class MyProperties(bpy.types.PropertyGroup):
abc_props = get_alembic_props():
for prop in abc_prop:
...somehow add the prop...
Also, is it correct to use the operator.get_rna_type().properties to get the properties of another operator? It seems like the all return something called _PropertyDeffered.
alembic_exportinto yourPropertyGroup– Karan Oct 08 '22 at 13:12