From 853785782e5fea7805b05ce834a661271fd24358 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Jan 2007 02:15:14 +0000 Subject: Updated docs not to use Object.New() in examples, use scn.objects.* Bugfix from ZanQdo, MOT files wouldent load in lightwave. also made some minor improvements. --- source/blender/python/api2_2x/doc/Lattice.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'source/blender/python/api2_2x/doc/Lattice.py') diff --git a/source/blender/python/api2_2x/doc/Lattice.py b/source/blender/python/api2_2x/doc/Lattice.py index f6b84746950..309e54a5f92 100644 --- a/source/blender/python/api2_2x/doc/Lattice.py +++ b/source/blender/python/api2_2x/doc/Lattice.py @@ -13,7 +13,6 @@ Example:: from Blender import Lattice, Object, Scene, Modifier # Make new lattice data - ob_lattice = Object.New('Lattice') lattice_data = Lattice.New() lattice_data.setPartitions(5,5,5) lattice_data.setKeyTypes(Lattice.LINEAR, Lattice.CARDINAL, Lattice.BSPLINE) @@ -25,16 +24,14 @@ Example:: co2 = vec[1] - vec[2] * 0.3 co3 = vec[2] * 3 lattice_data.setPoint(y,[co1,co2,co3]) - - # Link the data to an object - ob_lattice.link(lattice_data) - + + # Create a new object from the lattice in the current scene + scn = Scene.GetCurrent() + ob_lattice = scn.objects.new(lattice_data) + # Get an object to deform with this lattice mySphere = Object.Get('Sphere') - scn = Scene.getCurrent() - scn.link(ob_lattice) - # Apply lattice modifier mod= mySphere.modifiers.append(Modifier.Type.LATTICE) mod[Modifier.Settings.OBJECT] = ob_lattice -- cgit v1.2.3