From f3686b58856adc6929ef38d14c03197127bab017 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 22 Mar 2011 01:38:26 +0000 Subject: py/api registration: move calls to the classes register/unregister function into register_class() / unregister_class() and add docs. also other minor changes: - remove face sorting keybinding, was Ctrl+Alt+F, this is quite and obscure feature and face order normally doesn't matter, so access from Face menu is enough. - add commented out call to mesh.validate() in addon template since its useful to correct incomplete meshes during development. --- release/scripts/templates/addon_add_object.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'release/scripts/templates') diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py index f4f1185e282..67e033271f4 100644 --- a/release/scripts/templates/addon_add_object.py +++ b/release/scripts/templates/addon_add_object.py @@ -31,8 +31,10 @@ def add_object(self, context): edges = [] faces = [[0, 1, 2, 3]] - mesh_data = bpy.data.meshes.new(name='New Object Mesh') - mesh_data.from_pydata(verts, edges, faces) + mesh = bpy.data.meshes.new(name='New Object Mesh') + mesh.from_pydata(verts, edges, faces) + # useful for development when the mesh may be invalid. + # mesh.validate(verbose=True) add_object_data(context, mesh_data, operator=self) @@ -55,7 +57,7 @@ class OBJECT_OT_add_object(bpy.types.Operator, AddObjectHelper): return {'FINISHED'} -#### REGISTER #### +# Registration def add_object_button(self, context): self.layout.operator( -- cgit v1.2.3