In my register I create the following property:
setattr(bpy.types.Scene, "test_enum", bpy.props.EnumProperty(items=items, update=func1))
and in func1 i have:
def func1(self, context: Context):
scene = bpy.types.Scene
value = getattr(context.scene, "test_enum")
if value == 1:
setattr(scene, "my_string", bpy.props.StringProperty(name="Enter Text"))
In the above code im trying to figure out how to grab "test_enum" dynamically, as opposed to hard coding it. Blender knows which property is being changed, how can I?
As a bonus question...is there any way for me to pass something to that func1?
update=lambda self, context: func1(self, context, "test_enum")and thendef func1(self, context, prop_name): value = getattr(self, prop_name)– Gorgious Jun 27 '22 at 15:49