Commit Graph

7914 Commits

Author SHA1 Message Date
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
Geoffrey Bantle
bd6e5d20c7 -> Sanity Check for Selection History
Some operations like edge loop deselect would cause selection history
to become invalid. Added a sanity check to countall() to try and catch
these when they happen.
2006-09-28 02:37:35 +00:00
Geoffrey Bantle
b4e97c01ff -> Enter/Exit editmode wait cursor flags
The wait cursor was being called during editmode enter and exit for meshes.
This was a problem for several reasons. First of all, python modules like
Mesh now make use of editmode features. These methods that wrap editmode
tools may be called many times during the execution of a script
and lead to the wait cursor rapidly flickering on and off.

The other problem was that the wait cursor wasn't being called for editmode
enter and exit of all data types. This is unified now.

-New Arguments

enter_editmode() should be passed a nonzero integer or simply EM_WAITCURSOR
if the wait cursor is desired. Currently only the python API passes a '0'
to enter_editmode()

exit_editmode() has several options and they are passed in as the bitflags
EM_FREEDATA, EM_FREEUNDO and EM_WAITCURSOR. These flags are defined in
BDR_editobject.h.
2006-09-28 01:55:44 +00:00
Geoffrey Bantle
d86af04e9a -> Add/Delete Scene fix
countall() wasn't being called when scenes were being added/deleted.
This caused the info header to temporarily display incorrect information
about scene statistics.
2006-09-27 23:39:19 +00:00
Brecht Van Lommel
9dce6081c0 Bugfix for a recent commit: live unwrapping behaved badly because
pinned uv charts were being auto rotated, they should just stay fixed.
2006-09-27 19:45:38 +00:00
Campbell Barton
0cd7ee76a4 made fgon edges not draw lengths with length draw option 2006-09-27 18:08:54 +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
Jens Ole Wund
2d11fbe192 fix for homegrown bug in softbody rigidity
springs inserted twice caused unreal stiffness in ODEs
-> bad performance killers
2006-09-27 06:59:27 +00:00
Geoffrey Bantle
a39ca26700 -> Misspelled tooltip for 'Enable Script Links'
Fixed a minor mispelling in the tooltip, 'and' was written as 'amd'.
2006-09-27 06:40:10 +00:00
Jens Ole Wund
d0899c2642 Rigidity only for meshes 2006-09-26 17:16:23 +00:00
Jens Ole Wund
d8874df09c New softbody option: adjustable rigidity.
Gives local structure stability for though fabrics, thin steelplates ..
even suzanne gets pretty crash resistant that way.
If non zero it not only adds diagonals but all other "2edge-wide" springs
so it somehow replaces stiff quads for meshes too.
2006-09-26 12:53:57 +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
Brecht Van Lommel
6587c3c6ba Some UV/Image window changes:
- A new Save image function, next to the existing Save As.
- Shortcut keys Alt+S, Alt+R, Alt+O and Alt+N for Save, Reload, Open
  and New image respectively, consistent with the text editor window.
- Hide Select and UVs menus when UV editing isn't active.
- Removed duplicate and unused code, also moved some functions.
2006-09-25 22:00:52 +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
Brecht Van Lommel
7e4f1425b7 Fix for bug #4828: random rotations of uv charts after unwrapping.
This never worked that well, so now after unwrapping, uv charts are
rotated to fit in their smallest enclosing rectangle. This should give
the expected behavior in the most common cases.
2006-09-25 15:40:26 +00:00
Brecht Van Lommel
99c7e3cb9e Last commit broke the smear brush, thanks Jens for spotting this. 2006-09-25 12:30:12 +00:00
Matt Ebb
01e7f02dcd * This should have come along with the proportional edit commit. tsk tsk. 2006-09-25 11:33:53 +00:00
Ton Roosendaal
2662c7ae79 Bugfix #5034
When using new Shadowbuffer option "Auto clip", the clipping planes could
become so narrow that sampling code - using ints - could result in
overflows (sign flip). This especially for small shadow buffers with high
bias values.

