Commit Graph

346 Commits

Author SHA1 Message Date
Campbell Barton
fc6597fdcf Made import set the object layer to the current scene layer, applied the 3ds name to the object and the mesh. 2006-05-17 00:47:00 +00:00
Campbell Barton
0d8f85eda8 made some changes to vrml97_export, this script needs to be re-written, until then fixed some incorrect assumtions it made- was using the first world in the list for AMB color no matter what world was being used, was also using the image name rather then the file name for its image URL references. 2006-05-16 22:57:24 +00:00
Tom Musgrove
ac5ad70b7c ==md2 export==
typo fix by Antonio Ospite
2006-05-16 02:56:14 +00:00
Campbell Barton
3d2701178e Win32 image opening was broken with the default settings. 2006-05-16 01:41:54 +00:00
Campbell Barton
aad369c8f9 fixed devide by zero error with zero length edges.
added a minimum edge length option
2006-05-15 17:42:01 +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
6c1aee79a5 Allow to see in real time trajectory of selected object.
You can grag the keyframes around from anywhere in the animation.
Keyframe dragging would be less of a hack if we could do an event handeler and a redraw space handeler in 1.

This kind of functionality could be nice to see in Blender.
2006-05-14 11:55:52 +00:00
Campbell Barton
b817c78b0d Applied patch 4188 with some modifications.
https://projects.blender.org/tracker/index.php?func=detail&aid=4188&group_id=9&atid=127
* Sped up export of UV coords,
* Use Mesh instead of NMesh
* Use BPyMesh GetMeshFromObject so correct object materials are exported as well as modifiers applied.
2006-05-14 03:11:55 +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
Chris Want
baf69d3a73 Making the vrml exporter use the Ken Hughes Mesh module, rather
than NMesh.
2006-05-12 15:26:38 +00:00
Campbell Barton
831a1fa91d Added MVert.hide property because hidden verts were hanging BPyMesh_Redux 2006-05-11 20:35:43 +00:00
Chris Want
d3dd1da8d4 The algorithm to export vertex color was very inefficient (for every
vertex it would potentially loop through every face). This fix speeds
it up a bit (only loops through all faces once, at the cost of some
additional memory). An example of export times for a mesh with 6266
verts and 12528 faces:

Before: 2m56s
After:     8s
2006-05-11 17:42:58 +00:00
Chris Want
cfbbd8a54e Some bad logic was causing an 'Appearance' node not to get closed
correctly when a mesh has vertex colors.
2006-05-11 17:29:44 +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
Chris Want
2358e85b6d Converting spaces to tabs in this script (this is standard!) 2006-05-10 21:37:03 +00:00
Campbell Barton
6cbc64ce52 removed an optimizarion in seeking verts that could cause an eternal loop. 2006-05-10 15:31:11 +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
b3742ea41e Added some shading options
Concave/Convex Angle clipping- usefull for tinkering with highlights/shadow results.
Blur radius was inverted.
... Needs documenting.
2006-05-09 14:36:31 +00:00
Campbell Barton
8dc9c228d1 Added options
Rotate X90 (most objs use X up)
Reuse Existing Materials (so material names arnt created when names match)

Fixed some bugs and added a few speedups.
2006-05-09 13:20:18 +00:00
Campbell Barton
f579a65cbc fixed error with zero length normals (caused by zero area faces)
fixed rare bug - that a colour wasnt clamped between 0 and 255.
2006-05-07 18:13:21 +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
5a9b917ea4 Applied patch https://projects.blender.org/tracker/index.php?func=detail&aid=4159&group_id=9&atid=127
Updated batch object name edit. to assign datanames from obnames.
2006-05-06 09:11:11 +00:00
Campbell Barton
75f4416e32 Added vertex weight python scripts accessable from the paint menu.
* clean weights (removed low weights)
* normalize, maximizes weights to a user set peak, optionaly scales other groups too to keep the proportion of the weights even. (Doubles as a weight scaler)
* Grow/Shrink, uses the mesh topology to expand/contract the vert weights. a few options for iterationsm, max length and strength.
I need a way tell if the users in Face Select mode (in python) so I can make use of the selected face flag.
2006-05-05 16:17:59 +00:00
Campbell Barton
444e4e36fe Commited 3ds export enhancements from Mark Stijnman (beowulff)
Will need to do some updates, Mesh over NMesh and optimize some areas but it works and is a big improvement.

from
https://projects.blender.org/tracker/index.php?func=detail&aid=4156&group_id=9&atid=127

