diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-22 04:38:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-22 04:38:26 +0300 |
commit | f3686b58856adc6929ef38d14c03197127bab017 (patch) | |
tree | dd91e0c6391261de02884fc97afca3e7d13d233b /release/scripts/templates | |
parent | 74a996c8691d8c58efa3aac7c8997e7a2ec36ca2 (diff) |
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.
Diffstat (limited to 'release/scripts/templates')
-rw-r--r-- | release/scripts/templates/addon_add_object.py | 8 |
1 files changed, 5 insertions, 3 deletions
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( |