Now that we need to use field for property declarations in Blender 2.8. I was wondering how this can be done when creating class dynamically using type() like so:
type('TestPropGrp', (bpy.types.PropertyGroup,), {‘MyProp’:StringProperty(default=‘MyStr’)})
=> this would work in Blender 2.8 but will throw a 'make field' warning.
Any idea how to declare field when using type() ?
Thank you !
edit (this is actually wrong - see answer): Of course one way to do it is to write this in 2 lines:
clss = type('TestPropGrp', (bpy.types.PropertyGroup,), {})
clss.myProp : StringProperty(default=‘MyStr’)
but I was wondering if there could be a more compact solution ?