Commit Graph

334 Commits

Author SHA1 Message Date
Campbell Barton
5760c6b25c Merge branch 'master' into blender2.8 2018-05-03 20:24:44 +02:00
Campbell Barton
0f217de403 Fix T54927: BMesh Py error w/ select history slice 2018-05-03 20:23:32 +02:00
Brecht Van Lommel
34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Campbell Barton
264691e563 Merge branch 'master' into blender2.8 2018-02-19 17:46:42 +11:00
Campbell Barton
05f3e245a8 Fix T54098: Crash existing /w dyntopo sculpt
Optionally don't remap indices for objects.

Checking all objects parent's would reference a freed pointer
while freeing all objects.

In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.

Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.
2018-02-19 17:34:30 +11:00
Sergey Sharybin
df1c88b652 Merge branch 'master' into blender2.8 2018-02-15 14:15:55 +01:00
Campbell Barton
ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
Brecht Van Lommel
cdc31c3e6e Merge branch 'master' into blender2.8 2018-01-13 02:05:49 +01:00
Campbell Barton
a33a5880f7 Fix bmesh.utils.face_join arg parsing 2018-01-12 14:51:15 +11:00
Dalai Felinto
1cb6cea71c Merge remote-tracking branch 'origin/master' into blender2.8 2017-11-13 11:48:48 -02:00
Campbell Barton
aae8e21100 BMesh Py API: Expose color alpha 2017-11-12 15:48:24 +11:00
Sergey Sharybin
7ea7fd45d0 Merge branch 'master' into blender2.8 2017-10-24 12:19:48 +02:00
Campbell Barton
8661ab12a6 Fix BMesh PyAPI internal flag clearing logic
Would leave the flag set on raising an exception.
2017-10-24 16:52:54 +11:00
Brecht Van Lommel
f5456df095 Merge branch 'master' into blender2.8 2017-10-24 02:05:41 +02:00
Campbell Barton
1aa5b63661 Docs: improve bmesh exception message
Suggested in T53131
2017-10-23 21:57:32 +11:00
Bastien Montagne
557dc7d343 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/screen/screen_edit.c
2017-10-12 16:40:35 +02:00
Campbell Barton
b29e37ed81 Docs: add note for bmesh face_split_edgenet 2017-10-12 23:36:42 +11:00
Campbell Barton
572b1a644f Merge branch 'master' into blender2.8 2017-09-05 22:56:03 +10:00
Campbell Barton
85d53620aa Cleanup: avoid confusing assignment 2017-09-04 14:35:35 +10:00
Campbell Barton
32e36a1782 Correct own error simplifying matrix checks 2017-09-03 00:05:11 +10:00
Campbell Barton
2f8c8ec8fb Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 14:25:00 +10:00
Campbell Barton
cb7f1f8160 Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 12:40:36 +10:00
Campbell Barton
f8f6f8f26e Merge branch 'master' into blender2.8 2017-08-25 20:45:16 +10:00
Campbell Barton
738d942d29 Correct error in recent use of PyC_Long_*
Regression in 46cf33bf0
2017-08-25 02:09:23 +10:00
Campbell Barton
7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
Campbell Barton
46cf33bf01 PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.

Some inline exceptions are kept because they show useful details.
2017-08-20 15:49:10 +10:00
Sergey Sharybin
5605c26fcd Fix function declaration of some modifiers
Those functions did not use evaluation context.

Also fixed lots of unused variables warnings caused by commented out code which
needs to be ported away from DerivedMesh and to evaluation context.
2017-07-21 15:54:42 +02:00
Luca Rood
1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
Campbell Barton
819f3b37da BMesh face map layer access 2017-07-20 19:52:26 +10:00
Campbell Barton
bdbf4471a6 TexFace removal part 3
- MTexPoly structure & layer type.
- The 'Mesh.uv_textures' layers.
- DerivedMesh TexFace drawing.
- Scripts & UI.
2017-05-25 15:19:58 +10:00
Campbell Barton
7a9ad029dd Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.

