Commit Graph

3654 Commits

Author SHA1 Message Date
20e2330434 added Mesh.calc_tessface(), needed to update mesh tessface after bmesh edits.
also add py api BMDeformVert.clear()
2012-03-29 13:44:30 +00:00
c9e1ced4dd code cleanup: (dont include ';' in defines), last commit also missed changes to paint_image.c 2012-03-28 01:06:43 +00:00
7f1e9b8c41 bmesh py api:
added access to deform weights, access to weights acts like a python dict so you can do...

  print(group in dvert)
  dvert[group] = 0.5
  print(dvert[group])
  del dvert[group]
  print(dvert.items())
2012-03-27 10:30:10 +00:00
abf551b1a5 style cleanup: py api 2012-03-26 20:41:54 +00:00
11d12d945e style cleanup: python api 2012-03-26 06:55:09 +00:00
81d8f17843 style cleanup: pep8, indentation 2012-03-24 07:36:32 +00:00
5a90ea77bc style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:24:53 +00:00
3c11379e26 code cleanup: move bmesh inline funcs to headers (avoids compiling the C files). 2012-03-24 01:24:58 +00:00
db37011930 bmesh py api:
added BMFace.material_index
2012-03-22 09:29:18 +00:00
7044d80639 code cleanup: remove BMesh * args from query functions which don't need it 2012-03-22 07:53:11 +00:00
b56d2f9766 fix [#30623] user-defined render presets bug
this report exposed multiple bugs in blender when using a non utf8 compatible home directory.

- bpy.utils.script_paths() would crash when homedir wasn't utf8 (reported bug)
- PyC_DefaultNameSpace() - would raise an error when running when __file__ was non utf8.
- preset filepath property was not set to accept non utf8.
- bpy.paths.display_name would raise an error on non utf8 paths, (used for preset draw)
2012-03-21 22:29:49 +00:00
d76c05cd36 style cleanup: bmesh 2012-03-21 09:10:08 +00:00
9773f87891 bmesh docs:
- add examples for custom-data access
- group BMesh types logically in docs
- added missing docstrings

needed to add grouping functionality to sphinx for this.
2012-03-21 05:33:37 +00:00
5935ff3aaa fix for Quaternion.to_axis_angle() returning a zero axis vector. 2012-03-20 23:37:54 +00:00
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
7dda8182ad fix to possible bug running python callbacks - bpy.app.handlers.* to support handlers removing themselves from the list. 2012-03-20 20:37:40 +00:00
3b9b53d876 fix [#30589] RNA function descriptions not showing in Python console on autocomplete
show rna function description and arguments now.
2012-03-20 07:41:47 +00:00
be116242d4 style cleanup 2012-03-20 04:27:14 +00:00
b163e19b8d py api:
fix for collection functions not showing up in __dir__,

eg, console autocomplete didnt show up bpy.data.libraries.load

also fix refcounting leak with returning attributes from collections.
2012-03-20 03:13:25 +00:00
f11a6d3a84 Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.

Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
2012-03-20 02:17:37 +00:00
9c642781a6 style cleanup: minor change to bmesh py repr + comment on loop radial next/prev to avoid confusion. 2012-03-19 20:01:59 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
560d8ad12c bmesh py api:
use different types for bm.verts.layers, bm.faces.layers, otherwise the layers look to have customdata type that isnt compatible, UV's on edges for eg.
2012-03-17 23:22:44 +00:00
05612c0419 code cleanup: not all mathutils callback creation functions tool unsigned char for type & subtype args. 2012-03-17 22:31:57 +00:00
91580c0929 swap BMLoopCol r/b color, requires subversion bump.
old mesh MCol 'r' was blue, 'b' was red, but theres no reason to keep this for bmesh with MLoopCol.

Loading old files works, saving legacy format works too.

What wont work is loading a file after this revision and loading it in an older revision since the bmesh merge.
(it wont crash but the blue and red will be swapped on vertex color layers).
2012-03-17 20:39:28 +00:00
8b7ea6fc90 bmesh py api:
access to MLoopCol as mathutils.Color type
2012-03-17 19:34:02 +00:00
02f707e9da minor mathutils code cleanup - use mathutils callbacks as unsigned chars everywhere. 2012-03-17 10:46:02 +00:00
29831ca087 bmesh py api:
added per loop UV layer access
2012-03-17 06:40:44 +00:00
757c0af9c6 bmesh py api:
split up BMElemSeq into BMVertSeq, BMEdgeSeq, BMFaceSeq and BMLoopSeq

 Was becoming cumbersome since each needed their own new() function, and other methods only worked for some of these types.

Added BMesh.loops - since you cant iterate over loops this is for customdata access only.
2012-03-17 04:43:32 +00:00
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
f91407150a bmesh py api:
initial support for editing bmesh customdata per vert/edge/face/loop

shapes, crease, bevel weights working, missing UVs and Vertex Colors still.
2012-03-16 08:26:22 +00:00
ebec111618 bmesh py api:
Wrap customdata, so far you can access the data layers in a pythonic way but not manipulate the customdata yet.

provides dictionary like access to customdata layers, eg:
  texpoly = bm.faces.tex["UVMap"]
  print(bm.verts.shape.keys())  # un-intended pun, keys() works on all layers.
  print("MyInt" in bm.edges.int)  # __contains__
  layer = bm.faces.get("CheckForLayer")
2012-03-16 05:03:13 +00:00
c38e8e7a66 missed these last commit 2012-03-15 06:51:09 +00:00
6ed9c58a3d prepare for adding bmesh py api for customdata layer access - no functional changes. 2012-03-15 06:08:27 +00:00
c2d93e8d4a comment cleanup 2012-03-14 22:39:56 +00:00
ee9a00948b mathutils py api:
Vector.angle_signed(other)
  for 2D vectors to get the clockwise angle between them.

  in BLI math its called - angle_signed_v2v2()

shorthand for...

  atan2f((v1[1] * v2[0]) - (v1[0] * v2[1]), dot_v2v2(v1, v2))

also corrects compile error in last commit.
2012-03-14 06:14:15 +00:00
f15c15e992 bmesh py api: finished todo - editable select_history
eg:
  bm.select_history = vert, face, edge

  bm.select_history.add(edge)
2012-03-14 04:46:12 +00:00
f80fa54428 documentation edit to address bmesh py api bug [#30453]
warn when addons are not found when running cmake.
2012-03-14 00:30:20 +00:00
2fbb5ce833 bmesh py api: more comprehensive intro page, also fix some spelling errors. 2012-03-13 06:22:43 +00:00
a69585573e bmesh python api:
BMesh.select_history.remove/clear/validate functions.
2012-03-13 02:59:42 +00:00
8646bb4464 workaround [#30480] Knife tool flicker
the problem was numeric precision when in ortho mode the start/end points for the view vector would be 2000 apart which caused trouble for the intersection test.
2012-03-13 01:11:08 +00:00
b330abc290 remove Object member from BMesh struct - was only used for undo and BMEditMesh already stores an object pointer.
also fix for own mistake with mesh conversion refactor, shape key index was off by 1 when switching editmode.
2012-03-11 19:58:56 +00:00
178c2c32f2 [#30503] Callback for render job completion
from Jason van Gumster (thefallenweeble)

adds render_complete and render_cancel callbacks to bpy.app.handlers
2012-03-11 17:24:03 +00:00
7fa7e4ba1f bmesh python api additions:
- BMesh.is_wrapped
- BMesh.copy()
- BMesh.clear()
- BMesh.free()
- BMesh.from_object(obj, apply_modifiers=True)
- BMEdge.calc_length()
- BMLoop.calc_normal()
- BMLoop.calc_tangent()
2012-03-11 05:58:22 +00:00
050439fd9d bmesh py api - correct class references in docs and rename mesh conversion funcs to ne less confusing. 2012-03-11 04:07:22 +00:00
21fd09c028 bmesh py api: change .from_mesh() / .to_mesh() to be class methods of BMesh rather than functions in the module.
added example script which converts a mesh to a bmesh, edits and converts back again.
2012-03-11 02:45:27 +00:00
e09ab8883c bmesh:
- moved mesh conversion functions into their own file.

bmesh py api:
- can now create a new empty bmesh without first creating mesh data.
- added function to copy bmesh data back to a mesh.
- bmesh.from_mesh() can now get a mesh which isnt in editmode.
2012-03-10 20:41:19 +00:00
4dc35836ad code cleanup: remove unused variable assignents and added bmesh submodule links, doc correction reported by dfelinto. 2012-03-09 21:23:15 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00