Commit Graph

11 Commits

Author SHA1 Message Date
Campbell Barton
90c10ab910 BPyRegistry was throwing errors with blank config files. made it check for this and be quiet.
fixed some bugs in BPyMesh_redux, tweaked to work well for test cases. much better use of error levels for edge weighting. better collapsing to the desired target. triangulates before reduction be default now.
2006-05-15 07:29:28 +00:00
Campbell Barton
0497ea57cb Added a polygon reduction function that can poly reduce any mesh and supports UV's as well as bone weights (Thanks to briggs).
Isnt intended to be ultra high quality, more for automatic realtime "Level of Detail" model generation.

BPyMesh.redux(ob, 0.5) # To reduce to about half the polys
2006-05-11 12:42:10 +00:00
Campbell Barton
a3783d32e0 Added some shortcuts to Mesh
MFace.area
 MFace.cent
 MEdge.length

Updated some scripts that used these.
2006-05-11 10:06:15 +00:00
Campbell Barton
8f84542c23 Modified mesh to allow writing to normals.
renamed meshPrettyNormals to meshCalcNormals, and it now writes to normals rather then returning a list of vecs.
updated vertexpaint_selfshadow_ao to be a bit more efficient and make use of the above changes.
2006-05-10 12:12:21 +00:00
Campbell Barton
41623cbdb9 made mesh's getFromObject pick the materials from object or obdata as set by the objects colbits.
its crufty that None of the exports currently export materials correctly, hopefully this will help.
2006-05-10 01:38:02 +00:00
Campbell Barton
8255bdce57 Added a self shadowing script accessed from the vertex paint menu, it does a fake ao thats more pradictable then radio baking and fairly fast.
Also assed a function to calculate high quality normals (normals are the same even for different topologys).
2006-05-07 14:09:46 +00:00
Campbell Barton
52d50b3cbc fix removal of groups for non selected verts.
removed debug prints
2006-04-24 11:34:16 +00:00
Campbell Barton
11586835da Added utility functions to BPyMesh.py
- dictWeightFlipGroups, return a vert weight with flipped group names.
- dictWeightMerge, takes a list of dictWeights and merges them

mesh_mirror_tool.py
Added vertex weight support for the mirror tool, its able to mirror arbitary meshes weights with optional name flipping and creation of name flipped groups.
This also uses the mode for l<>r, l>r, r>l so you can copy from left to right only for eg.
2006-04-24 11:26:04 +00:00
Campbell Barton
9c322c7e86 Moved ngon creating function from obj_import into BPyMesh so other importers can use it.
Exporter free's mesh vertex data each run (was causing memory errors when exporting fluidsim meshes... poke ken for Mesh.Unlink() since many meshes are still created)
Exporter had an indentation error also.
Added an NMesh wrapper around Mesh for importers to use, so as to work around slow 1 by 1 adding of data. used in upcoming flt_importer update.
Mesh cleanup now has the dangerous option to perform a cleanup on ALL mesh data. (needed it for a project)
2006-04-10 21:42:18 +00:00
Campbell Barton
61ad9e26c6 Did some changes to the getMeshFromObject wrapper.
Made obj_export use getMeshFromObject

obj_export now copies images from mtex as well as texface when copy images enabled.
obj_export tested to work with exporting fluidsim animations (somebody reported it was broken, must have been fixed at some point?)
2006-04-07 00:47:39 +00:00
Campbell Barton
086cb9d793 Added BPyMesh for mesh python mesh functions.
at the moment it only has meshWeight2Dict and dict2MeshWeight
  These allow you to deal with vertex weights as a list of dicts which makes scrips short and easy to understand.
   (kh_python, perhaps dict access to the python verts could replace this )

Used the above util functions to update mesh_cleanup.
Copied from the source

	'Material Clean', 'Remove unused materials.'
	'VGroups'
	'Group Clean', 'Remove vertex groups that have no verts using them.'
	'Weight Clean', 'Remove zero weighted verts from groups (limit is zero threshold).'
	'Weight Normalize', 'Make the sum total of vertex weights accross vgroups 1.0 for each vertex.'

Normalizing lets you see how much % of the vertex a bone owns just by looking at 1 of the bone weights.

Would be nice to have this functionality in Blender but theres not much room for new buttons in teh vgroup and material area :/
2006-04-05 18:54:38 +00:00