diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 23:18:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 23:18:09 +0300 |
commit | 09aa799e5331a9da666f8a6325b038a866b1f35d (patch) | |
tree | ccff0086f70ea7929554a7e4c90bd1182f125ba6 /release/scripts/modules/bpy_extras/io_utils.py | |
parent | e3c85aaca74fc7bd2a9da43a0396a886363bc93d (diff) |
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.
Diffstat (limited to 'release/scripts/modules/bpy_extras/io_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index e2c2e4c9b93..a0c1c3e5c84 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -52,25 +52,19 @@ def _check_axis_conversion(op): class ExportHelper: - filepath = StringProperty( + filepath: StringProperty( name="File Path", description="Filepath used for exporting the file", maxlen=1024, subtype='FILE_PATH', ) - check_existing = BoolProperty( + check_existing: BoolProperty( name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}, ) - # needed for mix-ins - order = [ - "filepath", - "check_existing", - ] - # subclasses can override with decorator # True == use ext, False == no ext, None == do nothing. check_extension = True @@ -112,18 +106,13 @@ class ExportHelper: class ImportHelper: - filepath = StringProperty( + filepath: StringProperty( name="File Path", description="Filepath used for importing the file", maxlen=1024, subtype='FILE_PATH', ) - # needed for mix-ins - order = [ - "filepath", - ] - def invoke(self, context, event): context.window_manager.fileselect_add(self) return {'RUNNING_MODAL'} @@ -173,11 +162,6 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'): update=_update_axis_up, ) - members["order"] = [ - "axis_forward", - "axis_up", - ] - return type(name, (object,), members) |