Commit Graph

196 Commits

Author SHA1 Message Date
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
702207f03f * Added optional X Zero snapping with tolerence limit.
* optionaly work with more then 1 mesh.
2006-04-28 11:41:11 +00:00
2d6224a0d7 All negative vert indicies are assumed relative, removed relative vert option. 2006-04-27 23:22:04 +00:00
2883242cde Lightwave mot exporter now does worldspace loc/size/rot 2006-04-27 12:51:09 +00:00
512cb9799d ==scripts ==
update to MD2 exporter by Bob Holcomb
2006-04-25 22:05:03 +00:00
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
52d50b3cbc fix removal of groups for non selected verts.
removed debug prints
2006-04-24 11:34:16 +00:00
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
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
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
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
d5b51cde65 ==scripts ==
latest update of Direct X 8 exporter by Ben Omari
2006-04-18 22:56:45 +00:00
5759c89668 ==scripts ==
updated hotkeys script from JMS (note I fixed some typos also...)
2006-04-18 22:50:20 +00:00
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
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
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
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
0e39199546 removed debug print. 2006-04-10 21:49:46 +00:00
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
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
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
97407950d3 Added an option to batch rename vert Groups. 2006-04-05 16:48:55 +00:00
6b6d379b9d Added the option only to update selected verts in the target mesh when copying bone weights.
Good when you need to update a copy with changes to the weights.
2006-04-05 07:10:30 +00:00
b6c3f3f352 fixed error in boneweight copy and type in obj export. 2006-04-03 21:48:18 +00:00
1919391b24 Fixed small but that was causing an eternal loop. 2006-04-03 20:15:24 +00:00
e9a9caee4c Fixed a but where applying the modifier option was disabled, Meshes woudl have there objects matricies applied.
(Now always work on copied data- Blender.Mesh could do with a copy function)
Now triangulate works without "Apply Modifiers" enabled.

Much thanks to Gianluca Faletti for helping me track down the problem.
2006-04-03 16:14:24 +00:00
756bad72c4 Sped up quite a bit using zsorting and fast index guessing. so verts can find the closest vert in the other mesh.
from 37.3sec to 8.65 sec on the test I used (human with 24 bones) - 24k verts on the source mesh.
2006-04-02 20:59:02 +00:00
a5c51014ae Bugfix when checking for a container mesh (Mesh.Unlink needed here) 2006-04-02 01:46:10 +00:00
218e1927c8 Silly var typo fix. 2006-04-01 19:28:55 +00:00
01b827fa6f This script copys vertex groups and weights from 1 weighted mesh, to all unweighted meshes.
It just uses the closest to copy the weights, but this means the meshes need not have the same number of verts.
Worldspace coords are used so the meshes only need to overlap in worldspace.
2006-04-01 15:32:58 +00:00
63bc0b3847 Added relative vertex references to obj importer,
Found a model that used negative relative vertex indicies.
positive relative vert indicies should work also but untested (no example models).
2006-03-31 13:07:27 +00:00
58c6550a7c Removed debug printing. 2006-03-31 02:35:16 +00:00
a05b2090a9 Fixed some bugs in BPyImage comprehensive loade. (used by 3ds and obj import)
OBJ Importer,
Added true FGon support for faces >4 verts. (Does a propper scanfill and optionaly converts it to an FGON.) - Checks for flipping, uses a face fan when scanfill fails.
Added the option to split by materials, into seperate mesh objects (Good for large databases)
Made smoothGroups optional.
2006-03-29 18:25:42 +00:00
0d2902b1fe ==Directx 8 importer==
addition of a direct x importer by Ben Omari
2006-03-29 06:25:07 +00:00
bb85e04a7e ==Directx 8 exporter update==
update to the direct x exporter by Ben Omari
2006-03-29 06:22:43 +00:00
528ea06531 Updated to use Blender.sys.exists() which now uses BLI_exist rather then stat. 2006-03-19 13:31:44 +00:00
f356eac8a4 Update box unpack with faster python use
Update image loader, optional arg for not autocreating the image. - aslo removed some stuff that shouldent have been left in.
  Workaround for a bug in Blender.sys.exists()... should fix soon.
2006-03-18 11:41:07 +00:00
afc8dec921 Small updates to import images in win32. 2006-03-14 20:28:02 +00:00
afeba9462e Support win32 paths. 2006-03-14 20:27:27 +00:00
7e857617bb ==scripts==
removing obsolete and redundant scripts from the repository
2006-03-11 10:51:06 +00:00
9af72012c8 ==scripts==
updated directx8 exporter by Ben Omari
2006-03-11 10:45:48 +00:00
b731b9e7af === Script Update: UV Export ===
Updated the interface to use PupBlock and the FileSelector instead of drawing a full GUI
Fix a crash when no objects were selected and the Ob option was activated
Added option to edit the resulting image in an external program (this needs a full python distro for the os module. it detects the presence of the module and shows the option only if possible).
Saves the selected settings (except the save path) with Registry, so they get loaded back next time you use the script.
2006-03-04 18:19:05 +00:00
3f5fd39e28 removed typos causing MTL loading to fail. 2006-02-25 15:05:36 +00:00
9c4ce4cae1 Should now work with python 2.3, also optimized dictionary's a bit. keys -> iterkeys and has_key -> try/except 2006-02-24 04:03:15 +00:00
003b8ae2ef Another fix for a silly bug 2006-02-20 10:31:24 +00:00
883d56e922 tweak colin weighting again. 2006-02-20 05:30:15 +00:00
23e55acfcb Small update...
Bugfix, Wrongly waited colinear test that caused quads with co-linear edges to be made.
 Bugfix, Use active object even if unselected.
 Optimize, Skip further tests if face pair is above the quad error limit.
 Optimize, Faster edge/Face user dict creation ~10%
 Feature: Options to ignore VCols and UV's as delimetres.
2006-02-20 05:11:04 +00:00
e3e94f1bb7 ==SConscript fix for cygwin==
open inventor export contributed by Radek Barton
2006-02-12 15:37:01 +00:00
10acbf00ab This script converts open and closed edge loops into polylines
Supported:
	 Polylines where each vert has no more then 2 edges attached to it.
2006-02-08 14:38:47 +00:00