Commit Graph

348 Commits

Author SHA1 Message Date
4652d66c0a editmode undo stores data as mesh dna now, instead of bmesh copies. also fixed a bug related to vpaint and hide flags. 2009-09-10 06:08:52 +00:00
8823761534 vpaint works with the new face structures, yay, though it probably still has issues, needs more testing. also hopefully fixed subsurf crash everyone but me was getting, what I found should have caused crashes even for me, no idea why it did not. also got face flags to work with subsurf, and partially got materials, though theres still a problem there. 2009-08-30 21:30:07 +00:00
5bb09886fb mesh DNA modficiations; two new structures added for storing ngons, MPoly and MLoop. 2009-05-26 04:17:47 +00:00
f026266e18 merge with 2.5 at r20307. note there were some python hacking necassary for this to work, so um hopefully there's not too much cruft from that.
[[Split portion of a mixed commit.]]
2009-05-23 03:24:15 +00:00
0ba863de29 renamed BMTessMesh to BMEditMesh, did some more monkeywork, cleaned up the more serious warnings, and also non-backbuffered selection sortof works now, though it still needs plenty of work. 2009-05-18 08:46:04 +00:00
59578bfad2 as per discussion with ton, the editmesh accessors now live
in blenkernel.
2009-04-11 08:26:51 +00:00
c86579b11e 2.5: multiple small fixes
- wm draw method is now initialized correct when reading older
  files, but the SDNA bug causing the problem is still unsolved.
  is due to // char pad[8]; not being recognized as commented.
- triple buffer proxy texture test follows spec better now,
  was disabling triple buffer unnecessarily on some drivers.
- some cmake compile fixes related to sequencer pthread usage
  and removed bad level calls lib for player.
- show outliner header buttons in oops mode as well until that
  can be switched in the UI.
- fix region data free issue for tooltips
- warning fixes
2009-01-23 20:36:47 +00:00
faa871117f Brought back sculpt smooth brush. Also added a new brush flag for setting whether to use brush spacing. 2009-01-21 22:40:28 +00:00
cb89decfdc Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:

* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.

* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.

* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.

* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
2008-09-04 20:51:28 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
d73ed401da Added two UV features (Apricot request):
- Alt+click edge loop select.
- Next to Align X/Y, Align Auto which will pick X or Y automatically,
  should give the expected result for nearly all cases.
2008-03-12 19:55:37 +00:00
5b3dc15880 Normal map tangents are now not always averaged at vertices anymore,
but only when the UV's are connected. That fixes some artifacts when
baking and using tangent space normal maps. It does mean increased
memory usage because it now stores 4 tangents per face like UV's,
and increased processing time, but there's no simple way around that.
2008-03-07 15:38:56 +00:00
3d3023126a Fix for bug #7965:
Array modifier could generate edges with twice the same vertex, fix
provided by Ken, thanks.
2008-01-29 19:49:03 +00:00
015007beaf == Sculpt ==
Fixed bad level calls in sculptmode.
2007-12-26 22:40:56 +00:00
457057a9e8 Fix for mirroring issues in particle mode, where the particles were
not mirrored exactly, though the problem is not completely solved.
The way local frames are computed for particles is still not fully
symmetric, which shows especially on long hairs...

Also made the shift+o subsurf switch work recursively into
dupli-groups, did only the first level before.
2007-12-11 20:02:21 +00:00
26b8892c9c Bugfix for mysteriously disappearing left eyeball. Bounding boxes
used for clipping were being stored in the mesh, but modifiers
can result in two objects with the same mesh having a different
bounding box. Solution is to store bounding box in the object.
2007-12-05 21:50:23 +00:00
29d87d64ca Particles
=========

- Texture orco coordinates for particles are now actual orcos instead
  of just the vertex positions, which means they are the same under
  deformations and the same as the ones on the mesh.
- Particle distribution now uses these orcos to get consistent
  distributions independent of deformation.
