[SCM] blender/upstream: Imported Upstream version 2.76.b+dfsg0
mfv at users.alioth.debian.org
mfv at users.alioth.debian.org
Wed Dec 9 21:43:42 UTC 2015
The following commit has been merged in the upstream branch:
commit 5ea75f296db4aec5a1ae229bc19124f7933819f8
Author: Matteo F. Vescovi <mfv at debian.org>
Date: Fri Nov 13 21:21:23 2015 +0100
Imported Upstream version 2.76.b+dfsg0
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 3c705a1..355202c 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -49,7 +49,7 @@ extern "C" {
/* used by packaging tools */
/* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR a
+#define BLENDER_VERSION_CHAR b
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE release
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index aff3fb0..ea7ad0f 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -44,6 +44,7 @@ struct Brush *BKE_brush_add(struct Main *bmain, const char *name, short ob_mode)
struct Brush *BKE_brush_first_search(struct Main *bmain, short ob_mode);
struct Brush *BKE_brush_copy(struct Brush *brush);
void BKE_brush_make_local(struct Brush *brush);
+void BKE_brush_unlink(struct Main *bmain, struct Brush *brush);
void BKE_brush_free(struct Brush *brush);
void BKE_brush_sculpt_reset(struct Brush *brush);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index e0ffd83..4d619c8 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -215,11 +215,27 @@ void BKE_brush_free(Brush *brush)
MEM_freeN(brush->gradient);
}
+/**
+ * \note Currently users don't remove brushes from the UI (as is done for scene, text... etc)
+ * This is only used by RNA, which can remove brushes.
+ */
+void BKE_brush_unlink(Main *bmain, Brush *brush)
+{
+ Brush *brush_iter;
+
+ for (brush_iter = bmain->brush.first; brush_iter; brush_iter = brush_iter->id.next) {
+ if (brush_iter->toggle_brush == brush) {
+ brush_iter->toggle_brush = NULL;
+ }
+ }
+}
+
static void extern_local_brush(Brush *brush)
{
id_lib_extern((ID *)brush->mtex.tex);
id_lib_extern((ID *)brush->mask_mtex.tex);
id_lib_extern((ID *)brush->clone.image);
+ id_lib_extern((ID *)brush->toggle_brush);
id_lib_extern((ID *)brush->paint_curve);
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 9aacba8..deb6c8d 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -4013,10 +4013,18 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part,
float loc[3];
int num;
+ /* XXX: on checking '(psmd->dm != NULL)'
+ * This is incorrect but needed for metaball evaluation.
+ * Ideally this would be calcualted via the depsgraph, however with metaballs,
+ * the entire scenes dupli's are scanned, which also looks into uncalculated data.
+ *
+ * For now just include this workaround as an alternative to crashing,
+ * but longer term metaballs should behave in a more manageable way, see: T46622. */
+
uv[0] = uv[1] = 0.f;
if (cpa) {
- if (part->childtype == PART_CHILD_FACES) {
+ if ((part->childtype == PART_CHILD_FACES) && (psmd->dm != NULL)) {
mtface = CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
if (mtface) {
mface = psmd->dm->getTessFaceData(psmd->dm, cpa->num, CD_MFACE);
@@ -4032,7 +4040,7 @@ void psys_get_dupli_texture(ParticleSystem *psys, ParticleSettings *part,
}
}
- if (part->from == PART_FROM_FACE) {
+ if ((part->from == PART_FROM_FACE) && (psmd->dm != NULL)) {
mtface = CustomData_get_layer(&psmd->dm->faceData, CD_MTFACE);
num = pa->num_dmcache;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index aeb3168..5dcc5b3 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2131,6 +2131,7 @@ static void lib_link_brush(FileData *fd, Main *main)
brush->mtex.tex = newlibadr_us(fd, brush->id.lib, brush->mtex.tex);
brush->mask_mtex.tex = newlibadr_us(fd, brush->id.lib, brush->mask_mtex.tex);
brush->clone.image = newlibadr_us(fd, brush->id.lib, brush->clone.image);
+ brush->toggle_brush = newlibadr(fd, brush->id.lib, brush->toggle_brush);
brush->paint_curve = newlibadr_us(fd, brush->id.lib, brush->paint_curve);
}
}
diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c
index cd3c832..17b6d1d 100644
--- a/source/blender/bmesh/intern/bmesh_marking.c
+++ b/source/blender/bmesh/intern/bmesh_marking.c
@@ -102,7 +102,6 @@ static bool bm_vert_is_edge_select_any(const BMVert *v)
}
#endif
-#if 0
static bool bm_edge_is_face_select_any_other(BMLoop *l_first)
{
const BMLoop *l_iter = l_first;
@@ -115,7 +114,6 @@ static bool bm_edge_is_face_select_any_other(BMLoop *l_first)
}
return false;
}
-#endif
#if 0
static bool bm_edge_is_face_select_any(const BMEdge *e)
@@ -500,20 +498,6 @@ void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
BM_elem_flag_disable(f, BM_ELEM_SELECT);
bm->totfacesel -= 1;
}
- /**
- * \note This allows a temporarily invalid state - where for eg
- * an edge bay be de-selected, but an adjacent face remains selected.
- *
- * Rely on #BM_mesh_select_mode_flush to correct these cases.
- */
-#if 1
- l_iter = l_first = BM_FACE_FIRST_LOOP(f);
- do {
- BM_vert_select_set(bm, l_iter->v, false);
- BM_edge_select_set(bm, l_iter->e, false);
- } while ((l_iter = l_iter->next) != l_first);
-#else
- /* disabled, see T46494 */
/* flush down to edges */
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
@@ -531,7 +515,6 @@ void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
BM_vert_select_set(bm, l_iter->v, false);
}
} while ((l_iter = l_iter->next) != l_first);
-#endif
}
}
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 28c3deb..23a5825 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -475,7 +475,7 @@ static void bmw_LoopShellWireWalker_begin(BMWalker *walker, void *data)
bmw_LoopShellWireWalker_visitVert(walker, e->v1, NULL);
bmw_LoopShellWireWalker_visitVert(walker, e->v2, NULL);
}
- else {
+ else if (e->l) {
BMLoop *l_iter, *l_first;
l_iter = l_first = e->l;
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 05eda4d..91e372b 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -407,12 +407,9 @@ static Brush *brush_tool_toggle(Main *bmain, Brush *brush_orig, const int tool,
return br;
}
- else if (brush_orig->toggle_brush &&
- BLI_findindex(bmain->brush.first, brush_orig->toggle_brush) != -1)
- {
+ else if (brush_orig->toggle_brush) {
/* if current brush is using the desired tool, try to toggle
- * back to the previously selected brush (if it was set, and
- * if it still exists) */
+ * back to the previously selected brush. */
return brush_orig->toggle_brush;
}
else
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index b38f4fa..a677171 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -494,6 +494,7 @@ static void rna_Main_brushes_remove(Main *bmain, ReportList *reports, PointerRNA
{
Brush *brush = brush_ptr->data;
if (ID_REAL_USERS(brush) <= 0) {
+ BKE_brush_unlink(bmain, brush);
BKE_libblock_free(bmain, brush);
RNA_POINTER_INVALIDATE(brush_ptr);
}
--
blender packaging
More information about the pkg-multimedia-commits
mailing list