PyAPI: Use annotations for RNA definitions
- Logical use of fields since they define type information. - Avoids using ordered-dict metaclass. Properties using regular assignments will print a warning and load, however the order is undefined.
This commit is contained in:
@@ -28,7 +28,7 @@ class ImportSomeData(Operator, ImportHelper):
|
||||
# ImportHelper mixin class uses this
|
||||
filename_ext = ".txt"
|
||||
|
||||
filter_glob = StringProperty(
|
||||
filter_glob: StringProperty(
|
||||
default="*.txt",
|
||||
options={'HIDDEN'},
|
||||
maxlen=255, # Max internal buffer length, longer would be clamped.
|
||||
@@ -36,13 +36,13 @@ class ImportSomeData(Operator, ImportHelper):
|
||||
|
||||
# List of operator properties, the attributes will be assigned
|
||||
# to the class instance from the operator settings before calling.
|
||||
use_setting = BoolProperty(
|
||||
use_setting: BoolProperty(
|
||||
name="Example Boolean",
|
||||
description="Example Tooltip",
|
||||
default=True,
|
||||
)
|
||||
|
||||
type = EnumProperty(
|
||||
type: EnumProperty(
|
||||
name="Example Enum",
|
||||
description="Choose between two items",
|
||||
items=(
|
||||
|
Reference in New Issue
Block a user