Detailed description:
Modified the 3ds export script 3ds_export.py:
- It now exports face UV correctly. 3ds only supports one UV coordinate per vertex. The script now duplicates vertices that had multiple UV pairs assigned to them so that each duplicate now only contains one and only one UV. Faces have their vertex indices adjusted accordingly.
- Quads are now split into triangles better. 3ds only supports triangles, so quads need to be split into two triangles. Instead of rather arbitrarily splitting along the diagonal between points 0 and 2, the script now splits along the shortest diagonal. This creates a higher quality triangular mesh, as well as better preservation of symmetry.
- Now creates an object node block, exporting object nodes, needed by some 3D importers. Among others, allows one to export object hierarchy.
- Now exports Empties as 3ds Dummies.

To be able to add all of the above new features, the script has been mostly rewritten and strongly restructured.

Motivation for the rewrite was the desire to be able to use Blender to produce custom 3d cars for Trackmania:Sunrise (TM:S). Previously, the TM:S importer could not correctly handle the 3ds files from the Blender 3ds export script. With this version, one can export cars complete with UV textures, correct wheel placement and light placement. To my knowledge, this script would make Blender the first fully free 3d modeller that allows one to export 3ds models for TM:S (expect a tutorial soon). The ability to have proper UV coordinates exported into the 3ds file should also be very welcome to many.

Add A Comment: Notepad
2006-05-02 11:26:32 +00:00
Campbell Barton
702207f03f * Added optional X Zero snapping with tolerence limit.
* optionaly work with more then 1 mesh.
2006-04-28 11:41:11 +00:00
Campbell Barton
2d6224a0d7 All negative vert indicies are assumed relative, removed relative vert option. 2006-04-27 23:22:04 +00:00
Campbell Barton
2883242cde Lightwave mot exporter now does worldspace loc/size/rot 2006-04-27 12:51:09 +00:00
Tom Musgrove
512cb9799d ==scripts ==
update to MD2 exporter by Bob Holcomb
2006-04-25 22:05:03 +00:00
Campbell Barton
5c02b01395 Congrats to ZanQdo, first script lightwave motion exporter.
We need a way to get worldspace loc/size/rot.
there is currently no simple way to do this. location can be found the the world matrix.
but size and rot arnt that simple...
Maybe worldLocX.. worldRotX etc?
2006-04-25 07:25:22 +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
a7863efb8a JMS's updated script. Must try to work out which one to remove, this one or apply_def 2006-04-22 09:23:25 +00:00
Campbell Barton
63868046f4 boneweight copy-
fixed the "No X Crossing option "Made 0-x verts snap to eachother.

Added mesh_mirror_tool
  This is a tool that makes verts mirror, so that you can use xmirror in editmode and weight painting.
  Have imported a heap of models that are made mirrored but are slightly out of being in the range that blender uses to be mirrored.
  So this means I can make a models verts snap to its mirrored locations.
  Options are Limit, Mode l>R, R>L or Middle, Normal Weigting, only mirror Same edge user count may add support for mirroring vert weights later.
2006-04-21 09:41:58 +00:00
Tom Musgrove
98b64dc93b ==scripts ==
latest update blender2cal3d by Jean-Baptiste LAMY, fixes script to give correct output with current CVS
2006-04-19 00:54:21 +00:00
Tom Musgrove
d5b51cde65 ==scripts ==
latest update of Direct X 8 exporter by Ben Omari
2006-04-18 22:56:45 +00:00
Tom Musgrove
5759c89668 ==scripts ==
updated hotkeys script from JMS (note I fixed some typos also...)
2006-04-18 22:50:20 +00:00
Campbell Barton
92fd18e5c2 Added no x-crossing option, so verts cant select verts to copy from that cross the X-Axis (usefull when copying human figures, and avoiding the inner leg verts from snapping accross to the wrong leg)
also made it display a progress bar.
2006-04-13 04:00:32 +00:00
Campbell Barton
2a013c1b5b Fixed 2 bugs in mesh brush. 3805 and 3806
Verts being set to NAN and cursor being placed as well as painting.
2006-04-11 02:41:11 +00:00
Campbell Barton
32e516695e Some Maya dev thaught it would be a fun joke to format floats with a comma instead of a full stop.
Obj importer now supports 4,845 as well as the more useual 4.845 floating point value.
2006-04-11 00:00:07 +00:00
Campbell Barton
8f20f587ad A utility script that refinds all image paths for images that have a path whos file dosent exist.
Running this script is usefull for moving projects to new computers and fixing broken image paths.
It works by taking a searchdir and finding all the images in that dir, then using the largest images (if doubles are found) to avoid using thumbnails.

This should be mived from the UV to the image menu when a python slots available.
2006-04-10 23:14:17 +00:00
Campbell Barton
0e39199546 removed debug print. 2006-04-10 21:49:46 +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
Chris Want
8b94135add For 3ds import script, try to get set() function by importing the
function Set() from sets (stoopid python!) if the python version is
less than 2.4.

Campbell: please check!
2006-04-05 19:28:21 +00:00