diff options
author | Martin Poirier <theeth@yahoo.com> | 2005-08-01 10:01:24 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2005-08-01 10:01:24 +0400 |
commit | 7d63a1f277908cc5a5c6c32c38de93a3e1aba41c (patch) | |
tree | bec7d1bf4db778320fbf0cdcd87ddda8b18897d0 /source/blender/python/api2_2x/doc/NMesh.py | |
parent | 55720d20defeb8d7081ec0566042ae3011b16e7b (diff) |
This patches adds support for Font, Curve, Surface and Meta Objects in
Blender.NMesh.GetRawFromObject through a displist conversion method as used by
Blender when converting them in the UI.
Notes: Objects with only edges (3D curves/polyline without bevel) do not have
normals, so they are all initialised to (1, 0, 0) on conversion
Converting from meta objects only work on the "mother ball". That is,
the object with the lower base name.
Example: "meta" for all the "meta.*" objects.
Meshes extracted from curve based objects (Font/2D filled curves)
contain both the filled surfaces and the outlines of the shapes.
Materials are taken from the object's material list. Material handling
in NMesh is incorrect anyway, as it always uses the materials from the
mesh, ignoring the setting in ob->colbits.
This patch also makes the include order a little clearer.
A couple of warnings have been fixed by using better types:
- Using char instead of short when parsing color values.
The "constructor" expects and uses char anyway.
- Explicit casting to short when storing normals back in mvert.
- Changing constant doubles to floats with "f" to make compiler happy.
The only warning left regards NMFace.flag which is stored as a short but is
used to fill in TFace.flag which is a char. I didn't want to change the
object's structure so I left it like that. I didn't add an explicit cast when
putting it back in TFace so that the warning can remind us that there might be
something to change there.
Diffstat (limited to 'source/blender/python/api2_2x/doc/NMesh.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/NMesh.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py index c2f7df2a311..2fa2de747af 100644 --- a/source/blender/python/api2_2x/doc/NMesh.py +++ b/source/blender/python/api2_2x/doc/NMesh.py @@ -9,6 +9,7 @@ L{NMesh.addEdgesData}, etc.); - new optional arguments to L{NMesh.update}; - L{NMesh.transform}; - L{GetNames}. + - L{GetRawFromObject} supports Surface/Curve/Text/Meta objects Mesh Data ========= @@ -151,8 +152,9 @@ def GetRawFromObject(name): Get the raw mesh data object from the Object in Blender called I{name}.\n Note: The mesh coordinates are in local space, not the world space of its Object.\n For world space vertex coordinates, each vertex location must be multiplied by the object's 4x4 matrix. + This function support all the geometry based objects: Mesh, Text, Surface, Curve, Meta. @type name: string - @param name: The name of an Object of type "Mesh". + @param name: The name of an Object. @rtype: NMesh @return: The NMesh wrapper of the mesh data from the Object called I{name}. @note: For "subsurfed" meshes, it's the B{display} level of subdivision that @@ -160,10 +162,14 @@ def GetRawFromObject(name): and is not available for scripts. This is not a problem at all, since you can get and set the subdivision levels via scripting, too (see L{NMesh.getSubDivLevels}, L{NMesh.setSubDivLevels}). + @note: Meshes extracted from curve based objects (Font/2D filled curves) + contain both the filled surfaces and the outlines of the shapes. @warn: This function gets I{deformed} mesh data, already modified for displaying (think "display list"). It also doesn't let you overwrite the original mesh in Blender, so if you try to update it, a new mesh will be created. + @warn: For Meta Object's, this function will only return a NMesh with some geometry + when called on the base element (the one with the shortest name). """ def PutRaw(nmesh, name = None, recalc_normals = 1, store_edges = 0): |