Commit Graph

578 Commits

Author SHA1 Message Date
e2504c2ff1 Mesh Deform Modifier
====================

Added a button to invert the vertex group influence, to make blending
between mdef and armature deform easier.
2007-11-06 09:44:34 +00:00
cbc941e342 Merged pointcache from particles branch, but is not used in the moment 2007-11-06 09:44:09 +00:00
7a6b3a63fa svn merge -r 12419:12478 https://svn.blender.org/svnroot/bf-blender/trunk/blender -- old cloth files with activated modifier won't work, please deactivate modifier before 2007-11-04 22:20:02 +00:00
1b9d661eca Mesh Deform Modifier
====================

The MeshDeform modifier can deform a mesh with another 'cage' mesh.
It is similar to a lattice modifier, but instead of being restricted
to the regular grid layout of a lattice, the cage mesh can be modeled
to fit the mesh better.

http://www.blender.org/development/current-projects/changes-since-244/modifiers/

Implementation Notes:
- OpenNL has been refactored a bit to allow least squares matrices to
  be built without passing the matrix row by row, but instead with
  random access. MDef doesn't need this actually, but it's using this
  version of OpenNL so I'm just committing it now.
- Mean value weights for polygons have been added to arithb.c, a type
  of barycentric coordinates for polygons with >= 3 vertices. This
  might be useful for other parts of blender too.
