Commit Graph

79 Commits

Author SHA1 Message Date
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
d0cabce889 added sharp edge to python edge flags 2006-08-29 10:04:10 +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
Ken Hughes
69836ce9bc ===Python API===
More additions for Mesh.faces.extend(); allow faces with 2 verts or duplicate
verts to remain in the input list (although they are still not added to the
mesh) so that indexList option can return None for them.  The goal is for all
faces which are discarded to still be ignored but return None.
2006-08-25 16:01:16 +00:00
Ken Hughes
2ee94cbbac ===Python API===
New keyword parameters for Mesh.faces.extend() method:
  * ignoreDups: turns off checks for duplicate faces in the input list and
    existing mesh faces.  Intended for constructing new meshes where the
    faces are known to be unique.
  * indexList: makes the method return a list of new faces indices, which
    can be used to index new faces to add other attributes like color.  If
    duplicate faces are removed, None is placed in their list slot.
2006-08-24 20:02:22 +00:00
Ken Hughes
de762ae555 ===Python API===
Bugfix: Mesh.faces.extend() would incorrectly add duplicate faces in some
circumstances.
2006-08-24 19:28:36 +00:00
Ken Hughes
a217e546a4 ===Python API===
Fix return value problem in Mesh_getFakeUsers(): compiler warning in this case
was indicating a real bug.
2006-08-22 18:08:57 +00:00
d6d2d6f063 added fakeUser property to mesh (will need to add to all other library datablocks too)
and added __copy__ to quat and euler types as well as updating the docs.
2006-08-22 09:13:44 +00:00
Ken Hughes
a680d87902 ===Python API===
Patch to Mesh and NMesh APIs to bring FaceModes dict into sync (thanks jms).
2006-08-16 19:20:37 +00:00
515fe83f97 added __copy__ to mesh and object types, fixed a monor bug in setTexMesh and made Mesh.c use G.totMesh properly. 2006-08-13 01:51:47 +00:00
6a48654cce Added a octree implimentation for doing fast locational vertex lookups. 2006-07-31 13:28:00 +00:00
00a6a79899 added the texmesh to Mesh property to mesh. 2006-07-31 12:57:46 +00:00
cac265f7b6 faces faces added had vertex colors set to black.
use default_tface(tface) on all extended faces when tfaces exist.
2006-07-28 07:08:27 +00:00
Ken Hughes
b85c3fb1de ===Python API===
Bugfix #4728: passing an interator sequence to me.faces.delete() caused a
crash; check explicitly for lists or tuples.
2006-07-19 14:35:22 +00:00
Ken Hughes
861e0a347a ===Python API===
Bugfig #4527: add more robust bitfield checking for Mesh.mface.flags;
unconfirmed bug report that an exception was caused with RC3a that could
not be reproduced.  It was possible that a pre 2.42 .blend might have
some additional flag bits set that would have caused an error.
2006-07-06 16:40:49 +00:00
Ken Hughes
64d0d62ddd ===Python API===
Bugfix #4605: mball_to_mesh() doesn't create edges for new mesh, so
me.getFromObject() wouldn't display the new mesh until edit mode was entered.
Added a call to displistmesh_add_edges() to calculate them and then insert
into the new mesh.
2006-07-05 18:28:51 +00:00
be2c208077 Fixed a bug where face flags could not be set because of the faces existing flags.
A problem with the current flag seting in Mesh is that Mesh needs to know of all possible flags or setting a flag can raise an error from the faces own unrecognezed flag.
also stopped the active face flag raising an error so pythoners can do face1.flag |= face2.flag without checking for active face flags. if the flag is a part of the arg its removed quietly.
Checked Mesh flags, face modes and edge flags, should all be ok now.
2006-06-27 02:49:55 +00:00
1e9ce63b40 Fixed a bug where loose edges would raise an error when the FGON value was unset.
also added LOOSE to the EdgeFlags dict.
2006-06-26 04:14:12 +00:00
Ken Hughes
f478c9eca3 ===Python API===
Bugfix #4347: deleting vertex 0 incorrectly deleted all triangle face, since
check for v4==0 wasn't being done.
2006-06-17 14:08:15 +00:00
Ken Hughes
e77112f76b ===Python API===
added len() operator for MFaces, which returns number of MVerts.
2006-06-06 18:14:31 +00:00
721de110b2 Added Py_DECREF since PySequence_GetItem adds a reference where as PyTuple_GetItem borrows it.
Thank ken.
2006-06-06 17:28:39 +00:00
46329e5ab0 made it so a meshes uvsel could be set with any sequence, not just a tuple. 2006-06-06 17:04:00 +00:00
Ken Hughes
8a8400ff28 ===Python API===
Added to Mesh API me.sel and me.hide, which set/clear the selection and
hidden values for all verts/edges/faces in a mesh.
2006-05-28 00:39:13 +00:00
Ken Hughes
48033e00c4 ===Python API===
Fulfilling a very old feature request: a new Mesh Primitives module is
introduced, which gives script writers access to the Blender mesh datablocks
created from the "Add->Mesh" menu.  You can now do this:

  from Blender import *

  me = Mesh.Primitives.UVsphere(10,20,3) # 10 segments, 20 rings, diameter 3
  ob = Object.New('Mesh','mySphere')
  ob.link(me)
  sc = Scene.GetCurrent()
  sc.link(ob)
