Commit Graph

87 Commits

Author SHA1 Message Date
Campbell Barton
3dce59a5df fixed a problem with UV coords and vert col's when reducing the mesh. 2006-08-15 06:12:55 +00:00
Campbell Barton
531cd7c0fc Removed debug line added when testing for matrix memory leaks that messed up matrix.invert()
updated bvh import which was modified to account for that. as well as other minor changes.
2006-08-06 22:47:57 +00:00
Campbell Barton
7ec55d7a62 Made this script test 4 different collapse locations and use the one that results in the least error.
locations are: smart, middle, v1, and v2
where smart is an attempt to generate a loc that will collapse without loosing volume.

This can now collapse a subdivided cube properly.
2006-08-02 04:40:50 +00:00
Campbell Barton
6bc2ada6fc Made all the scripts use the file browser for saving images
Added better docscrings

Added a texture baker for procedural textures,

Its able to make a WYSIWYG image from the texture, by using the texmesh property, so texture coords arnt lost up when flattening the mesh.

Use a high res image not to see any seams
2006-07-31 15:22:20 +00:00
Campbell Barton
6a48654cce Added a octree implimentation for doing fast locational vertex lookups. 2006-07-31 13:28:00 +00:00
Campbell Barton
d56de7edb7 Mostly fixed archimap issue where "fill holes" - island filling would hang ths script.
Some optimizations and Ctrl will escape the script properly if you want to skip merging the islands.

Thanks to Melchior FRANZ for the report and debug blend
2006-07-29 12:21:38 +00:00
Campbell Barton
792114e476 removed image_bake_from_uvs and replaced it with a module that does all the work and 4 scripts accessable from the UV/Image menu.
- bake wire
- bake image
- bake vcol
- bake normals

Fitting all the options for these into 1 PupBlock was not good.

An example of 4 different baking made from these scripts

