Commit Graph

375 Commits

Author SHA1 Message Date
Campbell Barton
ad51edd3bf Adding MDD import and export from patch 4969 with modifications, (import and export rvks, MDD is from lightwave AFAIK)
Added Mesh .key .removeAllKeys() and .insertKey() for MDD support (was using NMesh just for keys before)
Since this is aparently an experemental feature in NMesh we may want to change this.
2006-09-27 16:33:02 +00:00
Campbell Barton
e6251f6ae7 removed .parent by mistake in Object.c
made some of the importers raise a nice error if a file disnt exist rather then a python error. will eventually apply to all.
2006-09-26 04:39:46 +00:00
Campbell Barton
65895ba6bd corrected image doc mistake - image.makeCurrent()
BPyRender.imageFromObjectsOrtho() returns an image

Made all image bake scripts ask before overwriting a file. as well as displaying the newly created image once its rendered.
2006-09-25 19:35:43 +00:00
Campbell Barton
4437c27091 forgot to add 'island margin' - so you can have a gap around each island so they dont bleed ento eachother once baked into a texture. 2006-09-25 16:37:37 +00:00
Campbell Barton
a3e3025663 Optimized merging uv islands when packing by testing only intersections of boundry uv edges.
updated to use more recent changes to the bpython api and some other cleanups.
2006-09-25 16:24:07 +00:00
Campbell Barton
7fce181d11 BPyMessages - added "Save over" message for scripts to use, so as not to overwrite files.
import_obj - comments, docstring additions, cleanup.

OBJ export: -renamed export_obj
 faster edge exporting (use edges LOOSE flag rather then finding zero face user edges)
 check for file before overwriting
 use object iterators
2006-09-25 05:12:37 +00:00
Campbell Barton
a2ecfa8cc9 adding a script that copies material colors to vertex colors,
usefull when consolidating 3d models from formats that use many materials for different colors, into 1 object with fewer materials.
2006-09-21 01:36:09 +00:00
Campbell Barton
2446288ad3 fix in MTL library loading, if none is spesified the same name as the OBJ is used. 2006-09-20 17:11:45 +00:00
Campbell Barton
ac160e56ae makes image paths relative even if the files referenced exist.
this functionality might be better in a seperate script.
2006-09-20 09:44:41 +00:00
Campbell Barton
360d7a1083 OBJ Import should now meet up to the python standards
http://mediawiki.blender.org/index.php/ScriptDev/Guidelines

* Recursive search was enabled by default, if your OBJ happened to be at root path, loading the OBJ could take ages. Made recursive searching optional.
* MAX's MTL exporter replaces spaces with underscores, image loading checks for this and loads the name with spaces if the one with underscores dosnt exist. not realy a problem with the importer but annoying to manually replace lots of images.
2006-09-20 05:03:53 +00:00
Campbell Barton
fd0628c6db Update and add a new script -
Makes the mesh solid by creating a second skin of a set width
works with UV's and Vertex col's but not weights at the moment.
2006-09-20 02:43:09 +00:00
Campbell Barton
7494a3c966 error in place holder creation function was making the image twice, effected 3ds and obj importers 2006-09-18 14:08:04 +00:00
Campbell Barton
d89240ba12 added mesh_create_derived_view(ob) to DerivedMesh.c
exactly the same as mesh_create_derived_render(ob) except it uses the view modifier settings.

Added an optional arg to getFromObject to 'render' so you can choose to get the mesh displayed in the 3d view or generate one with render settings.
Solved bug 4612 getFromObject now works with soft body meshes (error was caused by getting the derived mesh from a copy of the object)

removed workaround for softbody bug in object_apply_def.py
2006-09-17 05:15:56 +00:00
Campbell Barton
cca79d086a changed the defaults for image edit. will open the image instantly with no options. hold shift for setting the application. 2006-09-15 10:21:25 +00:00
Campbell Barton
cfc9e31f04 fixed error fix in obj import mesh splitting. 2006-09-09 13:44:27 +00:00
Campbell Barton
1b6cf3e6ee Enabled threads for rendering. 2006-09-08 16:41:35 +00:00
Campbell Barton
c5fe47fc96 Script that bakes procedural textures into an image.
uses TexMesh to get the same values as rendered procedural textures.
2006-09-08 15:28:33 +00:00
Campbell Barton
352d8cd02d removed inverted and normalized from py scripts 2006-09-07 14:15:10 +00:00
Campbell Barton
f17e9a6cb9 resolved invalid bounding box from the object by freeing a new meshes bounding box.
added back bound box constraint to obj import (many OBJs have values outside the defulat clipping range)