2006-05-25 16:45:24 +00:00
Ken Hughes
f3ae4d0f4d ===Python API===
Something to try making import/export script writers happy; Mesh.New() will
not create a new Blender mesh datablock unless the mesh is linked to an
object.
2006-05-20 16:52:11 +00:00
Ken Hughes
d9045c860b ===Python API===
Make me.faces.sel and me.edges.sel behave like EM_select_face() and
EM_select_edge() in source/blender/src/editmesh_lib.c.

Script users should note that if they change ANY of the selection states
(vertex, edge, face) and then call a mesh "tool" method (like me.remDoubles)
that the selection states of the mesh MAY change, since these tools use the
edit mode (which updates select states).
2006-05-14 14:12:45 +00:00
831a1fa91d Added MVert.hide property because hidden verts were hanging BPyMesh_Redux 2006-05-11 20:35:43 +00:00
a3783d32e0 Added some shortcuts to Mesh
MFace.area
 MFace.cent
 MEdge.length

Updated some scripts that used these.
2006-05-11 10:06:15 +00:00
8f84542c23 Modified mesh to allow writing to normals.
renamed meshPrettyNormals to meshCalcNormals, and it now writes to normals rather then returning a list of vecs.
updated vertexpaint_selfshadow_ao to be a bit more efficient and make use of the above changes.
2006-05-10 12:12:21 +00:00
f81206228c Fixed typo 2006-05-10 03:59:16 +00:00
41623cbdb9 made mesh's getFromObject pick the materials from object or obdata as set by the objects colbits.
its crufty that None of the exports currently export materials correctly, hopefully this will help.
2006-05-10 01:38:02 +00:00
Ken Hughes
4de7589720 Bugfix: mesh.removeVertsFromGroup() caused segfault due to NULL pointer. 2006-05-09 14:17:34 +00:00
Ken Hughes
5f6a5f1b17 ===Python API===
Bugfix: replaced calls to enter_editmode() and exit_editmode(), which would
cause segfaults on scripts run in background mode (discovered by NichG).
2006-05-08 05:37:00 +00:00
Ken Hughes
9874d5c76f ===Python API===
Added activeGroup attribute to Mesh API, to get/set active vertex group for
meshes.
2006-05-02 17:44:44 +00:00
87949e5c67 warnings cleanup for the python project on windows 2006-04-24 15:09:07 +00:00
Ken Hughes
7fd0e22f1e Bugfix #4055: the "sel" attributes for faces/edges/verts were basically
oblivious of each other, so setting/clearing the face edit mode select status
did not set/clear the corresponding vertex select statuses.  This patch makes
a change of any select status recalculate the selection state of all edges an
faces.  One unresolved issue is what effect this should have on the recent
edge mesh's stored selection.  Currently changing the selection state will
delete store selection info, but it may be desirable to emulate the stored
selection (but I need to discuss how this should work in more depth with
Geoffrey Bantle).

