diff options
Diffstat (limited to 'release/scripts/templates/addon_add_object.py')
-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( |