BPyRender.py was missing a flag assignment.
2006-09-05 06:45:39 +00:00
Tom Musgrove
289105bcd9 ==blender2cal3d update==
unneeded line in the script was keeping it from showing up in the menus
2006-09-04 21:33:02 +00:00
Campbell Barton
a2b0bca7f7 removing old obj importer 2006-09-04 04:25:24 +00:00
Campbell Barton
ebde667956 rewrite of the obj importer,
The original obj importer was ok but it gradually got slower
as it had to support quirks of rare files.

This importer supports these quirks without bad workarounds and ~250 less lines.

* Moved from NMesh to Mesh
* Import smooth groups as hard edges
* Import Lines from sketchup (Thanks Wavk)
* Uses less memory
* faster (On a 70meg poser test model, benchmarked from 130sec to 41.2sec)

Not yet supported from the old importer-
* Scaling down to a bounding area
* Importing multiple obj's at once
* Using existing materials in the .blend
* Importing as a group instance.
2006-09-04 04:23:55 +00:00
Campbell Barton
9eae6278fc Silly mistake, made adding edges raise an exception. 2006-08-29 23:05:13 +00:00
Campbell Barton
24a2e90f82 Improved tri to quad converting.
added include to poseobject.c
2006-08-29 09:43:38 +00:00
Campbell Barton
e10613c7f7 cleanup and some speedups with assigning materials 2006-08-25 18:05:05 +00:00
Campbell Barton
62b8cad660 simplified 3ds mesh importing by storing verts and faces in a list rather then a mesh, before making the final mesh
also make use of meshes faces.extend() indexList option- which means lots of checking can be removed.

indexList is not relyable at the moment so some files wont import but this will be fixed.
2006-08-25 09:10:06 +00:00
Chris Want
1f68dfb499 A mesh from the Blender python Mesh module can sometimes have
a materials array with entries that are 'None'. Added some code
to check for this perverse situation.
2006-08-16 01:06:38 +00:00
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
567f1bef14 Adding a cookie cutter that can cut multiple polyline meshes into multiple meshes into a mesh - allong the view axis.
leaving the faces inside the polyline selected.
UV's are maintained but not vertex colors at the moment.
2006-08-09 11:39:35 +00:00
Tom Musgrove
97e259a827 ==unweld script update==
spelling and grammatical changes..
2006-08-07 19:04:17 +00:00
Tom Musgrove
aaa7182aea ==unweld script update==
unweld script updated by JMS, brings script in line with the draft scripting guidelines thanks
2006-08-07 18:40:58 +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
e1828bbb63 added rotate 90d to obj export as default to match importer 2006-08-06 11:32:12 +00:00
Campbell Barton
0c748032a6 benchmark bvh output..
spellchecked/expanded comments in armature_symetry.py and tweaked functionality
2006-08-04 12:48:29 +00:00
Campbell Barton
4ae12081c0 found that the rotation order is as defined in the BVH file, store and apply the rotations in this order. 2006-08-04 08:53:28 +00:00
Campbell Barton
f9fb0cf9b0 Option to support non standard BVH files. (alternate rotation order) 2006-08-03 09:16:28 +00:00
Campbell Barton
1d05319e29 materials should render after import without having to enable texface. 2006-08-02 21:43:45 +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
19f3550eab Mostly finished work on bvh import.
before funky stuff like IPO bezier curve fitting etc are added.

* Fixed problem with zero length bones being removed.
* Sped up import by writing to ipo curves rather then inserting keyframes
* detect linear rate of change and ommit unneeded ipo points.
* cleanup
2006-08-01 18:28:42 +00:00
Campbell Barton
4e261039a9 Adding back bvh2arm.py - There is a problem when working with BVH files (small but noticable rotation error)
but aparently its still usefull for empties and Jean assures me the bug will be fixed.
2006-08-01 08:20:19 +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
876885df45 rewrote bvh import to be modular,
BVHs can now be imported as armatures pose animations as well as empties.
2006-07-31 09:12:18 +00:00
Campbell Barton
6ca1c28837 Cleaned up and made a bit more efficient.
Now multiplys with existing colors.
2006-07-30 12:28:20 +00:00
Campbell Barton
96b2c0912d Fixed some logical errors and improved skinning method some more. 2006-07-30 05:48:28 +00:00
Campbell Barton
acbc574534 problem reported with making aeroplane wings,
attempted to fix the filling logic, was 50% now is 80% -  not quite up to snuff still.
2006-07-29 19:32:07 +00:00
Campbell Barton
0672038093 Fixed a bug in obj_import
would load faces
f 0 1 2 \
  3 4 5

but not
f 0 1 2\
  3 4 5

Updated JMS's hotkeys script
2006-07-29 17:22:56 +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
9054a81eb2 Big speedup, 2-3x, from better mesh importing. 2006-07-28 19:09:09 +00:00