Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2019-10-15 11:39:44 +0300
committerMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2019-10-15 11:39:44 +0300
commitf93992f6efe6afa5eb70a7f1d9ec5c6375fcb659 (patch)
tree9417c0cc07c7308f941ca166cec9bc8e28d2dd7b /io_mesh_ply/__init__.py
parent9dcfa9d13a1617e05b13bb4ea4d364242b48fdbe (diff)
PLY exporter: export selection or scene
D6060 now PLY exporter behaves similar to the rest of the export add-ons.
Diffstat (limited to 'io_mesh_ply/__init__.py')
-rw-r--r--io_mesh_ply/__init__.py35
1 files changed, 31 insertions, 4 deletions
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py
index b89732fd..6e2b16b3 100644
--- a/io_mesh_ply/__init__.py
+++ b/io_mesh_ply/__init__.py
@@ -104,6 +104,11 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
filename_ext = ".ply"
filter_glob: StringProperty(default="*.ply", options={'HIDDEN'})
+ use_selection: BoolProperty(
+ name="Selection Only",
+ description="Export selected objects only",
+ default=False,
+ )
use_mesh_modifiers: BoolProperty(
name="Apply Modifiers",
description="Apply Modifiers to the exported mesh",
@@ -136,10 +141,6 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
default=1.0,
)
- @classmethod
- def poll(cls, context):
- return context.active_object is not None
-
def execute(self, context):
from . import export_ply
@@ -169,6 +170,30 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
pass
+class PLY_PT_export_include(bpy.types.Panel):
+ bl_space_type = 'FILE_BROWSER'
+ bl_region_type = 'TOOL_PROPS'
+ bl_label = "Include"
+ bl_parent_id = "FILE_PT_operator"
+
+ @classmethod
+ def poll(cls, context):
+ sfile = context.space_data
+ operator = sfile.active_operator
+
+ return operator.bl_idname == "EXPORT_MESH_OT_ply"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ sfile = context.space_data
+ operator = sfile.active_operator
+
+ layout.prop(operator, "use_selection")
+
+
class PLY_PT_export_transform(bpy.types.Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOL_PROPS'
@@ -233,6 +258,7 @@ def menu_func_export(self, context):
classes = (
ImportPLY,
ExportPLY,
+ PLY_PT_export_include,
PLY_PT_export_transform,
PLY_PT_export_geometry,
)
@@ -253,5 +279,6 @@ def unregister():
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
+
if __name__ == "__main__":
register()