2007-11-04 22:00:24 +00:00
4f72523654 Weekend commit: Enabled bounding box check for cloth again, but there's a bug in it (no collisions detected) 2007-10-26 15:13:50 +00:00
f310214cc5 reverted part of cloth.c and modifier.c back to old code before switch to use "deform_only" modifier (not tested, needs cleanup but compiles) 2007-10-25 21:17:55 +00:00
916cd17778 Fixed some bugs in bounding volumes, still some crasher in new cloth modifier 2007-10-24 17:13:13 +00:00
8bca9e5977 Another WIP commit. Building up bounding volume API 2007-10-23 22:38:07 +00:00
5a6ffd8441 WIP commit, (just in case my HD breaks down). Don't expect anything to work. Code crashes and sim doesn't work ;) 2007-10-22 22:50:32 +00:00
5bd2f5b08e Fixed read/writing of blendfiles with collision modifier (saving not supported itm), also changed naming 2007-10-21 16:53:25 +00:00
8dbc71020c Disabled Cloth collision detection because of almost complete rewrite/seperation of the collision system like we discussed on the sprint. You can enable position caching/collision object now then enableing it as an deflection object. Problem: Some GUI glitch in the modifier stack, please help :) 2007-10-21 16:38:13 +00:00
f44b09b7eb svn merge -r 12208:12294 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2007-10-18 23:27:31 +00:00
5b019072a8 Springs are in a dynamic list now, New function cloth_add_spring() for easier access to spring handling, cleared up names, functions, code. Collisions can be enabled/disabled for cloth objects now 2007-10-18 23:12:30 +00:00
Ken Hughes
ff5fd2eb38 Tools
-----
Bugfix #7493:  boolean difference operator was being applied in the wrong
order (difference modifier worked correctly).
2007-10-14 20:58:57 +00:00
5b9140a209 Fixed some collision response issues. (weekend commit, some half done work in) 2007-09-21 13:34:19 +00:00
9dbcffadec Temporary fix for loading crash of .blends with cached frames. Also fixed some goal behavior/init problem to match SB behaviour 2007-09-18 07:16:57 +00:00
ca6e59bc48 stupid missing ";" 2007-09-17 11:19:07 +00:00
26a0473c8c compile fix from elubie
special request from mfoxdogg: place modifier where you want
2007-09-17 11:18:04 +00:00
1138bd3014 New: Min & MaxFrame of simulation; Fixed: Many reset problems gone 2007-09-16 23:19:02 +00:00
cd998aaadd Initial checkin of cloth files + changes 2007-09-16 16:23:21 +00:00
df1e3f1c49 Fix for edgesplit crashes reported in bugs 6695 and 7142. The problem, as
found by Riku Palomäki, was that "bridge" vertices (which connect two or more
faces that don't share edges) were not being included in the maximum final
vertex count calculation (used for memory allocation, hence the crashes).

Unfortunately Riku's patch actually stopped bridge vertices from being split
correctly, so I have fixed the problem by adding the maximum number of vertices
that can be generated from bridge vertices to the maximum final vertex count.

Thanks to Riku Palomäki for finding the cause!
2007-09-09 18:03:58 +00:00
c4114780d4 Little code cleanup.
bsystem_time was being called with an extra variable, which was useless. Most of the places that called it, were passing NULL for that variable anyway.

I've also cleaned up that function a bit, but the underlying problems with that part of the code still exist (EVIL GLOBALS that are exported for frame_to_float), for mblur and fields rendering features. That remains for another time.
2007-08-05 09:21:29 +00:00
8742899f5e Armature CrazySpace Improvement
===============================

An improved CrazySpace correction is now used for Armature modifiers that use
vertex groups, and that are the first enabled modifiers in the stack. This is
a a specific case, but also a common one.

http://www.blender.org/development/current-projects/changes-since-244/skinning/

Implementation Notes:

- The quaternion crazyspace correction is still used for modifiers other than
  the armature modifier.
- Modifiers can now provide a deform matrix per vertex to be used for
  crazyspace correction, only the armature modifier implements this now.
2007-07-28 21:04:30 +00:00
3d4a9c1c43 Silenced a few compiler warnings 2007-06-21 11:24:42 +00:00
2bc96c07a7 Bugfix #6864:
Copying Displace modifiers by themselves did not work correctly. The code was incorrectly just copying memory for source modifier to the new copy, causing problems due to the ModifierData struct at the start of the DisplaceModifierData struct (linked list pointers still referring to old stack).
2007-06-20 05:23:31 +00:00
c40997656e Really minor updates related to code I wrote for the Cast modifier:
- modifier.c: moved a check out of a loop, removed an unneeded var, made a couple cosmetic changes.

- DNA_modifier_types.h: added parentheses to cast and smooth modifier defines that used bit-shifting (like 1<<1, etc.).

Note: realized they were needed when I tried to use "flag &= ~MOD_CAST_Z" in modifier.c. Since MOD_CAST_Z is #defined as 1<<3, ~MOD_CAST_Z ended up as ~1<<3 while I wanted ~(1<<3). There are other places in that header file and others in Blender where it'd be safer to add the parentheses...

- Updated the epydoc documentation for the features added by Ben Batt to the cast modifier; fixed small typo in API_intro.py.

BTW, thanks Ben Batt (artificer) for checking, improving with a couple features and committing these modifiers :).
2007-04-30 19:20:43 +00:00
469208a101 Patch #6192 - Wave Modifier Option to move verts along normals
This patch adds an option to the wave modifier to displace along the normals
of the base mesh, rather than in the local Z direction.

Thanks to Michael Fox (mfoxdoggg) for the patch!
2007-04-30 16:49:12 +00:00
0b66fe6a48 Patch #6582 - Weight groups in the wave modifier
This patch adds vertex group functionality to the wave modifier, allowing the
user to specify a vertex group with which to modulate the wave deformation.

Thanks to Michael Fox (mfoxdoggg) for the patch!
2007-04-30 15:20:05 +00:00
22e1a26681 * Small tweak - initialise mirror modifier to use X axis by default,
as it was previously.
2007-04-30 06:51:24 +00:00
125c77bca3 Patch #6113 - Cast & Smooth modifiers
This patch adds two modifiers: Cast and Smooth.

The Cast modifier deforms vertices into a sphere, cylinder or cuboid shape.
The location and orientation of the projection shape can be controlled by a
specified control object.

The Smooth modifier smooths the mesh in a similar way to the Edit mode "Smooth"
button.

Thanks to Willian Padovani Germano (ianwill) for the patch!
2007-04-29 18:13:55 +00:00
d0ac7ef087 Patch #6584 - Texture functionality in the wave modifier
This patch allows the user to use a texture to modulate the wave modifier's
amplitude.

