Commit Graph

21 Commits

Author SHA1 Message Date
Campbell Barton
b0a3566409 Made BPyMesh's ngon a lot better- handels polylines that loop back on themselves, vert length edges and removes doubles (also slower :/ )
Lightwave importer uses this and also makes FGons from imported ngons.
2006-06-30 15:41:20 +00:00
Campbell Barton
6f8b6b3a35 NGon fan fill fallback had an error in the indicies it returned.
Further changes need to be added but theres a bug in Blender that prevents the NGon function from working.
https://projects.blender.org/tracker/index.php?func=detail&aid=4544&group_id=9&atid=125

Lightwave major update by Alessandro Pirovano (uaraus) intergrated with my changes.
Tested with ~ 500 models to import without throwing an error.
 Added subsurf back, image loading fixes and removed meshtools dependancy
2006-06-30 11:22:45 +00:00
Campbell Barton
e5b3fb85e4 Made lightwave import work with images by removing internal image loading wrapper and use BPyImage.comprehensiveImageLoad
Sped up with LC's for vert loading.
tried to removing meshtools as a dependancy, but cant do that everywhere.
2006-06-29 07:06:54 +00:00
Campbell Barton
b2dd3db414 Made 3ds import remove 0,0,0 dummy vert (Thanks Ken)
removed set() from BpyMesh and added some uv utility functions.
2006-06-19 01:27:41 +00:00
Campbell Barton
a4c2492d6e Updated this script and added some functions, this wont effect eny existing python tools.
added functions
pickMeshRayFace(me, orig, dir):
pickMeshGroupWeight(me, act_group, orig, dir):
pickMeshGroupVCol(me, orig, dir):
facePlanerIslands(me):
edgeFaceUserCount(me, faces= None):
2006-06-16 10:59:56 +00:00
Campbell Barton
b7b99be387 use f.area where possible over python function and use len(mface) over len(mface.v) 2006-06-07 02:10:10 +00:00
Campbell Barton
98b2e98c79 Added a 2d convex hull function to BPyMathutils
Added a 2D Line intersection function
Added a function to BPyMesh that gets the mesh space vertex location of a Faces UV Pixel.
2006-05-28 10:44:29 +00:00
Campbell Barton
8baa88da9b Poly reduction fixes
Added remove doubles as a keyword option,
Fixed Triangulate (need to select the faces first)
Fixed boundry weighting (defaults reduced boundries first more then
non boundry verts!)
Made face area weighting give better results.
2006-05-27 14:27:52 +00:00
Campbell Barton
55755954ed optional reuse list for meshCalcNormals, which makes decimation abt 5% faster.
Workaround for a problem where badly predicted positions are further then half the edge length, on these cases just collapse to the weighted middle of teh edge.
Added docs for "PolyReduce" (Uses BPyMesh_Redux) and WIP Docs for AutoTex Layout.
http://mediawiki.blender.org/index.php/Manual/PartXIII/Modelling_Scripts
2006-05-20 23:24:26 +00:00
Campbell Barton
8537a4d471 Fixed some evil bugs in the poly reducer messing up UV's every now and then.
Added support for "Weighted Collapse" Before an edge could only collapse into its middle,
Now the edge collapses into a point bias'd by the 2 verts Concave/Convec "Pointyness" value as well as boundry weighting.
This works much better for boundry verts. - UV's Vcols and Weights are correctly interpolated into the new location.

Added a tool in the mesh menu for accessing the poly reduction tool.
2006-05-18 02:22:05 +00:00
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