Commit Graph

416 Commits

Author SHA1 Message Date
Campbell Barton
5841ba740a dont remove dummy 0 index verts to workaround me.verts.delete([...]) being buggy (since tface > mtface conversion) 2006-12-11 23:03:14 +00:00
Campbell Barton
9c3cacd283 added the flag group_exclusive to material
added restrictDraw/Select/Render to objects in python
updated group and scene docs for last commit
made 3ds import use new scn.objects rather then Object.New() - (removed import as instance for now)
fixes off import error from this report http://blenderartists.org/forum/showthread.php?t=84182
2006-12-11 08:57:39 +00:00
Campbell Barton
d9c68666f3 Adding a function that gets a list of polylines from a curve object
curve2vecs(ob, WORLDSPACE= True):
'''
Takes a curve object and returns a list of vec lists (polylines)
one list per curve

This is usefull as a way to get a polyline per curve
so as not to have to deal with the spline types directly
'''
2006-12-07 15:22:55 +00:00
Campbell Barton
93e920aea9 UV islands are now detected by edge connection (was using verts) - added support for seams to delimit UV islands. 2006-12-02 09:44:40 +00:00
Campbell Barton
4b982acf17 Made work with new vertex colors 2006-11-30 21:32:32 +00:00
Campbell Barton
0d5a152094 request from malefico - select faces based on there weight in the active group.
Access from the face select menu
2006-11-28 21:26:00 +00:00
Campbell Barton
a314527e20 when importing am OBJ referencing an unknown image (PSD in linux for eg) - it creates a dummy image.
checking the .depth of this dummy image raised an error. now a check for has_data is done.
2006-11-27 23:59:53 +00:00
Joseph Eagar
7101e76d9c =md2_export.py small fix=
There was an integer division error in md2_export.py,
where values were getting clamped to either 0 or 1.
Fixed it by putting the appropriate vars in float().

