[Bf-python] New Patch Mesh.transform(mat), Docs included

Campbell Barton cbarton at metavr.com
Wed Mar 2 18:36:52 CET 2005


Hi All, just updated my mesh.transfrom function. as well as  docs. I 
think its stable.

Works like this.
loc_only = 0
mesh.transform(mat_4x4, loc_only)

If the 2nd parm is 0 then vertex normals are transformed and normalized 
(default behavior)
so you can just do-
  mesh.transform(mat_4x4)
if you want normals transformed too.
-
If loc_only is 1 then only vert locations will be tx'd.


There is realy no resion to do a full vertex recalculation, this may 
even be bad for sombody who sets the vert normals, then wantes to TX 
THEIR normal and not have blender re-apply normals.

Also- moving a vert in a mesh does not modify the verts normal, I tested 
this, transforming should only transform existing normals, not 
recalculate them.

The default behavior is good- You do a GetRawFromObject(ob), then 
transform by the objects matrix - in1 line.
Then export the mesh- verts and vert normals are correct.

I have a test blend file that uses DupliVerts with Rot enabled to see 
the matrix applied- You can see the normal direction from teh 
dupliverts. (Proof it works :) )

Patch- Docs included.
+ Test Blendfile

- Cam

-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nmesh_tx.blend.gz
Type: application/x-gzip
Size: 20807 bytes
Desc: not available
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20050302/d15f8769/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nmesh_tx_2005.patch
Type: text/x-patch
Size: 7519 bytes
Desc: not available
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20050302/d15f8769/attachment-0001.bin>


More information about the Bf-python mailing list