- This required changing the way orco's are computed for meshes. Now
  instead of generating an orco derivedmesh separately, the derivedmesh
  is generated alongside the regular one and stored in an orco custom
  data layer.
2007-12-05 12:40:54 +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
78a20a930a fixed copy between UV layers.
made the UV layer menu a generic functions (can make a menu from the names of any custimdata layer type)
added a menu in the UV window for selecting teh editnmode UV layer - If there ends up not being enough room in the header this may need to be removed.
2007-09-18 19:39:25 +00:00
e8a808da24 UV Editing is now done in editmode rather then UV/Face Select mode.
Notes
* you cant edit UV's in the image window in "UV Face Select" mode. (removed UV from the name)
* going into Face Select mode no longer adds UV's and does not need UV's to work.
* The UV Calculation menu is now in editmode (Alt+W)

Todo..
* Image replace - partly broken in stable also.
* Rotate/Mirror UV/VCol are still only in Face Select mode.
* Hide/Reveal is not quite right, (issue with editmode flushing)
2007-09-10 12:26:36 +00:00
e0c77c0f14 made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
2007-03-11 16:25:17 +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
f624730d26 Warning fix in subsurf_ccg.c. Also changed subsurf UV vertex and edge
handles to be more consistent.
2006-02-19 11:37:50 +00:00
dd7e0b6bfe Apply Subsurf to UV's.
This fixes most of the UV distortion issues with subsurf. Near seams
however there might still be some distortion, but this should at least
not be worse than before. Subsurf UV is enabled by default on new meshes,
and can be enabled in the modifier panel for existing ones.

Before and after:
http://users.pandora.be/blendix/notsmooth.png
http://users.pandora.be/blendix/smooth.png
2006-01-10 11:36:57 +00:00
d9fa984f35 More properly coded version for adding edges... now only do_versions()
reads from the old mface->edcode flag to set edge drawing.

ALso; added a pointer check in draw_mesh_object(), here the derivedmesh
gives NULL on reading regression file lostride.blend. Zr needs to check!
2005-09-22 17:52:41 +00:00
a77e3482f2 Saturday morning first cup of coffee hack (yeah, its a late
morning)

 - fun for the whole family, boolean mesh modifier... doesn't work
   with layered modifiers yet (just uses base mesh), although may
   god have mercy on your soul if you want to run boolean on a
   subsurf anyway
 - added displistmesh_add_edges