To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.

This is used as a bake-target when not using Cycles too.
2017-05-24 23:38:15 +10:00
Sergey Sharybin
2d80f37bce Depsgraph: Remove old depsgraph header from python 2017-04-06 16:36:15 +02:00
Campbell Barton
fc9fa07c0e BMesh: BM_face_exists no longer uses return arg
Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.

Old code did some partial overlap checks where this made some sense,
but it's since been removed.
2016-11-14 04:33:35 +11:00
Campbell Barton
a96c9def6f PyAPI: minor optimization for dictionary creation
Pass size when its known.
2016-07-31 17:22:04 +10:00
Campbell Barton
cca57bf04c PyAPI: Use module names on initializaton
No need to re-convert from C strings to PyUnicode.
2016-07-14 15:51:56 +10:00
Campbell Barton
124bfa4d2d Cleanup: spelling, style 2016-07-08 00:48:45 +10:00
Campbell Barton
0a026033ae BMesh: make toolflags optional
Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.
2016-07-01 19:29:22 +10:00
Campbell Barton
65df2fd997 bmesh py api: expose BM_face_calc_tangent_*
D1988 by @wisaac, with own edits and improvements.

This improves on existing tangent calculation functions too.

- BM_face_calc_tangent_auto: Chooses method based on number of sides, used by manipulator (not exposed to Python).
- BM_face_calc_tangent_edge: from longest edge.
- BM_face_calc_tangent_edge_pair: from longest edge-pair (most useful with quads).
- BM_face_calc_tangent_edge_diagonal: edge farthest from any vertex.
- BM_face_calc_tangent_vert_diagonal: vert farthest from any vertex.

Also optimize BM_vert_tri_calc_tangent_edge* functions to avoid sqrt.
2016-06-12 15:12:34 +10:00
Campbell Barton
6d0cae56e8 Fix T48290: Hook fails after deleting geometry
Now CD_SHAPEKEY_INDEX customdata is stored in edit-mode when hooks and vertex parents are used.

This also fixes a bug where undo would loose key-index data.

Move to structs for BM_mesh_bm_to/from_me to avoid passing many argument, which mostly aren't used.
2016-04-29 23:39:50 +10:00
Campbell Barton
727f15f7d8 Docs: note that BMesh loops are accessed via faces
Resolves T48258
2016-04-25 11:57:52 +10:00
Campbell Barton
2a9bc888d0 Fix T47784: BMesh.from_object broken keyword args 2016-03-15 00:38:33 +11:00
Campbell Barton
f5604af464 Cleanup: use BM_mesh_* prefix for BMesh functions 2016-01-14 13:00:11 +11:00
Campbell Barton
8ca76d15b2 Add bmesh.select_history.discard
Follows convention for set, useful to avoid error handling with remove().
2016-01-13 04:03:47 +11:00
Campbell Barton
22ec7b17d2 BMesh: raise exception face-split w/ adjacent loops
Was raising "internal error".
2015-11-25 12:08:50 +11:00
Campbell Barton
b8c40d47e0 Cleanup: remove unused bmesh iterator 2015-11-19 22:13:35 +11:00
Campbell Barton
2eb50d450c Cleanup: simplify PyBMesh customdata API use 2015-09-18 16:40:54 +10:00
Campbell Barton
09e40a4956 Cleanup: spelling 2015-09-14 02:22:22 +10:00
Campbell Barton
1140238acf Fix T45976: Crash accessing BMesh customdata
Layers returned from items() and values() could have an invalid index.
2015-09-01 19:59:26 +10:00
Campbell Barton
9304df5182 Fix T45939: Crash w/ BMesh.*.sort() 2015-09-01 16:07:34 +10:00
Campbell Barton
c86a519898 Use qsort_r for BMesh Py API 2015-09-01 13:56:08 +10:00