Thanks to Michael Fox (mfoxdoggg) for the patch!
2007-04-29 16:15:50 +00:00
f62f07734f Patch #5629 - Mirror modifier axis' to be toggleable
This patch makes the X, Y and Z axes of the mirror modifier individually
toggleable, so it is possible to mirror in more than one direction with a
single modifier.

Thanks to Juho Vepsäläinen (bebraw) for the patch!

NOTE: BLENDER_SUBVERSION has been incremented to support translation from old
      to new axis specification.
2007-04-29 14:00:30 +00:00
7170f9ec2d == Edgesplit modifier speed improvements ==
Speed improvements to the Edgesplit modifier (changed the data structures
and memory management to avoid using slow GHash functions and large numbers
of small mallocs). In my tests, this makes the modifier approximately twice
as fast.
2007-03-18 14:20:24 +00:00
77cd80e1b5 == Mirror modifier upgrade ==
Upgraded the Mirror modifier to support mirroring of UV coordinates in the
faces created by the modifier.
2007-03-18 13:46:26 +00:00
0b55cac34c == Array modifier upgrade ==
Upgraded the Array modifier to allow the user to specify start and end
cap objects. This makes arrays more flexible and more useful for creating
subsurf cages. The cap objects are added at the start and end of the array,
and will be auto-merged with the rest of the array if the 'Merge' button is
on.

Examples at:
- http://members.optusnet.com.au/~bbatt/tentacle01-endcaps.blend
- http://members.optusnet.com.au/~bbatt/arraytest06.blend
- http://members.optusnet.com.au/~bbatt/arraytest07.blend
2007-03-18 13:26:53 +00:00
1f35fd7929 = Addendum to UVProject's multiple UV handling - "Override Image" button =
* Added an "Override Image" button to the UVProject modifier; this overrides
  faces' currently assigned image with the one given in the modifier panel.
  This provides some of the functionality previously provided by the "Add UVs"
  button - you still need to add a UV layer manually, but you only need to
  change the image in one place.
* Note that the "Override Image" option uses the bit position previously used
  by the "Add UVs" option, so old files which had "Add UVs" enabled will now
  have "Override Image" enabled.
2007-01-29 16:28:11 +00:00
2a47217cba = Updating the UVProject modifier to handle multiple UV layers =
* Removed the "Add UVs" option from the UVProject modifier
* Added a UV layer menu to the UVProject modifier
* Refactored the Displace modifier UV layer menu code to allow the UVProject
  modifier to share it
* Added two CustomData functions to facilitate getting layers by name
2007-01-29 15:10:55 +00:00
893e93bb5f Fix for a segfault in the new Displace modifier UV layer selection code:
If the "UV" texture coordinate option is selected while no UV layers exist,
the UV layer name in the modifier is blank. This is not a problem while no UV
layers exist, but if a UV layer is added the modifier code attempts to use
UV coordinates without handling the missing layer name correctly, leading to a
segfault. This only occurs when the modifier stack is recalculated before a
modifier UI redraw, as the UI redraw updates the layer name.

This fix handles a missing UV layer name by setting it to the active UV layer.
2007-01-27 13:33:56 +00:00
4494b829b0 =Displace modifier fix=
This commit fixes displace modifier to propery support arbitrary uv
layers.  This seemed like a fairly big usability bug,
as displace modifiers would use the active UV layer (and thus could change when
you changed the active layer).  The modifier UI code now uses a menu for browsing
the uv layers, however only the uv layer name is actually stored, so that 
adding/deleting layers won't mess up displace modifiers.  

Whenever a displace modifier has an invalid UV name (for whatever reason) the 
UV name is set to the active layer.  This is checked both in the UI code and 
in the modifier exec code, so all bases are covered. For deleting a layer, this 
required upgrading the layer delete code in the UI to properly preserve the 
active layer, to prevent unwanted behaviour. I hope this is an ok solution.