This fix adds an extra check in shadow sampling for such overflows.
2006-09-25 09:35:04 +00:00
Matt Ebb
aec9f8969c * tweak to outliner line colour 2006-09-25 07:59:50 +00:00
Matt Ebb
6b775741c0 * Gave curve transforms Tilt and Shrink/Fatten a home in the v3d menu 2006-09-25 06:11:16 +00:00
Matt Ebb
2e7aa1dbf5 * Proportional edit mode 'random' falloff
This is another proportional edit falloff that slightly randomises the
influence. It's not strictly random, it's blended with linear falloff so that
it's a bit smoother. The nice thing is that it works with all transforms, axis
locking etc, including the special ones like to sphere, shrink/fatten/etc. It
can be used for all sorts of things like roughening surfaces. I most recently
used it to add a bit of randomness to the folds of some cloth. I
made a short demo video here: http://mke3.net/blender/etc/prop_random-h264.mov

Also included nicer icons for the falloff types.
2006-09-25 05:15:19 +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
Alfredo de Greef
db7c3d3271 A possible problem was noted by Cyril Brulebois regarding copyright issues
with regards to the noise functions in yafray based on Ken Musgrave's
original code.
I had left the 'Copyright' notice in the comments, and according to
Cyril Brulebois this is a problem. In fact, from what I understand this
makes it even impossible to use or modify the code in other software.
But since it is not a verbatim copy of the code but rather based on Musgrave's
work, he suggested I change it to explicitely state that it is in fact
based on the code from the 'Texturing & Modeling' book.
And since the yafray code is in turn based on the blender code, I better
adapt the blender code too.

This reminded me that I also have forgotten to include the copyright notice
in the mersenne twister rng code I used for the Python Noise module.
This does clearly state to include the original notice with any resdistributed
code, in modified form or not. So I added that too.

I hope that solves the problems.
2006-09-25 04:54:45 +00:00
Matt Ebb
71284959d5 * Added backwards compat check for curve radius value, so old files act properly. 2006-09-25 03:22:54 +00:00
Matt Ebb
7639f0890a * Updated the auto-generated UV test image (Image Editor -> Image -> New). The
previous one was ok as a quick fix during orange and showed distortion obviously
but it was kind of extreme, and I'd rather not be blamed for causing blindness
or brain tumours because of it. This pattern is nicer, and still shows
distortion and its location on the map well.
2006-09-25 03:15:58 +00:00
Brecht Van Lommel
ef7200741b Basic pressure sensitivity support in imagepaint, for opacity, size,
falloff and spacing. Click the button labeled "P" next to the sliders.
Works best for opacity, other options can give poor quality strokes in
some cases. Also performance needs to be improved.

Remember, works only on X11 and Mac, no Windows support for tablets yet.
2006-09-24 19:29:25 +00:00
Campbell Barton
7f7f35d1ca fixed mistakes and warnings in previous commit. 2006-09-24 09:21:18 +00:00
Ton Roosendaal
f6a6ad5688 New render feature:
If you define multiple RenderLayers with different view-layers, these
view-layers are rendered entirely, not looking at the faces that are
invisible. This allows layered composite, but only when geometry does
not intersect or overlap partially.

This new Renderlayer option "All Z values" will fill in the Z of not
visible faces (in the Scene view-layers) as well, which then allows
masking out as if these faces were set to Material option "Env".

Here's an example composite to show the effect:

Two cubes, in view-layers 1 and 2, and rendered in 2 RenderLayers:
http://www.blender.org/bf/all_z0.jpg

Same scene, but with both RenderLayers set to "All Z values":
http://www.blender.org/bf/all_z.jpg
2006-09-24 09:21:04 +00:00
Campbell Barton
e8495d1fdd Extra generic errors for Scene, Groups and Metaballs to raise errors when trying to do anything with a python objects thats had its data removed in Blender.
Added to existing scn.objects
scn.objects.active    (get/set the active object for the scene)

