Commit Graph

134 Commits

Author SHA1 Message Date
Campbell Barton
bc15d06cfe * own error, importer would never load images.
* moved from NMesh to Mesh
* added more error checking.
* tested with 1660 lightwave models
* faster dictionary usage.

BPyImage - disallowed recursive searching of '/' or a windows drive letter.
2007-02-08 00:27:01 +00:00
Campbell Barton
35e96bc991 added messages to scripts, stopping them from modifying multires meshes.
object_cookie_cutter - can now also use curves to cut holes in a mesh.
2007-02-06 11:16:49 +00:00
Campbell Barton
5817876307 fixed nieve use of type()..
type(foo) == type(list()) can be done as
type(foo) == list:
2007-02-01 05:27:49 +00:00
Campbell Barton
dcc834f3fa updated render settings to support recent changes.
options like saveBuffers are available from Python and threads can be set from 1 to 8
usefull for python based renderfarms.
2007-01-30 03:02:58 +00:00
Campbell Barton
803d66a3a5 removed copy_facedata_multilayer from BPyMesh since it changes the selection and flips the faces (needed for solidify) but not for general purpose use. 2007-01-29 06:56:30 +00:00
Campbell Barton
996294e18a fixed own bug indroduced when switching to use f.edge_keys
MultiUV/Color support - all layers are copied to new faces. as well as hole filling faces.
2007-01-29 06:38:30 +00:00
Campbell Barton
dc00d9c5de set the render aspect correctly when rendering non square images. 2007-01-16 06:39:15 +00:00
Campbell Barton
54863a2fef error, camera scale couldnt be set. bpyrender now sets ortho properly 2007-01-12 00:31:18 +00:00
Campbell Barton
3c578fbe12 tested export scripts with a large scene and resolved errors that came up as well as some speedups- mostly problems with lightwave_export 2007-01-11 09:39:16 +00:00
Tom Musgrove
20413f17bb = dxf update =
update by the script author - may have killed some changes cambo did to the previous version but the layout of the script is too significantly different to merge them.
2007-01-10 11:37:19 +00:00
Campbell Barton
e2da632f8f ply export patch 5576 applied with parts rewritten.
BPyMesh getMeshFromObject bugfix in some cases non mesh object types could be a problem.
2007-01-09 16:01:38 +00:00
Campbell Barton
95a202322d made python 2.3 compat again. 2007-01-07 07:33:40 +00:00
Campbell Barton
330efd46fa standard set of minor improvements, tho this is a good script and not much to change.
faster dict/list operations.
use layer flags ratehr then lists.
2007-01-05 03:49:54 +00:00
Tom Musgrove
e586ec7bcd ==dxf import script ==
script for DXF import by kitsu (Ed Blake) - provide superior import to our native DXF import for many files
2007-01-05 00:51:12 +00:00
Campbell Barton
60544bb7cc JMS's latest SVG importer with his compatibility fixes and optimizations.
http://blenderartists.org/forum/showthread.php?t=66207
2006-12-29 11:09:29 +00:00
Campbell Barton
ab06e52343 Mech cleanup use new edge_keys
continual script stuff, minor stuff..

fix for bad return in group.
Added back group.objects.append/remove but print deprectaed warning. also some epydoc changes.
2006-12-28 05:00:35 +00:00
Campbell Barton
7b93fff204 Added a function to BPyMesh - getFaceLoopEdges(faces, seams=[])
returns all face loops as a list of their edge keys

Used this in uvcalc_follow_active_coords to speed it from 5.53sec to 0.098 on a 1000 face mesh.
2006-12-27 15:21:34 +00:00
Campbell Barton
84f60b19c8 weightpaint_clean, option to clean all vgroups
weightpaint_envelope_assign - can update active vgroup only
weightpaint_normalize - fixups
BKE_plugin_types - made the max length 32 ratehr then 16 so you can fill the text space in pupBlock
2006-12-27 09:31:28 +00:00
Campbell Barton
9197b25490 removed typo from Render
added extFromFormat to BPyRender to get the extension for a format
2006-12-22 07:07:20 +00:00
Campbell Barton
0325ee8f22 boxpack2d - python 2.3 compat fix, thanks brecht
gen_utils - needed to include BKE_library.h
off_import - use ed.key
2006-12-21 21:56:11 +00:00
Campbell Barton
08e3f8b1da Use ed.key and face.edge_keys to build connectivity data faster. 2006-12-17 00:08:05 +00:00
Campbell Barton
827cce172c update to Axiscopy, more error checking. basic functionality the same.
- Dont allow it to apply the matrix twice to a linked-dupe. (Same as Apply Loc/Size/Rot)
- Make sure that the source object is active, not just the first selected object.
- Use Mesh instead of NMesh.
- use mesh.transform(mat) rather then vert by vert vec*mat

Other scripts had pupBlock changes for better layout.
2006-12-15 22:14:33 +00:00
Campbell Barton
f631c2d49e new Uv-Calculation tool,
Click project, a nifty 3 click way to use a face to set a projection aurientation and then 2 more clicks for the U and V scales
with realtime updating as you move the mouse
should be faster then using view project all the time because you dont have to line the view up with the faces.
2006-12-14 19:36:37 +00:00
Campbell Barton
b995593eee faster sorting syntax in python, try/except for py 2.3 backwards compat
ls.sort(key = lambda v: v.foo)
rather then
  ls.sort(lambda a,b: cmp(a.foo, b.foo))
2006-12-14 14:53:32 +00:00
Campbell Barton
3a739d9bd2 fixed mouseViewRay in BPyWindow, was not applying the objects matrix to the mouse direction correctly.
VCol and Weight gradient work again.
2006-12-14 09:56:56 +00:00
Campbell Barton
09e4fa8f6a simple change, made
Changed...
  me = NMesh.GetRaw(ob.data.name)
To
  me = NMesh.GetRaw(ob.getData(name_only=1))

The line above converts the entire mesh to a python thick wrapper just to get its name, then only to that that same mesh again??
A lot of older scripts did this but theres no reason to do it.

in most (all?) cases..
  me = ob.data - should be ok, but theres a subtle difference and I dont want to break anything.

xfig_export, xsi_export and videoscape_export need error checking too.
2006-12-12 10:38:43 +00:00
Campbell Barton
6959e689be added many checks to uvcopy so it dosnt raise errors.
Minor changes to radiosity_export, updated to work with the new API (vertexColors MTFace)
obdatacopier - was getting the selection but not using it. made it ignore some read only properties.
BPyMesh - minor change: use face iterator rather then making a tuple()
2006-12-12 07:28:20 +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
4b982acf17 Made work with new vertex colors 2006-11-30 21:32:32 +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
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
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
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
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
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
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
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
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
1b6cf3e6ee Enabled threads for rendering. 2006-09-08 16:41:35 +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
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