Brecht, Ben you might want to look over and make sure I didn't break anything.  I don't
think I did, I tested as thouroughly as I could.
2007-01-26 21:06:49 +00:00
d90c686bdb Fix for bug #5439:
UV Project modifies original UV coords.
2007-01-14 15:52:55 +00:00
397b09e477 Bugfix #5476
Lattice deforming a Particle system only supported regular parent relation-
ship, not modifiers.
2006-12-23 11:56:22 +00:00
80ee52e444 Multiple UV and vertex color layers: (still work in progress)
These can be created and deleted in the Mesh panel in the same place as
before. There is always one active UV and vertex color layer, that is
edited and displayed.

Important things to do:
- Render engine, material support
- Multires and NMesh now lose non active layers

Also CustomData changes to support muliple layers of the same type, and
changes to layer allocation, updated documentation is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
2006-12-12 21:29:09 +00:00
4f8079d49c Modifier Stack: Limit calculation to required data.
This commit upgrades the modifier stack to only calculate the data which is
needed, either by modifiers further down the stack or by other functions at
the end of the stack (e.g. drawing functions).

This speeds up modifier stack recalculation, especially where vertex
groups and UV coordinates are concerned. For example, a mesh with an Armature
modifier followed by a Subsurf modifier would previously have required the
Subsurf modifier to interpolate all the vertex groups in the mesh, slowing
down modifier calculations considerably. With this update, vertex group data
is not propagated beyond the Armature modifier, so calculations are faster.

Note that this depends on the order of modifiers in the stack. If the Armature
and Subsurf modifiers were swapped in the above example, the Subsurf modifier
would have to interpolate vertex groups, as they are needed by the Armature
modifier.
2006-12-05 17:42:03 +00:00
35f3682f7c Fix for bug #5325 - curve deform tool doesn't work correctly
This bug was caused by broken's recent patch to make the Curve modifier
determine its axis from the modifier panel, rather than the object's track
axis. In the case where a Curve modifier is applied by parenting the object
to the curve, the curve axis needs to be copied from the object's track axis
in modifiers_getVirtualModifierList(). This commit adds the necessary copy.
2006-11-29 13:52:59 +00:00
4d1425f510 Bugfix #5291
Array Modifier type "path length" didn't force a path calculation on load.
Note that this is still improper handling in Blender... an exception that
has to move to the depsgraph.
2006-11-26 14:04:25 +00:00
bb7ad80269 Upgrades to the UVProject modifier:
- New perspective projection capability. If a camera is used as the
   projection object, the modifier detects whether to do perspective or
   orthographic projection based on the camera type. If any other object
   type is used as the projection object, orthographic projection is used.
 - Orthographic projection actually works properly now.
 - The projected UVs are scaled and offset so that the image is centred in
   the projecting camera's view.
 - AspX and AspY inputs have been added to control the aspect ratio of the
   projected UVs.

Also:
 - I have added the Mat4MulVec3Project() function to BLI_arithb.h; this
   function converts a 3-dimensional vector to homogeneous coordinates
   (4-dimensional, with the 4th dimension set to 1), multiplies it with the
   given matrix, then projects it back to 3 dimensions by dividing through
   with the 4th dimension. This is useful when using projection matrices.
2006-11-22 15:09:41 +00:00
53eaa3b67a New displacement direction for Displace modifier: "RGB -> XYZ". This means
that vertices will be individually displaced in the X, Y and Z directions
by the RGB components of the texture (R affects X, G affects Y, B affects Z).
This can be used along with e.g. the colour Clouds texture for a jitter effect.
2006-11-20 14:23:41 +00:00
f7c24e1b11 Patch #5181: Option to use an object to determine the startX&Y in the
Wave Modifier

This patch allows the option to use an object to determine the wave modifier's
start X & Y, it also allows for animated objects giving a moving wave
start X & Y.

Thanks to Michael Fox for the patch!
2006-11-20 11:58:48 +00:00
e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
afc880bb45 Oops, added the #define in wrong line. Now displace modifier is back! 2006-11-09 10:12:26 +00:00