This exposes a bug in boolean, apparently the output is somehow
random (hash on alloc'd pointer value perhaps) which is sortof
lame.

It also makes more apparent the desire for some level of control
over dep graph evaluation during editmode (at the moment dep
graph is reevaluated for a mesh object in editmode, but since
mesh changes are on editmesh other objects don't really see
any change, so it is a wasted recalc).
2005-09-03 17:22:29 +00:00
7804860cf6 - added mesh_strip_loose_faces, works in conjunction with make_edges
to get rid of faces with MFace.v3==0
 - change all Mesh's to have ->medge now. This is forced by make_edges
   on readfile, and in the various exotic important routines, and on
   conversion back in python.
 - make python NMesh structure always have medges now (needs testing)
 - with above two changes it is guarenteed that mf->v3 is never ==0
   in main blender code (i.e., all MFace's are actually triangles
   or quads) and so I went through and removed all the historic tests
   to deal with MFace.v3==0. Equals lots of deleting, I am in heaven!
 - removed MEdge edcode flag, no longer needed
 - added experimental replacement for edge flag system

Still are some inconsistencies in FACESELECT mode edge drawing to
be ironed out.

NOTE: This commit adds an experimental edge flag calc system, based
on 10-seconds-of-thought algorithm by yours truly. Would appreciate
feedback on how this system works, esp compared to old one and esp
on complex or interesting models.

To Use: New system is enabled by setting G.rt to a value between
1 and 1000 (Value of 0 uses old system). Value 1000 is reserved for
"auto" edge, which is more or less identical to old system but also
makes sure that at least 10% of edges are drawn (solves errors for
super subdivided meshes). Values between 1 and 999 act as percent
(out of 1000) of edges that should be drawn, starting with "most
interesting" edges first. Please try it and comment!
2005-08-21 07:19:20 +00:00
a30740c196 - convert all DerivedMesh map functions to use index based
mapping (instead of Edit{Vert,Edge,Face} pointers)
 - dropped convertToDispListMeshMapped (whew, glad of it too)
 - added DerivedMesh drawMappedFaces function
 - dropped EM suffix for DerivedMesh functions, it was neither
   particularly correct nor descriptive
 - converted test_index_mface to test_index_face that also corrects
   MCol and TFace. Good thing we had three versions of this routine,
   you never know when one might burn down.
 - removed flipnorm_mesh, not used anymore (and was incorrect to
   boot)

 - Getting face select to work with modifiers turned out to be much
   more complicated than expected. Reworked mapping architecture for
   modifiers - basically elements in a DispListMesh are now required
   to be stored in an order that corresponds exactly to original
   ordering. MVert/MEdge/MFace all have a new flag ME_XXX_STEPINDEX
   that is set on each element that is set on the first derived element
   of each original element. I can't say the code to follow these
   requirements for subsurf is particularly transparent, but on the
   upside it is a reasonably consistent and simple system that is memory
   efficient and allows keeping the DispListMesh structure.

 - rewrote mirror modifier to be simpler/conform to new requirements
   for mapped DispListMesh structure. This also means that mirror interacts
   much better with incremental subsurf calculation (it used to recalc
   one entire side on any topology change, now it generally avoids that).

 - added EM_{init,free}_index_arrays and EM_get_{vert,edge,face}_for_index
   functions to handle mapping indices back into appropriate EditMesh
   structures.
 - bug fix, make edges didn't recalc object data
 - bug fix, initial image assignment to TFace's didn't recalc object data

 - new feature, added circle select support for FACESELECT
 - bug fix, creating new faces in editmode duplicated the TFACE active
   flag - but there should only be one active tface
 - bug fix, possible crash when deleting all faces in faceselect mode
   on mesh with tfaces...

Still todo: TFace edge drawing is still not always correct in face
mode, in particular with a mirror modifier when mesh has edges (and
no preceeding subsurf). Have not yet decided how to deal with this.
Best solution is probably to do switch to meshes all having MEdge's,
in which case I can get rid of TFace edge flags (and need to recalc
modifiers on tface selection change).
2005-08-20 03:08:23 +00:00
42da62679f - removed mface->puno flags, was only used to flip normals in display
and this is better left to user (whee this was a fun commit! so
   much deleting!)
 - removed mesh_calculate_vertex_normals (replaced by mesh_calc_normals)
2005-07-23 16:09:08 +00:00
cb3d0afd87 - moved mesh_getVertexCos to mesh.c and prototyped
- make mesh_modifier build vertex locations on demand
2005-07-22 17:03:50 +00:00
272f35d427 - ditch mesh_uses_displist 2005-07-18 20:49:19 +00:00
37fe347a59 - removed orco pointer from struct Mesh
- switch renderer to store orco's in a hash table instead of
   caching in mesh (I don't like the renderer caching data
   in the actual mesh structure)
 - added mesh_create_orco[_render] function
2005-07-18 18:28:16 +00:00
e6e9b1ea80 - replace displistmesh_calc_normals by mesh_calc_normals
- convert MeshDerivedMesh to calculate new vertex normals and such
   on initialize, means copy free conversion to DispListMesh
 - replace vertex access through function by direct access fo
   MeshDerivedMesh
 - shadeDispList was not getting correct orco's
2005-07-17 20:12:16 +00:00
0be013010f - decided it made more sense to make a key_get_active function, switched
to that in editmesh as well as for edit{curve,lattice}
 - added a G.editModeTitleExtra string that gets displayed in header info
   string in editmode. currently used to display "(Key)" when editing a
   key (before there was not UI level display of this info).
2005-07-15 17:55:19 +00:00
925c024653 - more signedness warning fixes in editsima
- added mesh_get_active_key and replaced code in editmesh to use this
 - removed obsolete code in object_deform
2005-07-15 17:31:58 +00:00
8da29921ba - added mesh_get_texspace (should be used instead of direct access)
which calculates texspace on demand if need be.
 - removed almost all calls to tex_space_mesh

There may be a few corner cases where this goes wrong (meshes with vertex
keys) but these should get ironed out by coming modifier system.
2005-07-14 21:57:18 +00:00
b22e3414ca - add mesh_get_bb function to return mesh boundbox and calc if needed
- switch all mesh boundbox access to go through mesh_get_bb
 - switch object_handle_update to call mesh_changed instead of making
   the displist data immediately (delayed calculation)
2005-07-14 18:04:27 +00:00
befc2bbc41 - split makeDispList into makeDispList{Mesh,MBall,CurveTypes}, there is
still a makeDispList that dispatches to the appropriate one.
   makeDispList is on the way out and this makes it easier to track down
   exactly which places use makedispList and for what types of objects.
 - switch calls to makeDispList to appropriate more specific function (if
   the object type is known by caller).
 - added mesh_changed function that invalidates cached mesh data (but does
   not rebuild, mesh data gets rebuilt on access). Most old calls to
   makeDispListMesh use this instead now.
2005-07-14 15:48:01 +00:00
5c87aefa4b - integrated get_mvert_weight and color_temperature
into drawobject.c (just used for calculating weight
   map)
 - removed two_sided (replace with glLightModeli calls)
 - huge rewrite of drawobject.c for meshes, extracting simple
   drawing functions and then reworking to bring some order
   and clarity back to the code.

   A lot was changed here so it is likely I missed a few
   things in testing although I tried to be very careful.
   Please let me know if you find any changes in drawing.
2005-03-26 17:29:37 +00:00
f77bc7eb7d Quite a large one this time... but now we have:
Edges in Mesh
- adds automatic when you use creases. For other situations; call the
  void make_edges(Mesh *me) in mesh.c. Of course, once in editmode the
  edges are automatically recreated.
- in F9 buttons you can add/remove edges too
- both for Mesh and DisplistMesh, so it speeds up drawing quite some in
  wireframe
- render for edges can't work... edges have no material nor tface nor col..
  so here still the faces are rendered in wire

Creases in Subsurf
- based on the code by Chris McFarlen
- main changes is that now edges are used, saving quite some data in file
- use SHIFT+E in editmode to set edges-sharpness. values go from 0-1
- in F9 buttons you can set draw-crease mode. It draws now blended from
  wire color to edge-select color (as provided in Theme)

Known issue: setting sharpness on 1 cube (subdiv 2) gives weird results
with some values... Chris, can you check?

Further; code cleanups, changing 0 in NULL when needed, no warnings, etc etc
2004-07-08 20:38:27 +00:00
44a74dbf29 - added editmesh_[de]select_by_material function
- added mesh_set_smooth_flag, mesh_delete_material_index function
 - isolated some globals
 - got rid of reliance on meshdata in buttons_editing.c and material.c
2004-03-20 23:59:57 +00:00
f6f06ba54d - removed duplicate flags from BKE_mesh.h
- removed rendermesh_uses_displist (no longer relevant)
 - converted appropriate me->flag tests to using mesh_uses_displist
 - made vert and face counting (for info header) use proper counts
 - changed flip_subdivision to allow level==0 argument
 - ps. thanks for subsurf orco fix ton
2004-01-08 04:42:29 +00:00
8604348e50 Oops, forgot to use 'struct Mesh' in prototype. 2003-03-24 16:46:45 +00:00
b224f90da7 Added a mesh_calculate_vertex_normals function for rebuilding the normals
outside edit mode.
2003-03-24 15:55:21 +00:00
f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00