As an added bonus (while I was messing with this), I added a "sel" attribute
to edges so they are the same as faces and vert.
2006-04-07 02:49:15 +00:00
Ken Hughes
5f550b4ceb ===Python API===
A bug fix and an enhancement:
   * fixed bug when adding or deleting faces from a mesh which has
     vertexColors; mesh->mcol was not being updated
   * changed edges.extend() and faces.extend() to accept integer vertex
     indices in addition to MVerts; this should make scripts simpler and
     in general make things run faster
2006-03-11 16:00:07 +00:00
Ken Hughes
69d00bccaa ===Python API===
Bugfix: make face and edge .extend() methods check that input vertices are
from the same mesh.  Fixes a bug found by Cam.
2006-02-17 17:50:54 +00:00
ee4c7ef22a Added ability to render Zbuffer to an image.
Just use SHIFT-F3 and save an image.

	Basically all this does is copy the zbuffer to a new Image buffer
	and pass that to the save image function.

Sample output:
	http://www.cs.umn.edu/~mein/blender/kungfu_zbuf255.jpg

	Also thanks to Jesterking for helping me debug dumbness... ;)
	and the nice screenshot.

Kent
2006-02-10 21:10:58 +00:00
Ken Hughes
83ea72de1a ===Python API===
Three more changes for the Mesh module:
(1) Bug fix for UV vertices ("sticky").  me->msticky was not being updated
   when vertices were added or deleted from the mesh.
(2) Vertex, edge and face .extend() methods accept zero-length sequences
   instead of throwing an exception.  (Note that not giving any argument
   is still an error).
(3) Edge and face .extend() methods ignore "invalid" edges or faces which
   have the same vertex twice instead of throwing an exception.  Cam and I
   argued about this for a while... :-)

Ken
2006-02-10 00:08:06 +00:00
Ken Hughes
ccedf6d833 ==Python API==
Bugfix #3849: "break" instead of "continue" caused memory corruption in
faces.extend() if an edge was given in the middle of parameter list.
2006-02-05 19:15:58 +00:00
Ken Hughes
8c333c63a4 Previous commit broke faces.extend() and edges.extend() for single edges
and faces.
2006-02-05 15:43:47 +00:00
Ken Hughes
eb185d7032 ==Python API==
A couple of bug fixes and enhancements:
(1) Setting the UV attributes of a mesh face will create texture faces if
    they are not already defined.  Previously this threw an exception.
(2) Setting the image attribute of a mesh face will also set the TEX bit
    of the face.mode flag
(3) When "sticky" vertices are created with mesh.vertexUV, the color is
    set to white instead of black.
(4) Bugfix #3872: copying the mode attribute of one mesh to another would
    sometimes result in an exception due to unexpected bits being set. I
    still don't know how these other bits are being set, but this patch will
    stop the complaint if they are set.
2006-02-05 07:19:37 +00:00
Ken Hughes
6e1db67cc0 ===Python API===
Bugfix: Hos discovered that recent fixes broke mesh.verts.extend(); it now
accepts three floats again.  Sorry....
2006-01-21 06:21:03 +00:00
Ken Hughes
0fcfd5bd40 ===Python API===
Bugfix #3660:  NMesh.getVertexInfluences() was broken following the changes
to the armature system.  Tron Thomas (kudos) came up with a fix that seems
to perform identically to the old method.  I'm also adding it to the Mesh
module for compatibility.
2006-01-19 15:48:56 +00:00
Ken Hughes
a8cb639f0b ==Python API==
Bugfix #3761: Attempting to set mesh.faceUV=1 when a mesh has no faces
now throws a RuntimeError exception.  Previous behavior was to do nothing.
2006-01-18 06:15:17 +00:00
75aa68e821 ==python api==
clarification of Blender.Mesh.Mode() tip
2006-01-17 09:20:37 +00:00
Ken Hughes
aeffb121c8 ==Python API==
Added Mesh.Modes() function, which allows scripts to get/set the selection
mode settings for meshes.  This was necessary in order for the mesh tools
such as triangulate, remove doubles, etc., to work properly.
2006-01-17 06:18:43 +00:00
Stephen Swaney
14cc1192a3 clean up some warnings in bpy code 2006-01-16 17:55:03 +00:00
Ken Hughes
c18db96f56 Cam Barton discovered the setter for me.faces[i].col was missing. 2006-01-13 17:22:53 +00:00