scn.objects.selected    - an iterator that only uses selected objects
scn.objects.context    - an iterator on objects in the user context (visible in the current 3d views layer and selected)
These are the same type as scn.objects but .add() .remove() .new() .active etc raise errors. so scn.objects.selected.add() will raise an error.

Made nested loops possible with scn.objects, metaball.elements and ob.modifiers, by initializing the iter value as NULL and creating copys of the pyobject when _getIter() is called if ->iter is not NULL.
This is how pythons xrange() works.
2006-09-24 08:30:38 +00:00
Geoffrey Bantle
e136fe0acb -> Adjustable Tolerance for Knife Vertex Cutting
Previously had Vertex snapping in knife tool adjustable by the 'threshold'
value in the 'Mesh Tools' panel. This was actually a misunderstanding on
my part of a user request (oops). What was really needed was to make the
sensitivity of intersection code for vertex cutting adjustable. Vertex Snap
is now set at same tolerance as vertex selection.
2006-09-24 05:14:29 +00:00
Campbell Barton
d728cd1a52 new read only object property to be used for the collada exporter
ob.parentType and a constant dict Blender.Object.ParentTypes
2006-09-23 15:07:03 +00:00
Roland Hess
3c8fe64910 This commit adds backwards compatability for the new floor constraint
feature. Old files that had "sticky" set would not show "sticky" under
the new system. Not that anyone ever actually used "sticky".

Also, these commits only add support for rotated external target objects,
not target bones inside the same armature.
2006-09-22 16:42:39 +00:00
Roland Hess
4725ca6c02 This commit adds local target rotation support to the floor constraint,
making it much more useful. Requested and taunted for frequently by
Plumiferos folks. Click on "Use Rot" to take target object rotations
into account.

Good for using rotated empties, etc., as a sloped floor.
2006-09-22 15:57:58 +00:00
Campbell Barton
3d3b64768d Mesh iterators (me.faces, me.edges, me.verts, face and edge iterator) store the iterator progress in the python object.
This made nested loops with the same python object mess up.
eg-
faces= me.faces
for f1 in faces:
  for f2 in faces:
    print f1.index,f2.index

This didnt work, fixed by initializing the iter value at -1, so any greater value will create a new BPyObject with its own iter value.
once iteration is finished, its set back to -1.

Also made face and edges iter value a char instead of an int to save some memory.
2006-09-22 10:08:41 +00:00
Campbell Barton
d82f1f5f91 from looking at patch 4934 made all user preference paths settable with Blender.Set('val', data), also added exception errors which were on the todo.
image.filename was being limited to FILE_MAXDIR rather then FILE_MAXDIR + FILE_MAXFILE when setting.
2006-09-21 18:25:40 +00:00
Campbell Barton
95c185c4c5 Setting the image name was raising an error. 2006-09-21 17:03:24 +00:00
Campbell Barton
3a77b352a4 one liner,
editmode select grouped, face area and perimeter comparing didnt work sometimes, simpler comparison that still scales well
2006-09-21 13:53:32 +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
78e1426835 removed warning in EXPP_setVec3Clamped 2006-09-20 17:30:47 +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
27848c8f08 order of case statement was messed up with previous commit. 2006-09-19 10:52:56 +00:00
Geoffrey Bantle
e7874b3ff0 ->Knife Midpoint and Vertex Cutting
Cutting through vertices and vertex snap was only supported in
'knife exact' mode. Now works for 'Knife Midpoint' as well.
(Multicut and vertex cutting would require N-Gons)
2006-09-19 00:08:09 +00:00
Ton Roosendaal
ab2c57a29d Maximum amount of keys in a ColorBand now is 32.
This is static array stuff... could be dynamic once.
2006-09-18 15:32:11 +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
Ton Roosendaal
8e7e7e209a Bugfix #4999 part 2
Sky texture mapping option "Sphere" or "Tube" map now correctly maps to
world space as well, so a camera orientation or mirroring works fine.
2006-09-18 12:53:52 +00:00