Reported by deltab on IRC.
2006-11-27 01:05:44 +00:00
Campbell Barton
703647d08b previous commit to fix this script with VCols didnt work, should be ok now. 2006-11-26 23:47:53 +00:00
Campbell Barton
b36bafe524 removing image bake scripts to make room for Ton's built in baking stuff. 2006-11-26 19:08:19 +00:00
Campbell Barton
d2c482115e minor change so other scripts can call image_edit.edit_extern(img) to edit an image in the gimp, photoshop etc. 2006-11-26 18:40:04 +00:00
Ed Halley
8292e4ac1a Was crashing the import_obj script when using Python 2.3.
Python 2.4+ supports large list processing with generators, but
Python 2.3 will break if you use that syntax.  Until we depend on
the newer versions, I have commented out the generator syntax and
only use the list-comprehension type instead.
2006-11-25 17:34:57 +00:00
Campbell Barton
909cb06dfe modified to support new vcol operation (separate from tface)
updated name and tooltip
minor fixes
2006-11-24 07:35:53 +00:00
Ken Hughes
7b9fac49f5 Bugfix #5289: "Shape Wizard Widget" script was using non-existant key:
changed so "Key 0" is substituted for "Basis".  This may not be correct...
Also, fix to make ob.setEuler() accept a tuple again.
2006-11-23 00:28:09 +00:00
Chris Want
27c42ee062 A fix for an indentation error, and better handling of faces with
images when materials are defined for the face (i.e., only use
the image as a texture in this case if 'Texface' is selected
for the material).
2006-11-17 16:11:03 +00:00
Campbell Barton
a84f60a3bd fixed error that was caused by 2 vertex loops center being 0.0 distance apart, also made the python 2.3 syntax default. 2006-11-15 21:12:53 +00:00
Martin Poirier
51fa185ec5 == Script: UV Export ==
* SVG export support (thanks to Jarod's patch in the tracker)
* Faster tga export (from Jarod's patch too)
* Fixes from the review thread and the wiki:
** No longer adds the extension (tga or svg) if already there
** Adds the object name in between the filename and extension (and not after the extension if it was already present)
** Renamed options here and there.
2006-11-14 00:56:46 +00:00
Campbell Barton
26ef99157e made mesh.getFromObject() accept a python object as well as the object name.
accepting the name only was causing big problems when exporting library data, because duplicate names are possible the wrong data was exporting.
2006-11-13 17:37:01 +00:00
Chris Want
05c59da48f Fix for bug #4922
The VRML97 exporter was rounding a lot of stuff to three decimal points.
This is silly, since the spec says single-precision floats are used for
most things, which gives about 7 decimal points precision.
2006-11-11 19:12:43 +00:00
Campbell Barton
daec99c470 new image names were being created with 2 ..'s
added a function to BPyMesh.py to get faces in linked groups (like split by loose parts) - but returns lists of faces only.
2006-11-10 02:23:30 +00:00
Campbell Barton
2dcf23c327 added Jiri as a contributer to the obj importer
Added a new script - 'Dump All Images to Path'

This script copies all the images used by 1 blend to a spesified path and references the new images from Blender
Usefull for moving projects between computers or when you reference many images. naming collisions and multiple images using the same image path are delt with properly only creating new image names when needed.

Blender images will reference the newly copied files - So be mindfull when you save your blend after running the script.

Notes, images with the path "Untitled will be ignored"

Image path collisions are managed by enumerating the path names so images will never be overwritten at the target path.
2006-11-03 20:04:56 +00:00
Campbell Barton
5ee546f053 added batch import back in - Hold shift as you click import 2006-11-02 17:42:30 +00:00
Campbell Barton
0dbac3ab69 attempt to make zero area faces result in NAN or INF loc verts happen less. 2006-11-02 00:13:38 +00:00
Campbell Barton
55d1618990 check for devide by zero error 2006-10-30 16:01:38 +00:00
Campbell Barton
8177125b0f An arg was left in that should have been removed, raised an error for reflect MTL files. 2006-10-29 19:56:52 +00:00
Campbell Barton
9b7125fafc added the option to rename objects to their DupGroups name. 2006-10-25 01:32:46 +00:00
Campbell Barton
23eb8b7a1f added the option to poly reduce all visible selected objects 2006-10-21 19:38:42 +00:00
Campbell Barton
a43bfad9e5 removed this script since Briggs ported it to C 2006-10-20 00:17:34 +00:00
Campbell Barton
1730b7b41d Fix from Bob Holcomb, some materials could be floating point value, I have only had this from Cararra generated 3ds files. 2006-10-19 21:56:11 +00:00
Campbell Barton
7a88ffd922 fix for [ #5093 ] OBJ importer gives errors on usage
extending a list was using a python 2.4 compatible syntax but failed with 2.3
2006-10-13 05:48:50 +00:00
Campbell Barton
de3c54569d BPyRender sets renderlayers right now
Object groups were get/set without user counts changeing.
2006-10-11 10:33:34 +00:00
Campbell Barton
27dc45ba24 BPyRender.imageFromObjectsOrtho's now sets all layers visible,
an error in Scene.c - scn.Layers disallowd all layer bits to be set.

made image_billboard.py rotate all images to be verticle for more efficient packing, added the option not to pack resulting images into 1.
2006-10-09 04:29:24 +00:00
Campbell Barton
74f2727a9e Adding a new script. heres the docstring.
________________________
Render Billboard Script
This can texture a simple billboard mesh from any number of selected objects.

Renders objects in the selection to quad faces on the active mesh.

Usage
* Light your model or enable the shadless flag so it is visible
* Make a low poly mesh out of quads with 90d corners. (this will be you billboard mesh)
* Select the model and any lamps that light it
* Select the billboard mesh so that it is active
* Run this script, Adjust settings such as image size or oversampling.
* Select a place to save the PNG image.
* Once the script has finished running return to the 3d view by pressing Shift+F5
* To see the newly applied textures change the drawtype to 'Textured Solid'
2006-10-08 17:05:57 +00:00
Campbell Barton
29daa64095 removed unusued vars from Geometry.c
uv_archimap still had python based line intersect

added plane2matrix function to BPyMathutils
added an optional arg to imageFromObjectsOrtho - camera_matrix
camera_matrix can be used to define a plane in 3d space where X and Y scale is used to set the width and height of the area to render.
2006-10-08 10:51:38 +00:00
Campbell Barton
30d207e650 Added python func Blender.Geometry.LineIntersect2D(v1,v2,v3,v4)
updated archimap and cookie cutter to use it, removed python version from BPyMathutils
archimap island merging is noticibly faster
2006-10-07 04:56:36 +00:00
Campbell Barton
fe50037f7e images wernt being applied to textures on import
added alpha support for material and texface. so teh faces transp mode is set as well as the Alpha and ztransp settings for the material
2006-10-05 11:15:22 +00:00
Campbell Barton
dac52bc6e1 Slw_sl fixed start/end frame export 2006-10-05 06:44:27 +00:00
Campbell Barton
55d49ffda3 pup block was being called too late and frames were not being set on export 2006-10-05 05:59:03 +00:00
Campbell Barton
3dddba4e06 updated to use some of the new additions to vector and minor speedups,
removed edge margin option (uv island margin should be enough)
2006-10-03 16:46:02 +00:00
Campbell Barton
323cc790fa added a BPyObject.py with 1 function- getDerivedObjects, gets all dupliObjects and can optionaly get a mesh generated from the objects particles.
export obj can now export duplis and particles as well as faster face exporting and other small cleanups/speedups.
2006-10-01 14:02:51 +00:00
Campbell Barton
22ce0faffe export matrix was wrong, cleanup import, more memory efficient and import the rest data to an unused key. 2006-09-28 04:45:08 +00:00
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