diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-10 02:44:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-10 02:44:01 +0300 |
commit | 08c9ecb3b043322f34e55f335f76dc2657c187ef (patch) | |
tree | 8dc0954f4bd0ca83c76afa407aa7b5ffb1e9de38 /release/scripts/op | |
parent | 99b713e8b0fc7a395515c32616b47b8209dcd0c2 (diff) |
RNA/Py API
change how data is added. eg.
bpy.data.add_mesh(name) --> bpy.data.meshes.new(name)
bpy.data.remove_lamp(lamp) --> bpy.data.lamps.remove(lamp)
image and texture stil use add_* funcs
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/add_mesh_torus.py | 4 | ||||
-rw-r--r-- | release/scripts/op/object.py | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py index 372afb3654f..865b1d57daf 100644 --- a/release/scripts/op/add_mesh_torus.py +++ b/release/scripts/op/add_mesh_torus.py @@ -101,7 +101,7 @@ class AddTorus(bpy.types.Operator): self.properties.major_segments, self.properties.minor_segments) - mesh = bpy.data.add_mesh("Torus") + mesh = bpy.data.meshes.new("Torus") mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4)) mesh.verts.foreach_set("co", verts_loc) @@ -114,7 +114,7 @@ class AddTorus(bpy.types.Operator): ob.selected = False mesh.update() - ob_new = bpy.data.add_object('MESH', "Torus") + ob_new = bpy.data.objects.new("Torus", 'MESH') ob_new.data = mesh scene.objects.link(ob_new) scene.objects.active = ob_new diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index d68c30f0f23..dd95c6f51a6 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -145,6 +145,7 @@ class Retopo(bpy.types.Operator): def execute(self, context): import retopo + reload(retopo) retopo.main() return {'FINISHED'} |