Commit Graph

1356 Commits

Author SHA1 Message Date
Ken Hughes
e02e8b0c71 Bugfix #4979: unlinking mesh obdata which has shape keys was not decrementing
the IPO user reference count when the key's reference count reached zero.
2006-09-12 14:05:26 +00:00
Ken Hughes
c3b9a550a3 ===Python API===
Internal code clean-up: make M_Object_New use existing code instead of
duplicating the steps of object initialization/creation.
2006-09-11 17:55:52 +00:00
be4e97911d New: vertex-parent support for Lattice.
Works like vertex-parent for Mesh and Curve/Surface. Select one or three
vertices in edit mode, and use CTRL+Select to select another object.
Then press CTRL+P.
2006-09-08 12:05:36 +00:00
824fbff02c Fix to enable copying of the vertex group field for the Curve, Lattice,
Armature and Hook modifiers, and the flag field for the Mirror modifier. These
modifiers should all be copied correctly now.

This fix also means that converting modifiers to mesh with Alt-C now works
correctly (the convertmenu function copies the modifers before applying them,
so it wasn't always giving correct results for the above modifiers before).

The convertmenu function has also been changed to use DM_to_mesh instead of
converting to DispListMesh and using displistmesh_to_mesh, which means that
extra mesh data such as dverts is preserved.
2006-09-08 01:05:57 +00:00
e3d1a6ea9b Two bugfixes.
My commit to fix weightpaint display (revision 1.125 of DerivedMesh.c) broke
normal recalculation for meshes which have only deform modifiers applied.
This commit fixes that by adding calls to CDDM_calc_normals in the appropriate
places.

The DM_from_template and DM_init functions checked for numVerts > 0 before
initialising the DerivedMesh's custom data layers. This was something of a
hack intended to allow DerivedMesh creation functions to initialise default
function pointers without initialising custom data layers (by passing a 0 for
the numVerts parameter). It is unneeded now that DM_init_funcs is present, and
causes memory deallocation warnings later on when the number of vertices
really is 0, so it has been removed.
2006-09-07 06:44:25 +00:00
e7d6537f1c Added support for threadsafe MEM_mallocN/MEM_freeN in the guardedalloc
module itself, replacing the special MEM_mallocT/MEM_freeT functions.
Mutex locking is only enabled when threads are running.

There was no good reason to have these separate, it just led to ugly
hacks when calling functions with non-threadsafe malloc from threads.
2006-09-06 19:13:23 +00:00
02baf30e55 New feature: imporant missing option for use of Libraries: access to to the
file path where library is read from.

In Outliner, choose new view mode "Libraries". A ctrl+click on the library
name then allows to change the file name or path. Note that when you change
the file name, nothing is being re-read or re-linked. Only after saving the
.blend file and reading it back the new library is used.

This feature allows to cleanup library usage. You can make files relative,
or reorganize a project. Just keep in mind that you cannot use this feature
to fix .blend files that link to non-existing other files. That because the
lost data is actually not read at all, so cannot be saved either.

Currently, library errors are only printed in the console... quite
important to keep track of when using Libraries.

Implementation note: this Outliner view mode can become expanded to a full
"Database view", showing something similar as SHIFT+F4 databrowse does now.
2006-09-06 09:51:30 +00:00
d4616b56ec Redesigned the EdgeSplit modifier's splitting algorithm to be better
structured and more maintainable. The old algorithm could leave the mesh in an
inconsistent state during recursive calls, making it quite fragile. The new
algorithm keeps the mesh in a consistent state, and should be more robust.

This commit fixes the issues EdgeSplit was having with non-manifold meshes
(bug #4946, also reported by several other people). EdgeSplit now works
correctly with all the test files I have.

This commit also fixes the BLI_ghash_remove function to correctly decrement
gh->nentries (the number of entries in the hashtable) on a successful removal.
2006-09-05 13:15:55 +00:00
a0547fb6a0 - bug fix: vertex and polygon layers needn't to exist in some situations 2006-09-05 09:28:46 +00:00
4603f452c2 Animation department feature request: support for vertex groups in Lattices
In a quick glance: (temp image)
http://www.blender.org/bf/rt.png

Main reason is that Lattices are useful a lot for Armature deformation.
Lattices just provide much more precise and interesting control. However,
with only bone envelopes it's very hard to use.

Working with Lattice vertex groups is nearly identical to Mesh:
- on CTRL+P 'make parent' you can choose the deform option now
- In editmode, the buttons to control vertex groups are available
- In outliner you can select vertexgroups too
- Deforming Lattices with Armatures has all options as for Mesh now.

Note:
- No WeightPaint has been added yet. To compensate, the editmode
  drawing for a Lattice with vertex group shows weight values for the active
  vertex group.
- Lattice editmode doesn't undo/redo weight editing yet.
- Softbody for Lattice still uses own vertex weights

Implementation notes:
- derivedmesh weight_to_rgb() is now exported to drawobject.c
- been doing cleanups in code (order of includes, var declarations, etc)
- weightpaint button handling now is generic

I've checked on Brecht's proposal for Custom Element data;
http://mediawiki.blender.org/index.php/BlenderDev/CustomElementData
It could have been used, but that would mean the existing code for
vertexgroup handling and armature deform couldn't be re-used. I guess this
is really a later todo.
2006-09-03 12:16:14 +00:00
ab5cc740d6 added the option to draw sharp edges.
had to make some room in the "Mesh Tools 1" panel,
removed "Center" - its alredy in the "Mesh Tools" panel, and grouped the "Normal" draw buttons.
At the moment mixing modes dosnt work, we will need to review this to see if its worth attempting.
2006-08-31 06:03:24 +00:00
090a010988 Fix for a bug where the Array modifier would freeze if it was set to "Fit To
Curve Length" or "Fixed Count" and the base mesh was scaled to 0 in edit mode
(could also happen while entering a numerical scale value like 0.25).

The problem was that the dist value could be almost 0, leading to a
ridiculously large duplicate count which would then cause memory allocation
to fail and the array modifier to get stuck in an almost infinite loop trying
to calculate the offset of the final copy. This commit fixes the problem
by checking that dist is greater than FLT_EPSILON before continuing.
2006-08-30 11:10:04 +00:00
cc6f92cb1a - bug fix: mesh object is created corectly after unsubscribing from
geometry node
 - merged patch from Ben Batt, subsurf modifier still doesn't work ...
    I will add list of edges to VGeomData structure
 - added some missing derivedmesh methods after merging of ben's gsoc
   projects
2006-08-30 10:55:46 +00:00
74e2b9810b Fix for bug #4912: Interface freeze with scaling object with subsurf + array
modifier.

The bug was caused by an endless loop in the Array modifier's calc_mapping
function. The loop worked under the assumption that there could not be sets
of vertices such that (for example) vertex A merges with vertex B and vertex
B merges with vertex A. As it turns out, this situation is possible, so the
loop got stuck going from A to B to A to B ad infinitum.

This commit fixes the problem by limiting the number of loop iterations with
the copy number for which the mapping is being calculated. This should also
give more correct results in general.
2006-08-30 07:35:19 +00:00
3a4e9d5946 My modifier stack commit broke weightpaint display for meshes with TFace
data, due to the temporary "Weight-coloured" TFace data being replaced by
the original before displaying. This commit fixes that by changing the type
of DerivedMesh calculated by mesh_calc_modifiers when no non-deforming
modifiers are applied from MeshDerivedMesh (which depends on the original
Mesh) to CDDerivedMesh (which doesn't depend on the original Mesh).
2006-08-30 03:05:30 +00:00
e0ec517d72 Patch #4199 (by David Millán, rewritte though)
Compositor: Rotate Node
It only delivers RGBA buffers for now. Also Image size is unaltered, so
parts get cropped away. Doesn't work with translation Node before this
node yet.
2006-08-29 14:32:06 +00:00
4745d01c16 Disabled some unused debugging functions that were causing unnecessary
compile warnings.
2006-08-29 12:49:49 +00:00
542ea1ca4c Changed the Displace modifier to calculate the intensity of a texture from
RGB values if they are returned by the texture function. This fixes an issue
reported by several people where Image textures gave no displacement unless
CalcAlpha was turned on.
2006-08-29 00:50:00 +00:00
12a732fc20 Added a VGroup input to the Armature modifier. This allows the user to specify
a vertex group which will modulate the influence of all bones in the armature.

This commit also tidies up the height of the modifier panels; they should all
have the same size margin now.
2006-08-28 21:56:58 +00:00
dd8c56e077 Added a BKE_bad_level_calls.h stub for NewBooleanDerivedMesh(). This fixes the
"undefined reference to NewBooleanDerivedMesh" error when building with make
(reported on IRC by Desoto, confirmed by Genscher2).
2006-08-28 16:22:55 +00:00
433f6c7043 Integration of the Google Summer of Code Modifier Stack Upgrade project. The
main features are:
* Modifiers can now be in any order in the modifier stack
* DerivedMesh now has a standard framework for custom element data to be passed
  through the stack with mesh data (being copied and interpolated as
  appropriate), so modifiers can access whatever data they need
* The modifier stack code has been refactored and a number of bugs have been
  removed
* The EdgeSplit modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/EdgeSplitModifier
* The DerivedMesh modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/DisplaceModifier
* The UVProject modifier has been added:
  http://mediawiki.blender.org/index.php/BlenderDev/UVProjectModifier

For more info, see:
http://mediawiki.blender.org/index.php/User:Artificer/ModifierStackUpgrade
(currently undergoing reorganisation)
2006-08-28 01:12:36 +00:00
b39f4b788d Texturepaint now supports all the imagepaint brush settings, with the
exception of the clone tool.

One level undo for image- and texturepaint, only storing those tiles
that changed.

Test to improve texturepaint performance using glTexSubImage2D, only
enabled with 2^n sized textures and mipmapping off. Painting a 2048x2048
texture is then pretty smooth here, as long as the geometry is not too
complex.
2006-08-27 13:29:00 +00:00
5387532526 Bugfix #4923
Particle distribution error when using Vertex Weights.
In the unlucky case the last face in a Mesh has no weight (zero), the code
that tries to distribute particles evenly accidentally could assign it
still a particle, because of the 'remainder' calculus.

Also only happens in cases where the remainder has a value.
So a workaround is also to increase/decrease amount of particles.
2006-08-27 11:55:32 +00:00
Chris Want
adc1333d85 Stubs for verse (maybe the verse files should be moved from src/
to blenkernel/intern/ ?)
2006-08-22 13:19:59 +00:00
Nathan Letwory
7fd8ce8156 * Patch #4909 by Joseph Eagar (joeedh)
- this patch adds verse support for SCons, which can be enabled by
    giving WITH_BF_VERSE=1, ie. on command-line
  - this patch also adds a custom lib dir possibility. From the patch description:


 "To set a custom ../lib dir, put LCGDIR="path to lib dir, including the platform folder name!" in your user-config.py."

* Fixed win32-vc-config.py so that it links to the proper library. Reported by Brandano.
2006-08-22 13:04:07 +00:00
f21f3cb290 - modified patch #4681, for scons compiling
of the fluidsim can now be disabled with the
	flag: BF_NO_ELBEEM='true', e.g. for irix systems.
	(The number of ifdefs from the original
	patch was reduced, and the defines are now
	only necessary when elbeem is switched off.)
- particle generation option is available again
2006-08-22 11:18:00 +00:00
0dcfab3e32 - bug fix, bug reported by Campbel, thanks! Keep in mind, that integration
of verse supports only sharing of mesh geometry now, you can't share
   vertex color, vertex weight, etc.
2006-08-21 13:19:18 +00:00
2ee42ac01e Huge commit: VERSE
- All code is in #ifdef ... #endif
 - Only make build system is supported and you have to add:
    export WITH_VERSE=true
   to user-def.mk file
 - Blender can share only mesh objects and bitmaps now
 - More informations can be found at wiki:
    http://mediawiki.blender.org/index.php/BlenderDev/VerseIntegrationToBlender
    http://mediawiki.blender.org/index.php/BlenderDev/VerseIntegrationToBlenderUserDoc

  I hope, that I didn't forget at anything
2006-08-20 15:22:56 +00:00
ffe630b452 Fixes for:
[ #4337 ] Cant refresh the C:\
[ #4710 ] Wrong paths in file selector under user prefs
[ #4353 ] Using ^ char + click on Open/Load = Blender crash

Details:

Fixes for root paths like C:\ on Windows, where Blender still used '/'.

Also contains fixes for relative paths:
- no relative paths for the default dirs (forced to absolute)
- message if using relative paths when .blend file hasn't been saved.

Lastly also added '.' for refresh in root paths. Windows
FindFirstFile/FindNextFile also return '.' and '..', but not in root paths like C:\
2006-08-20 14:41:13 +00:00
d5dee986ec Commit of 2006/08/18, in compositor, had a debug print in armature... 2006-08-20 11:45:27 +00:00
b894ee5b87 Bugfix #4892
Compositor: Image nodes used for Movie files didn't convert the relative
paths (if used), so it could not load the movie file.

This bug explains why sometimes movies worked in the Compositor... so for
the current release the bypass is to disable the "Relative" button in the
File Window.
2006-08-20 10:18:01 +00:00
c637afe349 Fix: Previous check for front and back filling when using fattened curves was
too strict and ignored bevel objects. Fixed this.
2006-08-19 06:44:29 +00:00
7539cec416 Plumiferos bugreport:
The Blur node didn't pass on a buffer when the 'factor' value was not
exactly zero. Tiny values (like 0.0000001) or even negative ones were
still handled by the blur code.
2006-08-18 08:16:34 +00:00
73f44f6fbb Bugfix #4890
Driver relations for Constraints (in Actions, Armatures) were not in
depsgraph yet.
2006-08-15 13:30:06 +00:00
605e0230bf Bugfix #4857
Boundbox code for display lists lacked a check for empty Curve/Surface
objects, causing a boundbox to be giant (initialized huge values). That
frustrates code like 'view3d home', or 'centered object view'.

(Commit in view.c is only a little bit code cleanup)
2006-08-15 11:33:00 +00:00
72c8d7c313 Bugfix #4806
Reports came in that Elephants Dream files crash on quit or loading other
files. Was caused by freeing Material Nodes, which was accessing memory
that potentially was just freed before (node->id). Apparently only Windows
really gives issues then, which is actually a good thing :)
2006-08-15 08:56:48 +00:00
582f56d9c4 Bugfix #4798
Envmap type "Load" didn't work when a new envmap was created for this
type. Seemed to be a very old issue...

Todo still: previews skip envmap...
2006-08-14 13:41:22 +00:00
Nathan Letwory
800ae7cf46 [ #4035 ] patch to make scons compile with ffmpeg in mingw
Submitted by Joseph Eagar (joeedh). windows/gcc ffmpeg library may need recompiling to support all codecs necessary (ie. H264 doesn't work).
2006-08-14 12:47:13 +00:00
404ccd1a07 Patch #4751 - Array modifier merge segfault fix. 2006-08-13 15:23:57 +00:00
879fa3cb4e Fix for bug #4825 - array modifier crashes blender.
Some faces were not being checked for vertex indices of 0 before remapping,
leading to bad remapping and screwed up output meshes.
2006-08-13 14:59:05 +00:00
e341a4e1f4 Patch: Constraints to Limit Transforms (#4662) by Joshua Leung (aligorith)
This adds three new constraints to limit the range of location, rotation and scaling values.
2006-08-13 14:18:15 +00:00
4718a22cd0 Bugfix #4882
New toolsettings variable "select_thresh" was not initialized. This caused
the option "similar normals" to not work really (uses a dot product).

It now is initialized (scene.c) as well as corrected in do_versions for
saved files.
2006-08-13 11:11:22 +00:00
e3d78dd4e1 * Fix: Disabled radius tapering on 2d curves with filled front or back. It would be
really cool to get this working solidly, but there are many potential problems with the
triangle face creation across the flat surfaces, especially when there are holes inside
the curves. Maybe this could be a fun project for someone better at this than I? :)
Taper object curves still cause similar problems...

* Made the curve radius affect the 'Nsize' curve normal drawing too, so you don't need a
bevel to see the value.
2006-08-13 08:31:59 +00:00
d3028ec70d * Shrink/Fatten for bevelled curves
This is a much faster and easier way to give a bevelled curve a taper, without
using taper curves. Each point on a curve now has a 'radius' value that you can
shrink and fatten using Alt S, which will influence the taper when the curve is
bevelled (either with a bevob, or with front/back turned off and a bevel dept
set). Alt S shrinks and fattens the selected points in an interactive transform,
and you can set an absolute radius for selected points with 'Set Radius' in the
curve specials menu.

See demo: http://mke3.net/blender/etc/curve_shrinkfatten-h264.mov

This can be a quick way to create revolved surfaces (eg.
http://mke3.net/blender/etc/wineglass-h264.mov ) and it would be very
interesting to use this radius value in other tools, such as a 'freehand curve'
tool that would let you draw a curve freehand, with the radius affected by pen
pressure, or even using the radius at each point to control curve guides for
particles more precisely, rather than the continous maxdist.
2006-08-13 07:37:51 +00:00
f27acb2e7c Bugfix #4872
Posemode, Wkey option "Select constraint target" did not work for Copy
Scale constraint.
Also added a check for NULL pointer, constraint targets cannot exist...
2006-08-12 12:33:24 +00:00
7440aba482 Compositor: finished work on node "File Output".
- It saves a file with indicated type on each change, with number
  appended denoting the current frame (like ANIM saving).
- Output filename button supports relative paths ("//")
- Shows optional preview image too
- For now, added a print on each file save as feedback

To make this option work nicely, changed the BKE_makepicstring() function
to have less globals inside, so it is more generic. Todo: allow amount of
digits in filenames to be set (to support files like tmp_123456.jpg)
2006-08-10 10:38:50 +00:00
86d72cb7d4 Bugfix #4810
Particle systems did not support "time offset" anymore, the varialble for
it in the object was cleared in build_particle_system() and never restored.
2006-08-09 12:53:49 +00:00
6ca354f660 Bugfix #4811
Videoscape export wrote color value wrong on little endian systems,
when no material was assigned to object (default color).
2006-08-09 12:36:28 +00:00
6e4b28968a Bugfix #4847
Metaball editmode: when editing a linked duplicate, hiding a ball caused
a crash.
2006-08-09 08:53:21 +00:00
a8461d2c40 DNA_ipo_types.h comments only
other are changes so calchandles_ipocurve only calc handels on a bezier line.
This makes bvh import faster but should also speed up internal IPO operations.
2006-08-04 14:08:21 +00:00