Commit Graph

50 Commits

Author SHA1 Message Date
080a5d5664 exposed CustomData_get_active_layer_index in BKE_customdata.h (needed by python to get the active layer)
added python api stuff to deal with Color and UV/Image layers.

me.activeUvLayer - int
me.activeColorLayer - int
me.totUvLayers - int
me.totColorLayers - int

me.addUvLayer()
me.addColorLayer()
me.removeUvLayer()
me.removeColorLayer()


Variable names may need changing.
2006-12-13 00:50:02 +00:00
19a4f41172 =ID Properties Python Doc Update=
The epydocs are now updated to have idproperties;
all the modules that have bindings for ID properties
now has docs for them.  E.g Materials have a .properties
members, Image, Texture, Scene, Object, NMEsh, and Mesh.

I realized that .properties was already taken in
Objects, so I renamed it to .idproperties.  There was
also a nasty little problem with an example inside
Object.getType; the entire example was being pasted inside
the return field.  I fixed it by just moving the return
definition to after the example, like it should be.
2006-11-20 11:07:56 +00:00
ef56538c62 removed warning in last commit 2006-11-13 17:55:06 +00:00
26ef99157e made mesh.getFromObject() accept a python object as well as the object name.
accepting the name only was causing big problems when exporting library data, because duplicate names are possible the wrong data was exporting.
2006-11-13 17:37:01 +00:00
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
d89240ba12 added mesh_create_derived_view(ob) to DerivedMesh.c
exactly the same as mesh_create_derived_render(ob) except it uses the view modifier settings.

Added an optional arg to getFromObject to 'render' so you can choose to get the mesh displayed in the 3d view or generate one with render settings.
Solved bug 4612 getFromObject now works with soft body meshes (error was caused by getting the derived mesh from a copy of the object)

removed workaround for softbody bug in object_apply_def.py
2006-09-17 05:15:56 +00:00
d0cabce889 added sharp edge to python edge flags 2006-08-29 10:04:10 +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
00a6a79899 added the texmesh to Mesh property to mesh. 2006-07-31 12:57:46 +00:00
Stephen Swaney
fec1ebaca3 A little spell-checkage.
Some return types changed from PyNone ( a C name ) to None.
2006-07-12 01:36:07 +00:00
b54d5809c4 Added some notes on mesh materials and object getData(mesh=1) 2006-07-11 15:02:14 +00:00
Ken Hughes
02dcea079e ===Python API===
"Campbell-fix:" correct two minor misspellings in last commits.
2006-07-06 13:47:21 +00:00
68fc1ce02c added an example for face.col - normal mapping 2006-07-06 06:24:49 +00:00
ba13c4082b Added an example of using edge flags in the epydocs 2006-07-06 05:51:13 +00:00
1c9a7a032b fixed a bug in poly redux's vgroup weight merging (was reducing the weight each collapse by about half)
fixed some other UI logic in the python menu script
Added an option to use a vertex group for a reduction weight map to force reducing some areas more then others.

Mesh epydocs activeGroups can be None as well as string.
2006-07-05 20:37:07 +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
e77112f76b ===Python API===
added len() operator for MFaces, which returns number of MVerts.
2006-06-06 18:14:31 +00:00
Ken Hughes
7b1d6021a4 ===Python API===
Fix typo in Mesh.py epydoc.
2006-05-29 03:52:38 +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
6ebdfbfc85 ===Python API===
Fixed epydoc summaries for mesh.vert.index and mesh.vert.uvco so they say
something useful other than "(MVert Only)".
2006-05-27 23:31:13 +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
Ken Hughes
b69cde1eb7 ===Python API===
Fixing some nmesh typos in Mesh docfile (thanks, Hos).
2006-05-12 20:47:39 +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
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
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
ae32a538dd ===Python API===
Taking a hint from Hos, started adding some (hopefully) better examples into
the documentation for creating and manipulating meshes.
2006-03-04 00:04:45 +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
8c333c63a4 Previous commit broke faces.extend() and edges.extend() for single edges
and faces.
2006-02-05 15:43:47 +00:00
e66b5e5cd5 UV Editor Tweaks:
- Set local sticky in the uv editor as default.
- Don't do live unwrap on fully selected charts or charts with no pins
  selected.
- Fixed bug with live unwrap not respecting transform cancel in some cases.
- "View Home" didn't work without an image.
- Move UV Calculation settings (cube size, cylinder radius, ..) into the scene
  toolsettings, instead of global variables
- Remove the name LSCM from the UI (and python docs on seams), and replace it
  with 'Unwrap', with upcoming ABF this didn't make sense anymore.
- Move the Old/New LSCM switch into the UV Calculation panel. New LSCM is the
  default now. Also renamed LSCM there to "Conformal".
- Made some room in the UV Calculation panel by removing the buttons to execute
  the UV calculation, only leaving the settings.