http://members.iinet.net.au/~cpbarton/temp.png
2006-07-29 07:14:11 +00:00
Campbell Barton
aa90678154 renamed texture baker to "Bake Image from UVs"
Added options to use material colors (can be multiplied with vcol)
Added wire option for UV Export type functionality. (implys no bleeding)
Added Option to render with no oversampling
changed alpha blending
2006-07-28 02:08:36 +00:00
Campbell Barton
3f5e14abef updated py scripts for changes in mathutils 2006-07-27 03:15:37 +00:00
Campbell Barton
6a087fcb8b 10-20% speedup with better logic and limit the cache size for box intersections. 2006-07-26 17:43:16 +00:00
Campbell Barton
0740e4ab1c removed the now unneeded resize4d operation for instant 2.43 incompatability. :/ 2006-07-26 12:54:54 +00:00
Campbell Barton
f36fc4fe21 removed reload,
BPyRender accedentaly left the scene rather then removing it.
2006-07-26 11:39:32 +00:00
Campbell Barton
c03179c9b3 Added a script that makes an image from vertex colors using UV coords. the advantage this has over other existing scripts is that it bleeds the colors from edge polygons so you dont get mipmapping errors.
usefull for baking radiosity back into an image (with non overlapping UV's) and also has an option for including the texface image, and using normals (instead of colors)

Added BPyRender with a utility function to render off an ortho image from a number of objects.
2006-07-26 02:07:12 +00:00
Campbell Barton
f1eed11ad7 Missing constant added. 2006-07-13 13:41:26 +00:00
Campbell Barton
4c357b4ffa clicking on the second point of the gradient outside the mesh should have blended to alpha zero, but was raising an error, fixed. 2006-07-09 14:54:47 +00:00
Campbell Barton
a06c122772 needed this file for Gradient tool (Window/3d ray picking function) 2006-07-09 14:44:54 +00:00
Campbell Barton
219a6b245c vertexpaint_selfshadow_ao adds face uv to the mesh if there not alredy there...
added GPL header and docstrings to other scripts

removed double batch_name_edit, same file is object_batch_name_edit
2006-07-08 06:14:45 +00:00
Willian Padovani Germano
8aed0ead0b Gui:
[ #4581 ] related to scripts window updates, details here:

http://projects.blender.org/tracker/index.php?func=detail&aid=4581&group_id=9&atid=125

Scripts updated:

-Jean-Michel Soler updated some of his scripts: paths importer (ai,
eps, gimp, svg), kml / kmz importer and also updated Axiscopy.py by A
Vanpoucke (xand) and the knife script (this version handles multiple
materials) by Stefano Selleri and Wim Van Hoydonck. Thanks!
2006-07-07 18:39:51 +00:00
Campbell Barton
9a168d8285 added list2MeshWeight and meshWeight2List - faster then the dict equivilents and better in some cases.
Speedup for bpymesh_redux (poly reducer) with reducing vertex weights. use list2MeshWeight and meshWeight2List.

renamed vertex gradient files

Removed reload()'s
- 3ds_import.py
- mesh_cleanup.py
- mesh_poly_reduce.py
- vertexpaint_selfshadow_ao.py
2006-07-07 10:46:46 +00:00
Campbell Barton
1c9a7a032b fixed a bug in poly redux's vgroup weight merging (was reducing the weight each collapse by about half)
fixed some other UI logic in the python menu script
Added an option to use a vertex group for a reduction weight map to force reducing some areas more then others.

Mesh epydocs activeGroups can be None as well as string.
2006-07-05 20:37:07 +00:00
Campbell Barton
c4b4e2922f more updates, mostly 2.3 error checking, nice messages when pythons not installed and some nendo import optimizations.
BPyMesh will work with the exception of the redux function in py2.3
2006-07-03 20:17:40 +00:00
Campbell Barton
b8d8c1fd60 BPyMesh getMeshFromObject was failing to copy the vert weights because is a dumb mistage within a try - Thanks lightbringer for finding the error 2006-07-03 07:14:48 +00:00
Campbell Barton
a33feaf49b Lots of scripts are using Object.Get() where Scene.GetCurrent().getChildren() is what is needed.
When through and replaced the obvious ones but there are still a a few Id rather not touch without more about whats going on.

Did quite a few changes to export-iv also.
2006-07-03 05:05:28 +00:00
Campbell Barton
e70610ab1e Update to ply export, give nice messages to the user rather then throwing errors at the user.
Export mesh data with modifiers and objects matrix applied. export not only mesh data but text, nurbs etc (thanks to BPYMesh getMeshFromObject)

Small updates to ply import, dont set the TEX of a face (no pink faces anymore)
2006-07-03 03:22:48 +00:00
Campbell Barton
6c4a0d7769 added python 2.3 set importer for BPyMesh_redux
made ngon loop-reduce function faster by replacing dicts with sets
off_export has some errors, modernized the script.
added a python 2.3 reversed compat function - just uses ls[::-1]

Further 2.3 compat testing needed.
2006-07-03 01:52:14 +00:00
Campbell Barton
aaf05a1d20 Made geometrys polyfill work with all iterators (not just lists) and updated bpymeshes ngon to ignore polylines with <3 verts. 2006-07-02 23:09:37 +00:00
Campbell Barton
6adf0e6543 finish adding Geometry module, removed polyfill from mathutils, updated epydoc links and updated BPyMesh NGon function 2006-07-02 15:28:28 +00:00
Campbell Barton
348a4c03c6 More fixes to lightwave ngon filling, fallback to fan fill- ngon function has working optimized loop detection, uses PolyFill function.
LWO cheats by having multiply poly lines in 1, by doubling back on the line. BPyMeshes NGON function splits this into multiple NGons so PolyFill can fill properly.
Tested with 1711 LWO files - (2 had unreadable faces) 77meg and 103 OBJ files- all worked.
2006-07-02 09:44:44 +00:00
Campbell Barton
577494dc05 Further tweaking to the scanfill stuff 2006-07-01 20:26:07 +00:00
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
Willian Padovani Germano
2ca99a5e09 Scripts:
- Jean-Michel Soler updated the svg to obj module used by Paths
Importer (thanks!)
- user request: added option to control whether user prefers per face
(uv face select "TwoSided" toggle) or per mesh ("Double Sided") single /
double face info in ac3d exporter.

BPY:
- Blender_ShowHelp() was now crashing Blender when called for the
second time, due to EXPP_dict_set_item_str decrementing the reference
count of an object passed as argument to Blender_ShowHelp() (so not
owned by that function).
2006-06-18 19:05:51 +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
73e5693bea Fixed mistake in calculating the collapse position (surprising it worked as well as it did) 2006-06-04 09:35:35 +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
e47719d253 comments on how edge weighting for collapsing works.
uv_auto_layout_tex now uses the recently fixed saveRenderedImage - I needed to make clean and make to get it working.
2006-05-28 02:12:49 +00:00
Campbell Barton
83105911bf Use Kens hide/sel mesh props to save some python looping. 2006-05-28 01:52:16 +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
2f337b6e62 Stoped a list that didint need to be made.
~20% faster and memory saved by re-using the face and edge lists and their classes each pass rather then __init__'ing new ones.
Stupid mistake- was only collapsing edges with UV's
2006-05-18 14:13:47 +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
51eb744807 BPyImage had a problem with a path being returned as None
BPyMesh would make NAN coords for collapsed edges.
2006-05-15 13:33:30 +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
265c0af49f * New faster algo for finding the new collapse location using normals rather then edge connectivity data.
* Much improved, slower edge collapse weighting method that makes this script about 2.5x slower, but brings it up to the quality of qslim (lightwave's decimator), without the manifold' errors.
Probably worth adding a UI front end to this function.
2006-05-14 18:28:27 +00:00
Campbell Barton
d790049639 fixed, bugs with selection & remove doubles. 2006-05-13 17:50:47 +00:00
Campbell Barton
b0c5df16f6 Made editmesh remove_doubles work with vertex colours,
added vertex colour support to BPyMesh_redux polygon reducing function.
2006-05-13 12:36:48 +00:00
Campbell Barton
2bcf11defb BPyMesh_redux: Fixed a rare bug in mesh redux's, collapsed location.
BPyMesh_redux:  made redux support non UV Meshes.
vertexpaint_selfshadow_ao:  turned vertex selfshadow scale into radius.
2006-05-13 05:24:58 +00:00