Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy_extras/io_utils.py
| Show All 15 Lines | |||||
| ) | ) | ||||
| import bpy | import bpy | ||||
| from bpy.props import ( | from bpy.props import ( | ||||
| BoolProperty, | BoolProperty, | ||||
| EnumProperty, | EnumProperty, | ||||
| StringProperty, | StringProperty, | ||||
| ) | ) | ||||
| from bpy.app.translations import pgettext_data as data_ | |||||
| def _check_axis_conversion(op): | def _check_axis_conversion(op): | ||||
| if hasattr(op, "axis_forward") and hasattr(op, "axis_up"): | if hasattr(op, "axis_forward") and hasattr(op, "axis_up"): | ||||
| return axis_conversion_ensure( | return axis_conversion_ensure( | ||||
| op, | op, | ||||
| "axis_forward", | "axis_forward", | ||||
| "axis_up", | "axis_up", | ||||
| ) | ) | ||||
| Show All 18 Lines | class ExportHelper: | ||||
| # True == use ext, False == no ext, None == do nothing. | # True == use ext, False == no ext, None == do nothing. | ||||
| check_extension = True | check_extension = True | ||||
| def invoke(self, context, _event): | def invoke(self, context, _event): | ||||
| import os | import os | ||||
| if not self.filepath: | if not self.filepath: | ||||
| blend_filepath = context.blend_data.filepath | blend_filepath = context.blend_data.filepath | ||||
| if not blend_filepath: | if not blend_filepath: | ||||
| blend_filepath = "untitled" | blend_filepath = data_("untitled") | ||||
| else: | else: | ||||
| blend_filepath = os.path.splitext(blend_filepath)[0] | blend_filepath = os.path.splitext(blend_filepath)[0] | ||||
| self.filepath = blend_filepath + self.filename_ext | self.filepath = blend_filepath + self.filename_ext | ||||
| context.window_manager.fileselect_add(self) | context.window_manager.fileselect_add(self) | ||||
| return {'RUNNING_MODAL'} | return {'RUNNING_MODAL'} | ||||
| ▲ Show 20 Lines • Show All 508 Lines • Show Last 20 Lines | |||||