Fill Holes:

- LSCM now has an option to fill holes in the chart before unwrapping. This on
  by default, and enables two things:
  - Prevent internal overlaps (e.g. eyes, mouth) for LSCM unwrapping.
  - Allow the internal boundaries to move freely during stretch minimize.
- The possibility to switch it off is there because it is not always possible
  to define which the outer boundary is. For example with an open cylinder
  where there are two identical holes.
2006-02-05 14:12:45 +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
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
Ken Hughes
c18db96f56 Cam Barton discovered the setter for me.faces[i].col was missing. 2006-01-13 17:22:53 +00:00
Ken Hughes
0ee5c131dc A few Mesh fixes:
* edge and face extend() methods now add edges and faces in the order given
  by their parameters.  Note that if duplicate edges or faces are specified,
  the order is preserved but the dups are removed, so indices won't match.
* allow extend(), findEdges() and faces.uv to accept lists or tuples
* fix bug in mesh.verts.extend() which didn't correctly check argument types
2006-01-11 18:37:47 +00:00
b73748bdd0 Just added some comments about face material incides and the material list. 2005-12-29 11:08:55 +00:00
Ken Hughes
ea16c447c3 Fix typo in epydocs for Mesh example 2005-12-21 18:12:28 +00:00
Ken Hughes
a86b0af575 -- added an optional "cage" parameter to mesh.getFromObject() to allow
getting cage vertices from geometry objects
2005-11-20 01:07:54 +00:00
4ea1c4dc60 * update to python docs
- update for the old mathutils rewrite
- update for some other methods ive added
- added explaination of wrapped data
- added a .css file for epydoc gives nice blender/python colors :?
2005-11-15 21:14:24 +00:00
Ken Hughes
1ba15893bd -- changes and bugfixes from Cam:
-- calling mesh.getFromObject(obj) with mesh object now also
     copies material properties
  -- mesh.quadToTriangle() takes a parameter to duplicate both
     Ctrl-TKEY and Shift-Ctrl-TKEY actions
  -- assigning None to mesh.verts "clears" the memory allocated
     to the mesh (equivalent of Mesh.New(), but on an existing
     mesh)
  -- exception handler message for mesh.faces[i].uv = [..] more
     clear (uv attribute only accepts tuple, not list)
  -- fixed bug for meshs with deformed verts when deleting verts
     (deformed verts deleted and repacked correctly now, I think)
2005-11-08 21:50:30 +00:00
Ken Hughes
b729020276 - change description of AssignModes from "blah blah" to something meaningful. 2005-10-27 22:07:43 +00:00
Ken Hughes
a9a545d784 Lots of BPy Mesh additions:
- added faces.uvSel attribute: can get/set selection status of UV vertices in
  UV Editor window
- make mesh.faceUV, mesh.vertexUV and mesh.vertexColor writable: users
  can now enable/disable UV faces, vertex colors, "sticky" vertices
- fixed bug with mesh tool methods: before it would only work if an object
  linked to the mesh was selected
- added mesh.quadToTriangle() and mesh.triangleToQuad() methods
- added selected() method to verts, edges, faces; returns list of indices
  of selected items
- mesh.getFromObject() now gets derived mesh data
- ported vertex group methods from NMesh (required change to Object.c)
- ported module dictionaries from NMesh
2005-10-27 19:37:37 +00:00
Ken Hughes
233ee5adb7 - documentation updates:
-- add Key module to index page
  -- include cross references for Object.colbits in material descriptions
     within Object, NMesh and Mesh modules
2005-10-21 17:20:54 +00:00
Ken Hughes
7d325f1ed4 - New additions to Mesh module
- new methods from NMesh (transform, getFromObject, findEdges)
  - new methods for deleting groups of verts, edges and faces
  - new methods for accessing mesh editing tools: fill, flipNormals,
    recalcNormals, remDoubles, smooth, subdivide, toSphere
- Added PVertType to Types module (not my favorite name; any suggestions?)
2005-10-19 21:24:18 +00:00
Ken Hughes
5380db502e - added Mesh.MVert(); can now create 'thick' vertices which don't wrap mesh
- implemented slice operations (get/set) for vertex list; allows script
  writers to manipulate lists of vertices (using 'thick' vertices)
- fixed problem in mesh.faces.extend() which allowed the creation of
  "Eeekadoodle" faces
- added mesh.update() method; (possibly) temporary fix to allow updating DAG
2005-10-11 04:09:08 +00:00
Ken Hughes
ac668ea561 Added Mesh.New() method; can now create new meshes within the module
Changed Object.link() to allow link objects with both BPython-type meshes
Changed Object.getData() to allow retrieving both types of BPython-type meshes

Added new mesh types to Types module
2005-10-04 15:17:27 +00:00
Ken Hughes
fde63008a5 Documentation for new Python thinmesh module 2005-10-03 18:23:04 +00:00