[Bf-extensions-cvs] [b674c49] master: Fix T50306: Unexpected behavior with brilliant diamond object.
Bastien Montagne
noreply at git.blender.org
Tue Dec 27 15:58:44 CET 2016
Commit: b674c491538cfc345f8e5a43848d498d2e1d9a15
Author: Bastien Montagne
Date: Tue Dec 27 15:58:06 2016 +0100
Branches: master
https://developer.blender.org/rBAb674c491538cfc345f8e5a43848d498d2e1d9a15
Fix T50306: Unexpected behavior with brilliant diamond object.
Just use `object_utils.object_data_add()` as everyone else...
===================================================================
M add_mesh_extra_objects/add_mesh_round_brilliant.py
===================================================================
diff --git a/add_mesh_extra_objects/add_mesh_round_brilliant.py b/add_mesh_extra_objects/add_mesh_round_brilliant.py
index ea54481..365705a 100644
--- a/add_mesh_extra_objects/add_mesh_round_brilliant.py
+++ b/add_mesh_extra_objects/add_mesh_round_brilliant.py
@@ -219,11 +219,11 @@ def addBrilliant(context, s, table_w, crown_h, girdle_t, pavi_d, bezel_f,
dmesh = bpy.data.meshes.new("dmesh")
dmesh.from_pydata(Verts, [], Faces)
dmesh.update()
- dobj = bpy.data.objects.new("dobj", dmesh)
- # link object into scene
- scene.objects.link(dobj)
-
+ # Create object and link it into scene.
+ from bpy_extras import object_utils
+ dobj = object_utils.object_data_add(context, dmesh, operator=None, name="dobj").object
+
# activate and select object
scene.objects.active = dobj
dobj.select = True
More information about the Bf-extensions-cvs
mailing list