Commit Graph

449 Commits

Author SHA1 Message Date
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
470f91b506 object_cookie_cutter - use edge keys
widgetwizard - made a mistake in last commit, works and also dosnt creash with bug.
https://projects.blender.org/tracker/index.php?func=detail&aid=5289&group_id=9&atid=125
Can others test so we can close?

Object_join was messing up object usercounts
2006-12-26 01:45:58 +00:00
Campbell Barton
8f010d2a58 mesh_skin updated to use ed.key, other minor cleanups.
updated the url in other scripts
2006-12-25 23:14:48 +00:00
Campbell Barton
604defd8f2 somehow pasted some text by mistake that raised an error. 2006-12-25 10:53:00 +00:00
Campbell Barton
859b7f207e modified scripts from using older/depricated Python API commands, deprecated scn.getChildren() in the docs. 2006-12-25 09:17:23 +00:00
Campbell Barton
7816c3ca07 adding this script that makes surrounding quads follow the mapping of the active face.
Added a new mode that generaly gives better results. "Loop Average" -
It gives good results for mapping roads that are more then just 1 quad wide.
Thanks LucidMonkey for pointing this out.

See the bottom of these docs.
http://mediawiki.blender.org/index.php/Scripts/Manual/UV_Calculate/Follow_active_quads
2006-12-23 10:42:34 +00:00
Campbell Barton
ea837b25e3 Added Draw.BeginAlign(), Draw.EndAlign()
added align to a few scripts where it looks nice.
2006-12-23 00:56:40 +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
60ebff78ab rewrote this script, it was the most out of date script and had some errors that are solved in the new script.
- moved to the weightpaint menu
- Use a group for envelope objects, no special names.
- Can use non mesh data for envalopes (anything that can be converted into a mesh - metaballs, text, surface)
- Dosnt rely on applying loc/size/rot for it to work properly
- Uses a good point-inside-mesh method (optimized with mesh and face bounding checks)
- uses Mesh instead of NMesh

todo, only update active vgroup
2006-12-22 00:19:45 +00:00
Campbell Barton
b3eb2d19a9 fix for bevel center as pointed out of the forums 2006-12-21 22:13:14 +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
04fc326371 Updated to use face.edge_keys,
fixed problem with merging islands not detecting an island in an island (wrong offset)
better island merging from user input
2006-12-21 04:20:07 +00:00
Joseph Eagar
6acadfe982 =IDProperties Python Test GUI Script update=
Stupid typo in script, you couldn't go into
a subgroup if it was the first property in 
the list.

Also, name collision code needed a little work.
This could result in overwriting properties
with the New button, which should instead
work as the rest of blender and add .XXX
to the name.
2006-12-17 01:08:47 +00:00
Joseph Eagar
36bfa35b9e =IDProperties Python update=
Added a test gui script for ID Properties.  To use,
just select ID Property Browser from the help menu.
You can browse, create and edit ID Properties
for several library block types.  Should be
fairly straightforward to use.

This is a test gui script; once an actual ID property
gui is implemented in blender it will be removed.  It
is *not* going to be in the release, obviously, so once
the real gui is implemented this script will be removed.
Also, this being a testing non-release script it seems to me
to be okay to add it without all the proper review stuff.  If
not, I can remove it.

I believe a test script is really, really needed to properly
test/review id properties, so I feel this is worth it.
2006-12-17 00:51:07 +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
711a1f8686 made editmode select grouped work with mixed selections - can show select grouped items for vert/edges/faces all at once.
bad comment in Axiscopy and spelling fix in export_obj
2006-12-16 10:39:08 +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
0369f08299 made the hax height of the clever_numbers 8 rather then 5, was wrapping on too many scripts.
bvh import was having errors on joints with no animation.
typo in uvcopy from my previous commit.
2006-12-15 20:22:59 +00:00
Campbell Barton
65d5b47a10 removing uvcalc_from_adjacent for review on Sunday's meeting.
image_dump2path is a stopgap util. We need to look into making Pack/Unpack use filenames, not IDnames. or have some other datamanagement utility.
2006-12-15 09:25:57 +00:00
Campbell Barton
e4340d1b58 Shift flips the current axis your draging.
uv's and mocified vertex coords are now in a big list rather then stored be faces, should be faster
2006-12-15 04:49:06 +00:00
Campbell Barton
0254065f3b Updated, optimizations and cleanup.
* accurate mouse to mapping using ray intersect,
* right clicking cancels and returns original coords

Doc is here
http://mediawiki.blender.org/index.php/Scripts/Manual/UV_Calculate/Click_project_from_face
2006-12-15 04:14:09 +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
c5fba51131 object_apply_def - use new BPy Object API funcs, no error in localview
off_export - minor changes
uv_archimap - cleanup. slightly slower but less duplicate code
uv_from_adjacent - nothing

BPY_menus - renamed py slot UvCalculation to UVCalculation to be consistant
2006-12-14 03:43:02 +00:00
Campbell Barton
824f391c75 mesh_edges2curves - edge key optimize and made use of scn.objects rather then Object.New()..
Object.py - passIndex mistake
2006-12-12 21:38:04 +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
848d3ae617 popup error if the active objects datatype cant have keys as well as other cases where it would quit,
use Mesh rather then NMesh to get the keyblock, enable restrictRender for driver objects.
2006-12-12 08:05:08 +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
8063417de5 bevel_center.py - avoid 2 python errors. (doing recursive before bevel, now UI prevents this)
console.py - if the scriptdir didnt exist it would do an error, now just ignore and dont try to do the console_autoexec.py stuff
doc_browser.py - If you typed in an invalid module it would give an error and exit, now have a message instead.
2006-12-12 05:29:42 +00:00
Campbell Barton
e22feb7d6e made the script work with no images, redraw when done and some optimizations. 2006-12-12 04:34:35 +00:00
Campbell Barton
97b6a65c74 Added a new Python slot "UvCalculate", moved Archimap and "UVs from adjacent" into it.
Removed 1/2 1/4 1/8 uv mapping options.
made re-evaluating the py-scripts dir use the wait cursor (could take a while at times)
2006-12-12 04:18:45 +00:00
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