Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-16 14:43:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-16 14:43:18 +0400
commitb214ea3aa402fe8d377de38276a068456a5c5223 (patch)
treef49f05b9fe46ad503baa15098ef70cf9f93e4035 /source
parent66181332814f3128254622eada820a42a968c10b (diff)
svn merge ^/trunk/blender -c56620 -c56639 -c56643 -c56647 -c56648 -c56650 -c56651 -c56653 -c56654 -c56661 -c56662 -c56663 -c56668 -c56670 -c56671 -c56672 -c56673 -c56674 -c56676 -c56678 -c56679 -c56680 -c56682 -c56688 -c56689 -c56698 -c56700 -c56707 -c56711 -c56735 -c56745 -c56747 -c56748 -c56749 -c56755 -c56756 -c56759 -c56760 -c56763 -c56766 -c56767 -c56773 -c56778 -c56783 -c56784 -c56785 -c56790 -c56791 -c56793 -c56800 -c56806 -c56807 -c56809 -c56815 -c56816 -c56820
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_curve.h2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c3
-rw-r--r--source/blender/blenkernel/intern/constraint.c20
-rw-r--r--source/blender/blenkernel/intern/curve.c5
-rw-r--r--source/blender/blenkernel/intern/customdata.c8
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c12
-rw-r--r--source/blender/blenkernel/intern/displist.c8
-rw-r--r--source/blender/blenkernel/intern/freestyle.c6
-rw-r--r--source/blender/blenkernel/intern/lamp.c6
-rw-r--r--source/blender/blenkernel/intern/material.c6
-rw-r--r--source/blender/blenlib/intern/math_matrix.c4
-rw-r--r--source/blender/blenlib/intern/string.c62
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c167
-rw-r--r--source/blender/bmesh/operators/bmo_edgesplit.c1
-rw-r--r--source/blender/compositor/nodes/COM_GroupNode.cpp89
-rw-r--r--source/blender/compositor/nodes/COM_GroupNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ViewerNode.cpp5
-rw-r--r--source/blender/compositor/nodes/COM_ZCombineNode.cpp15
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp9
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp9
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_ZCombineOperation.cpp21
-rw-r--r--source/blender/editors/armature/armature_ops.c9
-rw-r--r--source/blender/editors/curve/curve_ops.c6
-rw-r--r--source/blender/editors/include/UI_interface.h4
-rw-r--r--source/blender/editors/include/UI_view2d.h2
-rw-r--r--source/blender/editors/interface/interface.c6
-rw-r--r--source/blender/editors/interface/interface_handlers.c46
-rw-r--r--source/blender/editors/interface/interface_layout.c21
-rw-r--r--source/blender/editors/interface/interface_regions.c33
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c12
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/interface/view2d.c2
-rw-r--r--source/blender/editors/screen/area.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h6
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c20
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c3
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c31
-rw-r--r--source/blender/editors/space_action/action_ops.c6
-rw-r--r--source/blender/editors/space_file/file_draw.c22
-rw-r--r--source/blender/editors/space_graph/graph_ops.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c6
-rw-r--r--source/blender/editors/space_node/node_ops.c5
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c35
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c4
-rw-r--r--source/blender/editors/space_text/space_text.c4
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c5
-rw-r--r--source/blender/editors/transform/transform.c25
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp5
-rw-r--r--source/blender/freestyle/intern/geometry/Bezier.cpp5
-rw-r--r--source/blender/freestyle/intern/geometry/FitCurve.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp12
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp7
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h2
-rw-r--r--source/blender/freestyle/intern/system/PseudoNoise.cpp5
-rw-r--r--source/blender/freestyle/intern/system/PseudoNoise.h3
-rw-r--r--source/blender/freestyle/intern/system/TimeStamp.cpp2
-rw-r--r--source/blender/freestyle/intern/system/TimeStamp.h6
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c23
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c5
-rw-r--r--source/blender/makesrna/intern/rna_particle.c53
-rw-r--r--source/blender/makesrna/intern/rna_scene.c3
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c5
-rw-r--r--source/blender/modifiers/intern/MOD_array.c4
-rw-r--r--source/blender/modifiers/intern/MOD_boolean.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c18
-rw-r--r--source/blender/render/intern/source/convertblender.c2
-rw-r--r--source/blender/render/intern/source/imagetexture.c9
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/WM_keymap.h2
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c6
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c3
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c27
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp6
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp4
-rw-r--r--source/gameengine/Ketsji/BL_Action.cpp31
-rw-r--r--source/gameengine/Ketsji/BL_Action.h1
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp12
87 files changed, 728 insertions, 382 deletions
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 8ae7155c205..3be77086336 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -83,7 +83,7 @@ void BKE_curve_editNurb_keyIndex_free(struct EditNurb *editnurb);
void BKE_curve_editNurb_free(struct Curve *cu);
struct ListBase *BKE_curve_editNurbs_get(struct Curve *cu);
-float *BKE_curve_make_orco(struct Scene *scene, struct Object *ob);
+float *BKE_curve_make_orco(struct Scene *scene, struct Object *ob, int *r_numVerts);
float *BKE_curve_surf_make_orco(struct Object *ob);
void BKE_curve_bevelList_make(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 8201b657c33..d9dde6debc6 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -658,9 +658,8 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
*/
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
- glDisable(GL_TEXTURE_2D);
+ GPU_set_tpage(NULL, false, false);
BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
- glEnable(GL_TEXTURE_2D);
}
return;
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index af5a20e97b4..cee796c4cab 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -380,29 +380,31 @@ static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[
if (dm) {
MDeformVert *dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
int numVerts = dm->getNumVerts(dm);
- int i, count = 0;
+ int i;
float co[3], nor[3];
/* check that dvert is a valid pointers (just in case) */
if (dvert) {
MDeformVert *dv = dvert;
+ float weightsum = 0.0f;
+
/* get the average of all verts with that are in the vertex-group */
for (i = 0; i < numVerts; i++, dv++) {
MDeformWeight *dw = defvert_find_index(dv, defgroup);
- if (dw && dw->weight != 0.0f) {
+
+ if (dw && dw->weight > 0.0f) {
dm->getVertCo(dm, i, co);
dm->getVertNo(dm, i, nor);
- add_v3_v3(vec, co);
- add_v3_v3(normal, nor);
- count++;
-
+ madd_v3_v3fl(vec, co, dw->weight);
+ madd_v3_v3fl(normal, nor, dw->weight);
+ weightsum += dw->weight;
}
}
/* calculate averages of normal and coordinates */
- if (count > 0) {
- mul_v3_fl(vec, 1.0f / count);
- mul_v3_fl(normal, 1.0f / count);
+ if (weightsum > 0) {
+ mul_v3_fl(vec, 1.0f / weightsum);
+ mul_v3_fl(normal, 1.0f / weightsum);
}
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index f531c6526dd..35f99806df0 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1328,7 +1328,7 @@ float *BKE_curve_surf_make_orco(Object *ob)
/* NOTE: This routine is tied to the order of vertex
* built by displist and as passed to the renderer.
*/
-float *BKE_curve_make_orco(Scene *scene, Object *ob)
+float *BKE_curve_make_orco(Scene *scene, Object *ob, int *r_numVerts)
{
Curve *cu = ob->data;
DispList *dl;
@@ -1358,6 +1358,9 @@ float *BKE_curve_make_orco(Scene *scene, Object *ob)
}
}
+ if (r_numVerts)
+ *r_numVerts = numVerts;
+
fp = coord_array = MEM_mallocN(3 * sizeof(float) * numVerts, "cu_orco");
for (dl = disp.first; dl; dl = dl->next) {
if (dl->type == DL_INDEX3) {
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 2118bbcd42b..9e71a5e553e 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -239,12 +239,16 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
for (j = 0; j < source->totweight; ++j) {
MDeformWeight *dw = &source->dw[j];
+ float weight = dw->weight * interp_weight;
+
+ if (weight == 0.0f)
+ continue;
for (node = dest_dw; node; node = node->next) {
MDeformWeight *tmp_dw = (MDeformWeight *)node->link;
if (tmp_dw->def_nr == dw->def_nr) {
- tmp_dw->weight += dw->weight * interp_weight;
+ tmp_dw->weight += weight;
break;
}
}
@@ -254,7 +258,7 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
MDeformWeight *tmp_dw = MEM_callocN(sizeof(*tmp_dw),
"layerInterp_mdeformvert tmp_dw");
tmp_dw->def_nr = dw->def_nr;
- tmp_dw->weight = dw->weight * interp_weight;
+ tmp_dw->weight = weight;
BLI_linklist_prepend(&dest_dw, tmp_dw);
totweight++;
}
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 1bae4ec68cc..86832a72b90 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -372,8 +372,8 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
*/
if (ma->id.flag & LIB_DOIT)
return;
- else
- ma->id.flag |= LIB_DOIT;
+
+ ma->id.flag |= LIB_DOIT;
/* material itself */
if (ma->adt)
@@ -386,6 +386,8 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
/* material's nodetree */
if (ma->nodetree)
dag_add_shader_nodetree_driver_relations(dag, node, ma->nodetree);
+
+ ma->id.flag &= ~LIB_DOIT;
}
/* recursive handling for lamp drivers */
@@ -397,8 +399,8 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
*/
if (la->id.flag & LIB_DOIT)
return;
- else
- la->id.flag |= LIB_DOIT;
+
+ la->id.flag |= LIB_DOIT;
/* lamp itself */
if (la->adt)
@@ -411,6 +413,8 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
/* lamp's nodetree */
if (la->nodetree)
dag_add_shader_nodetree_driver_relations(dag, node, la->nodetree);
+
+ la->id.flag &= ~LIB_DOIT;
}
static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node, int skip_forcefield, bool no_collision)
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 97923d23fb1..6486c4c150b 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1102,7 +1102,13 @@ static void add_orco_dm(Scene *scene, Object *ob, DerivedMesh *dm, DerivedMesh *
dm->getVertCos(dm, orco);
}
else {
- orco = (float(*)[3])BKE_curve_make_orco(scene, ob);
+ int totvert_curve;
+ orco = (float(*)[3])BKE_curve_make_orco(scene, ob, &totvert_curve);
+ if (totvert != totvert_curve) {
+ MEM_freeN(orco);
+ orco = MEM_callocN(sizeof(float) * 3 * totvert, "dm orco");
+ dm->getVertCos(dm, orco);
+ }
}
for (a = 0; a < totvert; a++) {
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c
index b514b004170..32fe4ac4ba6 100644
--- a/source/blender/blenkernel/intern/freestyle.c
+++ b/source/blender/blenkernel/intern/freestyle.c
@@ -68,8 +68,10 @@ void BKE_freestyle_config_free(FreestyleConfig *config)
lineset->group->id.us--;
lineset->group = NULL;
}
- lineset->linestyle->id.us--;
- lineset->linestyle = NULL;
+ if (lineset->linestyle) {
+ lineset->linestyle->id.us--;
+ lineset->linestyle = NULL;
+ }
}
BLI_freelistN(&config->linesets);
BLI_freelistN(&config->modules);
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 32cc5c6c22e..903b032e080 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -258,8 +258,8 @@ void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
* in the meantime... [#32017] */
if (la->id.flag & LIB_DOIT)
return;
- else
- la->id.flag |= LIB_DOIT;
+
+ la->id.flag |= LIB_DOIT;
/* lamp itself */
if (la->adt && la->adt->drivers.first)
@@ -268,5 +268,7 @@ void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
/* nodes */
if (la->nodetree)
lamp_node_drivers_update(scene, la->nodetree, ctime);
+
+ la->id.flag &= ~LIB_DOIT;
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 7e70b9d9cd5..2b7a41933b4 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1133,8 +1133,8 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
*/
if (ma->id.flag & LIB_DOIT)
return;
- else
- ma->id.flag |= LIB_DOIT;
+
+ ma->id.flag |= LIB_DOIT;
/* material itself */
if (ma->adt && ma->adt->drivers.first) {
@@ -1145,6 +1145,8 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
if (ma->nodetree) {
material_node_drivers_update(scene, ma->nodetree, ctime);
}
+
+ ma->id.flag &= ~LIB_DOIT;
}
/* ****************** */
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index d9063b80f13..c2b64163e54 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1025,8 +1025,8 @@ void adjoint_m2_m2(float m1[2][2], float m[2][2])
{
BLI_assert(m1 != m);
m1[0][0] = m[1][1];
- m1[0][1] = -m[1][0];
- m1[1][0] = -m[0][1];
+ m1[0][1] = -m[0][1];
+ m1[1][0] = -m[1][0];
m1[1][1] = m[0][0];
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 0982670eb5a..ed11d122e93 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -433,13 +433,57 @@ int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
return 0;
}
+/* compare number on the left size of the string */
+static int left_number_strcmp(const char *s1, const char *s2, int *tiebreaker)
+{
+ const char *p1 = s1, *p2 = s2;
+ int numdigit, numzero1, numzero2;
+
+ /* count and skip leading zeros */
+ for (numzero1 = 0; *p1 && (*p1 == '0'); numzero1++)
+ p1++;
+ for (numzero2 = 0; *p2 && (*p2 == '0'); numzero2++)
+ p2++;
+
+ /* find number of consecutive digits */
+ for (numdigit = 0; ; numdigit++) {
+ if (isdigit(*(p1 + numdigit)) && isdigit(*(p2 + numdigit)))
+ continue;
+ else if (isdigit(*(p1 + numdigit)))
+ return 1; /* s2 is bigger */
+ else if (isdigit(*(p2 + numdigit)))
+ return -1; /* s1 is bigger */
+ else
+ break;
+ }
+
+ /* same number of digits, compare size of number */
+ if (numdigit > 0) {
+ int compare = strncmp(p1, p2, numdigit);
+
+ if (compare != 0)
+ return compare;
+ }
+
+ /* use number of leading zeros as tie breaker if still equal */
+ if (*tiebreaker == 0) {
+ if (numzero1 > numzero2)
+ *tiebreaker = 1;
+ else if (numzero1 < numzero2)
+ *tiebreaker = -1;
+ }
+
+ return 0;
+}
+
/* natural string compare, keeping numbers in order */
int BLI_natstrcmp(const char *s1, const char *s2)
{
register int d1 = 0, d2 = 0;
register char c1, c2;
+ int tiebreaker = 0;
- /* if both chars are numeric, to a strtol().
+ /* if both chars are numeric, to a left_number_strcmp().
* then increase string deltas as long they are
* numeric, else do a tolower and char compare */
@@ -448,17 +492,11 @@ int BLI_natstrcmp(const char *s1, const char *s2)
c2 = tolower(s2[d2]);
if (isdigit(c1) && isdigit(c2) ) {
- int val1, val2;
-
- val1 = (int)strtol(s1 + d1, (char **)NULL, 10);
- val2 = (int)strtol(s2 + d2, (char **)NULL, 10);
+ int numcompare = left_number_strcmp(s1 + d1, s2 + d2, &tiebreaker);
- if (val1 < val2) {
- return -1;
- }
- else if (val1 > val2) {
- return 1;
- }
+ if (numcompare != 0)
+ return numcompare;
+
d1++;
while (isdigit(s1[d1]) )
d1++;
@@ -487,7 +525,7 @@ int BLI_natstrcmp(const char *s1, const char *s2)
d1++;
d2++;
}
- return 0;
+ return tiebreaker;
}
void BLI_timestr(double _time, char *str, size_t maxlen)
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index 55d9153fd63..363e46c9b2c 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -428,6 +428,15 @@ static void *bmw_IslandWalker_step(BMWalker *walker)
*
* Starts at a tool-flagged edge and walks over the edge loop
*/
+
+/* utility function to see if an edge is apart of an ngon boundary */
+static bool bm_edge_is_single(BMEdge *e)
+{
+ return ((BM_edge_is_boundary(e)) &&
+ (e->l->f->len != 4) &&
+ (BM_edge_is_boundary(e->l->next->e) || BM_edge_is_boundary(e->l->prev->e)));
+}
+
static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
{
BMwLoopWalker *lwalk = NULL, owalk;
@@ -444,7 +453,7 @@ static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
lwalk->cur = lwalk->start = e;
lwalk->lastv = lwalk->startv = v;
lwalk->is_boundary = BM_edge_is_boundary(e);
- lwalk->is_single = (vert_edge_count[0] == 2 && vert_edge_count[1] == 2);
+ lwalk->is_single = (lwalk->is_boundary && bm_edge_is_single(e));
/* could also check that vertex*/
if ((lwalk->is_boundary == false) &&
@@ -522,7 +531,9 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
nexte = BM_edge_exists(v, l->v);
if (bmw_mask_check_edge(walker, nexte) &&
- !BLI_ghash_haskey(walker->visithash, nexte))
+ !BLI_ghash_haskey(walker->visithash, nexte) &&
+ /* never step onto a boundary edge, this gives odd-results */
+ (BM_edge_is_boundary(nexte) == false))
{
lwalk = BMW_state_add(walker);
lwalk->cur = nexte;
@@ -536,52 +547,56 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
}
}
}
- else if (l) { /* NORMAL EDGE WITH FACES */
- int vert_edge_tot;
- int stopi = 0;
+ else if (l == NULL) { /* WIRE EDGE */
+ BMIter eiter;
- v = BM_edge_other_vert(e, lwalk->lastv);
+ /* match trunk: mark all connected wire edges */
+ for (i = 0; i < 2; i++) {
+ v = i ? e->v2 : e->v1;
- vert_edge_tot = BM_vert_edge_count_nonwire(v);
+ BM_ITER_ELEM (nexte, &eiter, v, BM_EDGES_OF_VERT) {
+ if ((nexte->l == NULL) &&
+ bmw_mask_check_edge(walker, nexte) &&
+ !BLI_ghash_haskey(walker->visithash, nexte))
+ {
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = nexte;
+ lwalk->lastv = v;
- if (/* check if we should step, this is fairly involved */
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
- /* typical loopiong over edges in the middle of a mesh */
- /* however, why use 2 here at all? I guess for internal ngon loops it can be useful. Antony R. */
- ((vert_edge_tot == 4 || vert_edge_tot == 2) && owalk.is_boundary == false) ||
+ BLI_ghash_insert(walker->visithash, nexte, NULL);
+ }
+ }
+ }
+ }
+ else if (owalk.is_boundary == false) { /* NORMAL EDGE WITH FACES */
+ int vert_edge_tot;
- /* walk over boundary of faces but stop at corners */
- (owalk.is_boundary == true && owalk.is_single == false && vert_edge_tot > 2) ||
+ v = BM_edge_other_vert(e, lwalk->lastv);
- /* initial edge was a boundary, so is this edge and vertex is only apart of this face
- * this lets us walk over the the boundary of an ngon which is handy */
- (owalk.is_boundary == true && owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e)))
- {
- i = 0;
- stopi = vert_edge_tot / 2;
- while (1) {
- if ((owalk.is_boundary == false) && (i == stopi)) {
- break;
- }
+ vert_edge_tot = BM_vert_edge_count_nonwire(v);
+ /* typical loopiong over edges in the middle of a mesh */
+ /* however, why use 2 here at all? I guess for internal ngon loops it can be useful. Antony R. */
+ if (vert_edge_tot == 4 || vert_edge_tot == 2) {
+ int i_opposite = vert_edge_tot / 2;
+ int i = 0;
+ do {
l = BM_loop_other_edge_loop(l, v);
-
- if (l == NULL) {
- break;
+ if (BM_edge_is_manifold(l->e)) {
+ l = l->radial_next;
}
else {
- BMLoop *l_next;
-
- l_next = l->radial_next;
-
- if ((l_next == l) || (l_next == NULL)) {
- break;
- }
-
- l = l_next;
- i++;
+ l = NULL;
+ break;
}
- }
+ } while ((++i != i_opposite));
+ }
+ else {
+ l = NULL;
}
if (l != NULL) {
@@ -589,42 +604,68 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
bmw_mask_check_edge(walker, l->e) &&
!BLI_ghash_haskey(walker->visithash, l->e))
{
- if (!(owalk.is_boundary == false && i != stopi)) {
- lwalk = BMW_state_add(walker);
- lwalk->cur = l->e;
- lwalk->lastv = v;
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = l->e;
+ lwalk->lastv = v;
- lwalk->is_boundary = owalk.is_boundary;
- lwalk->is_single = owalk.is_single;
- lwalk->f_hub = owalk.f_hub;
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
- BLI_ghash_insert(walker->visithash, l->e, NULL);
- }
+ BLI_ghash_insert(walker->visithash, l->e, NULL);
}
}
}
- else { /* WIRE EDGE */
- BMIter eiter;
+ else if (owalk.is_boundary == true) { /* BOUNDARY EDGE WITH FACES */
+ int vert_edge_tot;
- /* match trunk: mark all connected wire edges */
- for (i = 0; i < 2; i++) {
- v = i ? e->v2 : e->v1;
+ v = BM_edge_other_vert(e, lwalk->lastv);
- BM_ITER_ELEM (nexte, &eiter, v, BM_EDGES_OF_VERT) {
- if ((nexte->l == NULL) &&
- bmw_mask_check_edge(walker, nexte) &&
- !BLI_ghash_haskey(walker->visithash, nexte))
- {
- lwalk = BMW_state_add(walker);
- lwalk->cur = nexte;
- lwalk->lastv = v;
+ vert_edge_tot = BM_vert_edge_count_nonwire(v);
- lwalk->is_boundary = owalk.is_boundary;
- lwalk->is_single = owalk.is_single;
- lwalk->f_hub = owalk.f_hub;
+ /* check if we should step, this is fairly involved */
+ if (
+ /* walk over boundary of faces but stop at corners */
+ (owalk.is_single == false && vert_edge_tot > 2) ||
- BLI_ghash_insert(walker->visithash, nexte, NULL);
+ /* initial edge was a boundary, so is this edge and vertex is only apart of this face
+ * this lets us walk over the the boundary of an ngon which is handy */
+ (owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e)))
+ {
+ /* find next boundary edge in the fan */
+ do {
+ l = BM_loop_other_edge_loop(l, v);
+ if (BM_edge_is_manifold(l->e)) {
+ l = l->radial_next;
}
+ else if (BM_edge_is_boundary(l->e)) {
+ break;
+ }
+ else {
+ l = NULL;
+ break;
+ }
+ } while (true);
+ }
+
+ if (owalk.is_single == false && bm_edge_is_single(l->e)) {
+ l = NULL;
+ }
+
+ if (l != NULL) {
+ if (l != e->l &&
+ bmw_mask_check_edge(walker, l->e) &&
+ !BLI_ghash_haskey(walker->visithash, l->e))
+ {
+ lwalk = BMW_state_add(walker);
+ lwalk->cur = l->e;
+ lwalk->lastv = v;
+
+ lwalk->is_boundary = owalk.is_boundary;
+ lwalk->is_single = owalk.is_single;
+ lwalk->f_hub = owalk.f_hub;
+
+ BLI_ghash_insert(walker->visithash, l->e, NULL);
}
}
}
diff --git a/source/blender/bmesh/operators/bmo_edgesplit.c b/source/blender/bmesh/operators/bmo_edgesplit.c
index 378f790ef32..8ac6c46f6cf 100644
--- a/source/blender/bmesh/operators/bmo_edgesplit.c
+++ b/source/blender/bmesh/operators/bmo_edgesplit.c
@@ -39,6 +39,7 @@ void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
{
const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
+ BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, false);
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, false);
if (use_verts) {
diff --git a/source/blender/compositor/nodes/COM_GroupNode.cpp b/source/blender/compositor/nodes/COM_GroupNode.cpp
index 09824a7b439..85554d7a7aa 100644
--- a/source/blender/compositor/nodes/COM_GroupNode.cpp
+++ b/source/blender/compositor/nodes/COM_GroupNode.cpp
@@ -26,6 +26,13 @@
#include "COM_SocketProxyNode.h"
#include "COM_SetColorOperation.h"
#include "COM_ExecutionSystemHelper.h"
+#include "COM_SetValueOperation.h"
+#include "COM_SetVectorOperation.h"
+#include "COM_SetColorOperation.h"
+
+extern "C" {
+#include "RNA_access.h"
+}
GroupNode::GroupNode(bNode *editorNode) : Node(editorNode)
{
@@ -83,6 +90,7 @@ void GroupNode::ungroup(ExecutionSystem &system)
const bool groupnodeBuffering = system.getContext().isGroupnodeBufferEnabled();
+ bool has_output = false;
/* create proxy nodes for group input/output nodes */
for (bNode *bionode = (bNode *)subtree->nodes.first; bionode; bionode = bionode->next) {
if (bionode->type == NODE_GROUP_INPUT) {
@@ -100,6 +108,7 @@ void GroupNode::ungroup(ExecutionSystem &system)
}
if (bionode->type == NODE_GROUP_OUTPUT && (bionode->flag & NODE_DO_OUTPUT)) {
+ has_output = true;
for (bNodeSocket *bsock = (bNodeSocket *)bionode->inputs.first; bsock; bsock = bsock->next) {
OutputSocket *gsock;
find_group_output(this, bsock->identifier, &gsock);
@@ -114,11 +123,91 @@ void GroupNode::ungroup(ExecutionSystem &system)
}
}
+ /* in case no output node exists, add input value operations using defaults */
+ if (!has_output) {
+ for (int index = 0; index < getNumberOfOutputSockets(); ++index) {
+ OutputSocket *output = getOutputSocket(index);
+ addDefaultOutputOperation(system, output);
+ }
+ }
+
/* unlink the group node itself, input links have been duplicated */
for (int index = 0; index < this->getNumberOfInputSockets(); ++index) {
InputSocket *sock = this->getInputSocket(index);
sock->unlinkConnections(&system);
}
+ for (int index = 0; index < this->getNumberOfOutputSockets(); ++index) {
+ OutputSocket *sock = this->getOutputSocket(index);
+ sock->clearConnections();
+ }
ExecutionSystemHelper::addbNodeTree(system, nodes_start, subtree, this->getInstanceKey());
}
+
+bNodeSocket *GroupNode::findInterfaceInput(InputSocket *socket)
+{
+ bNode *bnode = this->getbNode();
+ bNodeTree *subtree = (bNodeTree *)bnode->id;
+ if (!subtree)
+ return NULL;
+
+ const char *identifier = socket->getbNodeSocket()->identifier;
+ for (bNodeSocket *iosock = (bNodeSocket *)subtree->inputs.first; iosock; iosock = iosock->next)
+ if (STREQ(iosock->identifier, identifier))
+ return iosock;
+ return NULL;
+}
+
+bNodeSocket *GroupNode::findInterfaceOutput(OutputSocket *socket)
+{
+ bNode *bnode = this->getbNode();
+ bNodeTree *subtree = (bNodeTree *)bnode->id;
+ if (!subtree)
+ return NULL;
+
+ const char *identifier = socket->getbNodeSocket()->identifier;
+ for (bNodeSocket *iosock = (bNodeSocket *)subtree->outputs.first; iosock; iosock = iosock->next)
+ if (STREQ(iosock->identifier, identifier))
+ return iosock;
+ return NULL;
+}
+
+void GroupNode::addDefaultOutputOperation(ExecutionSystem &system, OutputSocket *outputsocket)
+{
+ bNodeSocket *iosock = findInterfaceOutput(outputsocket);
+ if (!iosock)
+ return;
+
+ PointerRNA ptr;
+ RNA_pointer_create(&getbNodeTree()->id, &RNA_NodeSocket, iosock, &ptr);
+
+ NodeOperation *operation = NULL;
+ switch (iosock->typeinfo->type) {
+ case SOCK_FLOAT: {
+ float value = RNA_float_get(&ptr, "default_value");
+ SetValueOperation *value_op = new SetValueOperation();
+ value_op->setValue(value);
+ operation = value_op;
+ break;
+ }
+ case SOCK_VECTOR: {
+ float vector[3];
+ RNA_float_get_array(&ptr, "default_value", vector);
+ SetVectorOperation *vector_op = new SetVectorOperation();
+ vector_op->setVector(vector);
+ operation = vector_op;
+ break;
+ }
+ case SOCK_RGBA: {
+ float color[4];
+ RNA_float_get_array(&ptr, "default_value", color);
+ SetColorOperation *color_op = new SetColorOperation();
+ color_op->setChannels(color);
+ operation = color_op;
+ break;
+ }
+ }
+
+ outputsocket->relinkConnections(operation->getOutputSocket());
+ system.addOperation(operation);
+}
diff --git a/source/blender/compositor/nodes/COM_GroupNode.h b/source/blender/compositor/nodes/COM_GroupNode.h
index ba270eaf16c..02b63fe27e3 100644
--- a/source/blender/compositor/nodes/COM_GroupNode.h
+++ b/source/blender/compositor/nodes/COM_GroupNode.h
@@ -52,6 +52,10 @@ public:
* @param system the ExecutionSystem where to add the subtree
*/
void ungroup(ExecutionSystem &system);
+
+ bNodeSocket *findInterfaceInput(InputSocket *socket);
+ bNodeSocket *findInterfaceOutput(OutputSocket *socket);
+ void addDefaultOutputOperation(ExecutionSystem &system, OutputSocket *outputsocket);
};
#endif
diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cpp b/source/blender/compositor/nodes/COM_ViewerNode.cpp
index 70cc3a288ee..531fa4158bc 100644
--- a/source/blender/compositor/nodes/COM_ViewerNode.cpp
+++ b/source/blender/compositor/nodes/COM_ViewerNode.cpp
@@ -34,9 +34,8 @@ ViewerNode::ViewerNode(bNode *editorNode) : Node(editorNode)
void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
bNode *editorNode = this->getbNode();
- bool is_active = ((editorNode->flag & NODE_DO_OUTPUT_RECALC) &&
- (editorNode->flag & NODE_DO_OUTPUT) && this->isInActiveGroup()) ||
- context->isRendering();
+ bool is_active = (editorNode->flag & NODE_DO_OUTPUT_RECALC || context->isRendering()) &&
+ ((editorNode->flag & NODE_DO_OUTPUT) && this->isInActiveGroup());
InputSocket *imageSocket = this->getInputSocket(0);
InputSocket *alphaSocket = this->getInputSocket(1);
diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.cpp b/source/blender/compositor/nodes/COM_ZCombineNode.cpp
index 82effaf0eda..95f06e350b1 100644
--- a/source/blender/compositor/nodes/COM_ZCombineNode.cpp
+++ b/source/blender/compositor/nodes/COM_ZCombineNode.cpp
@@ -71,9 +71,18 @@ void ZCombineNode::convertToOperations(ExecutionSystem *system, CompositorContex
else {
// not full anti alias, use masking for Z combine. be aware it uses anti aliasing.
// step 1 create mask
- MathGreaterThanOperation *maskoperation = new MathGreaterThanOperation();
- this->getInputSocket(1)->relinkConnections(maskoperation->getInputSocket(0), 1, system);
- this->getInputSocket(3)->relinkConnections(maskoperation->getInputSocket(1), 3, system);
+ NodeOperation *maskoperation;
+
+ if (this->getbNode()->custom1) {
+ maskoperation = new MathGreaterThanOperation();
+ this->getInputSocket(1)->relinkConnections(maskoperation->getInputSocket(0), 3, system);
+ this->getInputSocket(3)->relinkConnections(maskoperation->getInputSocket(1), 1, system);
+ }
+ else {
+ maskoperation = new MathLessThanOperation();
+ this->getInputSocket(1)->relinkConnections(maskoperation->getInputSocket(0), 1, system);
+ this->getInputSocket(3)->relinkConnections(maskoperation->getInputSocket(1), 3, system);
+ }
// step 2 anti alias mask bit of an expensive operation, but does the trick
AntiAliasOperation *antialiasoperation = new AntiAliasOperation();
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h
index d8729ad4394..a868f0bfa04 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.h
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h
@@ -25,6 +25,8 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+#define MAX_GAUSSTAB_RADIUS 30000
+
class BlurBaseOperation : public NodeOperation, public QualityStepHelper {
private:
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
index aaf5f92505b..af15f719cbc 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
@@ -55,8 +55,7 @@ void GaussianAlphaXBlurOperation::initExecution()
if (this->m_sizeavailable) {
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -69,8 +68,7 @@ void GaussianAlphaXBlurOperation::updateGauss()
if (this->m_gausstab == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -79,8 +77,7 @@ void GaussianAlphaXBlurOperation::updateGauss()
if (this->m_distbuf_inv == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, this->m_falloff);
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
index 650805f91d5..4aee878a8c8 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
@@ -55,8 +55,7 @@ void GaussianAlphaYBlurOperation::initExecution()
if (this->m_sizeavailable) {
float rad = this->m_size * this->m_data->sizey;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -69,8 +68,7 @@ void GaussianAlphaYBlurOperation::updateGauss()
if (this->m_gausstab == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizey;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -79,8 +77,7 @@ void GaussianAlphaYBlurOperation::updateGauss()
if (this->m_distbuf_inv == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, this->m_falloff);
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
index af231d118a6..13b749f8b9c 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
@@ -53,8 +53,7 @@ void GaussianXBlurOperation::initExecution()
if (this->m_sizeavailable) {
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -66,8 +65,7 @@ void GaussianXBlurOperation::updateGauss()
if (this->m_gausstab == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizex;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
index 7bf85a953f4..0a2e8aeeba8 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
@@ -53,8 +53,7 @@ void GaussianYBlurOperation::initExecution()
if (this->m_sizeavailable) {
float rad = this->m_size * this->m_data->sizey;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
@@ -66,8 +65,7 @@ void GaussianYBlurOperation::updateGauss()
if (this->m_gausstab == NULL) {
updateSize();
float rad = this->m_size * this->m_data->sizey;
- if (rad < 1)
- rad = 1;
+ CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS);
this->m_rad = rad;
this->m_gausstab = BlurBaseOperation::make_gausstab(rad);
diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp
index 4368ba4f9a0..10090294a54 100644
--- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp
+++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp
@@ -123,13 +123,7 @@ void ZCombineMaskOperation::executePixel(float output[4], float x, float y, Pixe
this->m_image1Reader->read(color1, x, y, sampler);
this->m_image2Reader->read(color2, x, y, sampler);
- float fac = mask[0];
- // multiply mask with alpha, if mask == 0 color1, else color2 make sure
- float mfac = 1.0f - fac;
- output[0] = color1[0] * mfac + color2[0] * fac;
- output[1] = color1[1] * mfac + color2[1] * fac;
- output[2] = color1[2] * mfac + color2[2] * fac;
- output[3] = max(color1[3], color2[3]);
+ interp_v4_v4v4(output, color1, color2, 1.0f - mask[0]);
}
void ZCombineMaskAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
@@ -142,15 +136,12 @@ void ZCombineMaskAlphaOperation::executePixel(float output[4], float x, float y,
this->m_image1Reader->read(color1, x, y, sampler);
this->m_image2Reader->read(color2, x, y, sampler);
- float fac = mask[0];
- // multiply mask with alpha, if mask == 0 color1, else color2 make sure
+ float fac = (1.0f - mask[0])*(1.0f - color1[3]) + mask[0]*color2[3];
float mfac = 1.0f - fac;
- float alpha = color1[3] * mfac + color2[3] * fac;
- float facalpha = fac * alpha;
- mfac = 1.0f - facalpha;
- output[0] = color1[0] * mfac + color2[0] * facalpha;
- output[1] = color1[1] * mfac + color2[1] * facalpha;
- output[2] = color1[2] * mfac + color2[2] * facalpha;
+
+ output[0] = color1[0] * mfac + color2[0] * fac;
+ output[1] = color1[1] * mfac + color2[1] * fac;
+ output[2] = color1[2] * mfac + color2[2] * fac;
output[3] = max(color1[3], color2[3]);
}
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index f87d4bc4d47..3cf8c44f9aa 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -325,10 +325,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
RNA_boolean_set(kmi->ptr, "flipped", FALSE);
-
kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "flipped", TRUE);
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+ RNA_boolean_set(kmi->ptr, "flipped", FALSE);
+ kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_OSKEY | KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "flipped", TRUE);
+#endif
+
kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 27c40095348..406c26e901e 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -202,11 +202,13 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
RNA_int_set(WM_keymap_add_item(keymap, "FONT_OT_change_character", DOWNARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1);
WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_CTRL, 0);
- WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
WM_keymap_add_item(keymap, "FONT_OT_line_break", RETKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 77bdd85d9fb..fb1c15b3708 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -149,7 +149,7 @@ typedef struct uiLayout uiLayout;
#define UI_TEXT_RIGHT 1024
#define UI_BUT_NODE_LINK 2048
#define UI_BUT_NODE_ACTIVE 4096
-#define UI_FLAG_UNUSED 8192
+#define UI_BUT_DRAG_LOCK 8192
/* button align flag, for drawing groups together */
#define UI_BUT_ALIGN (UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT | UI_BUT_ALIGN_DOWN)
@@ -892,7 +892,7 @@ void uiItemV(uiLayout *layout, const char *name, int icon, int argval); /* value
void uiItemS(uiLayout *layout); /* separator */
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg);
-void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name, int icon);
+void uiItemMenuEnumO(uiLayout *layout, struct bContext *C, const char *opname, const char *propname, const char *name, int icon);
void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon);
/* UI Operators */
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index 100e72e18ed..3b364f5674b 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -189,7 +189,7 @@ void UI_view2d_listview_visible_cells(struct View2D *v2d, short columnwidth, sho
int *row_min, int *row_max);
/* coordinate conversion */
-void UI_view2d_region_to_view(struct View2D *v2d, int x, int y, float *viewx, float *viewy);
+void UI_view2d_region_to_view(struct View2D *v2d, float x, float y, float *viewx, float *viewy);
void UI_view2d_view_to_region(struct View2D *v2d, float x, float y, int *regionx, int *regiony);
void UI_view2d_to_region_no_clip(struct View2D *v2d, float x, float y, int *regionx, int *region_y);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 7ddf85707fe..1e61a0bc928 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -878,7 +878,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
if (but->optype) {
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
- if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
+ if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, true,
buf, sizeof(buf)))
{
ui_but_add_shortcut(but, buf, FALSE);
@@ -895,7 +895,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname));
- if (WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE,
+ if (WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true,
buf, sizeof(buf)))
{
ui_but_add_shortcut(but, buf, FALSE);
@@ -4093,7 +4093,7 @@ void uiButGetStrInfo(bContext *C, uiBut *but, ...)
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
char buf[512];
- if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
+ if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, true,
buf, sizeof(buf)))
{
tmp = BLI_strdup(buf);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 3ad721eaa75..e46def3be6f 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -756,6 +756,7 @@ static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *da
typedef struct uiDragToggleHandle {
/* init */
+ bool is_init;
bool is_set;
float but_cent_start[2];
eButType but_type_start;
@@ -767,6 +768,8 @@ typedef struct uiDragToggleHandle {
static bool ui_drag_toggle_set_xy_xy(bContext *C, ARegion *ar, const bool is_set, const eButType but_type_start,
const int xy_src[2], const int xy_dst[2])
{
+ /* popups such as layers won't re-evaluate on redraw */
+ const bool do_check = (ar->regiontype == RGN_TYPE_TEMPORARY);
bool change = false;
uiBlock *block;
@@ -790,6 +793,9 @@ static bool ui_drag_toggle_set_xy_xy(bContext *C, ARegion *ar, const bool is_set
BLI_assert(ui_is_but_bool(but) == true);
if (is_set_but != is_set) {
uiButExecute(C, but);
+ if (do_check) {
+ ui_check_but(but);
+ }
change = true;
}
}
@@ -815,24 +821,31 @@ static void ui_drag_toggle_set(bContext *C, uiDragToggleHandle *drag_info, const
* Check if we need to initialize the lock axis by finding if the first
* button we mouse over is X or Y aligned, then lock the mouse to that axis after.
*/
- if (drag_info->xy_lock[0] == false && drag_info->xy_lock[1] == false) {
+ if (drag_info->is_init == false) {
/* first store the buttons original coords */
uiBut *but = ui_but_find_mouse_over(ar, xy_input[0], xy_input[1]);
- if (but) {
- const float but_cent_new[2] = {BLI_rctf_cent_x(&but->rect),
- BLI_rctf_cent_y(&but->rect)};
- /* check if this is a different button, chances are high the button wont move about :) */
- if (len_manhattan_v2v2(drag_info->but_cent_start, but_cent_new) > 1.0f) {
- if (fabsf(drag_info->but_cent_start[0] - but_cent_new[0]) <
- fabsf(drag_info->but_cent_start[1] - but_cent_new[1]))
- {
- drag_info->xy_lock[0] = true;
- }
- else {
- drag_info->xy_lock[1] = true;
+ if (but) {
+ if (but->flag & UI_BUT_DRAG_LOCK) {
+ const float but_cent_new[2] = {BLI_rctf_cent_x(&but->rect),
+ BLI_rctf_cent_y(&but->rect)};
+
+ /* check if this is a different button, chances are high the button wont move about :) */
+ if (len_manhattan_v2v2(drag_info->but_cent_start, but_cent_new) > 1.0f) {
+ if (fabsf(drag_info->but_cent_start[0] - but_cent_new[0]) <
+ fabsf(drag_info->but_cent_start[1] - but_cent_new[1]))
+ {
+ drag_info->xy_lock[0] = true;
+ }
+ else {
+ drag_info->xy_lock[1] = true;
+ }
+ drag_info->is_init = true;
}
}
+ else {
+ drag_info->is_init = true;
+ }
}
}
/* done with axis locking */
@@ -933,6 +946,7 @@ static bool ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data,
#ifdef USE_DRAG_TOGGLE
if (ui_is_but_bool(but)) {
uiDragToggleHandle *drag_info = MEM_callocN(sizeof(*drag_info), __func__);
+ ARegion *ar_prev;
drag_info->is_set = ui_is_but_push(but);
drag_info->but_cent_start[0] = BLI_rctf_cent_x(&but->rect);
@@ -940,10 +954,16 @@ static bool ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data,
drag_info->but_type_start = but->type;
copy_v2_v2_int(drag_info->xy_last, &event->x);
+ /* needed for toggle drag on popups */
+ ar_prev = CTX_wm_region(C);
+ CTX_wm_region_set(C, data->region);
+
WM_event_add_ui_handler(C, &data->window->modalhandlers,
ui_handler_region_drag_toggle,
ui_handler_region_drag_toggle_remove,
drag_info);
+
+ CTX_wm_region_set(C, ar_prev);
}
else
#endif
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index c66ca75412f..4cc5b0ec19c 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1681,10 +1681,11 @@ static void menu_item_enum_opname_menu(bContext *UNUSED(C), uiLayout *layout, vo
uiItemsEnumO(layout, lvl->opname, lvl->propname);
}
-void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name, int icon)
+void uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name, int icon)
{
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
MenuItemLevel *lvl;
+ char namestr[UI_MAX_NAME_STR], keybuf[128];
UI_OPERATOR_ERROR_RET(ot, opname, return );
@@ -1694,8 +1695,11 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
return;
}
- if (!name)
- name = RNA_struct_ui_name(ot->srna);
+ if (name)
+ BLI_strncpy(namestr, name, sizeof(namestr));
+ else
+ BLI_strncpy(namestr, RNA_struct_ui_name(ot->srna), sizeof(namestr));
+
if (layout->root->type == UI_LAYOUT_MENU && !icon)
icon = ICON_BLANK1;
@@ -1704,7 +1708,16 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
lvl->opcontext = layout->root->opcontext;
- ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl, RNA_struct_ui_description(ot->srna));
+ /* add hotkey here, lower UI code can't detect it */
+ if(layout->root->block->flag & UI_BLOCK_LOOP) {
+ if (ot->prop && WM_key_event_operator_string(C, ot->idname,
+ layout->root->opcontext, NULL, false, keybuf, sizeof(keybuf))) {
+ strncat(namestr, "|", sizeof(namestr)-1);
+ strncat(namestr, keybuf, sizeof(namestr)-1);
+ }
+ }
+
+ ui_item_menu(layout, namestr, icon, menu_item_enum_opname_menu, NULL, lvl, RNA_struct_ui_description(ot->srna));
}
static void menu_item_enum_rna_menu(bContext *UNUSED(C), uiLayout *layout, void *arg)
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index f9523c28048..bf3385fc14b 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -365,7 +365,12 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
float background_color[3];
float tone_bg;
- int i;
+ int i, multisample_enabled;
+
+ /* disable AA, makes widgets too blurry */
+ multisample_enabled = glIsEnabled(GL_MULTISAMPLE_ARB);
+ if (multisample_enabled)
+ glDisable(GL_MULTISAMPLE_ARB);
/* draw background */
ui_draw_tooltip_background(UI_GetStyle(), NULL, &bbox);
@@ -402,6 +407,9 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
bbox.ymin -= data->lineh + data->spaceh;
bbox.ymax -= data->lineh + data->spaceh;
}
+
+ if (multisample_enabled)
+ glEnable(GL_MULTISAMPLE_ARB);
}
static void ui_tooltip_region_free_cb(ARegion *ar)
@@ -1553,6 +1561,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
{
uiBut *bt;
+ float xofs = 0.0f;
int width = UI_SCREEN_MARGIN;
int winx, winy;
@@ -1563,10 +1572,18 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
winx = WM_window_pixels_x(window);
winy = WM_window_pixels_y(window);
- if (block->rect.xmin < width)
- block->rect.xmin = width;
- if (block->rect.xmax > winx - width)
- block->rect.xmax = winx - width;
+ /* shift menus to right if outside of view */
+ if (block->rect.xmin < width) {
+ xofs = (width - block->rect.xmin);
+ block->rect.xmin += xofs;
+ block->rect.xmax += xofs;
+ }
+ /* or shift to left if outside of view */
+ if (block->rect.xmax > winx - width) {
+ xofs = winx - width - block->rect.xmax;
+ block->rect.xmin += xofs;
+ block->rect.xmax += xofs;
+ }
if (block->rect.ymin < width)
block->rect.ymin = width;
@@ -1575,10 +1592,8 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block)
/* ensure menu items draw inside left/right boundary */
for (bt = block->buttons.first; bt; bt = bt->next) {
- if (bt->rect.xmin < block->rect.xmin)
- bt->rect.xmin = block->rect.xmin;
- if (bt->rect.xmax > block->rect.xmax)
- bt->rect.xmax = block->rect.xmax;
+ bt->rect.xmin += xofs;
+ bt->rect.xmax += xofs;
}
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 7b4d5bf9f6d..637417f0fc8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2768,7 +2768,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char
/* check for hotkey */
if (len < sizeof(name) - 6) {
- if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE,
+ if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, true,
&name[len + 1], sizeof(name) - len - 1))
{
name[len] = '|';
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a7370b6254e..89a028eace2 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -968,8 +968,14 @@ static void ui_text_clip_give_next_off(uiBut *but)
static void ui_text_clip_left(uiFontStyle *fstyle, uiBut *but, const rcti *rect)
{
int border = (but->flag & UI_BUT_ALIGN_RIGHT) ? 8 : 10;
- int okwidth = max_ii(BLI_rcti_size_x(rect) - border, 0);
- if (but->flag & UI_HAS_ICON) okwidth -= UI_DPI_ICON_SIZE;
+ int okwidth = BLI_rcti_size_x(rect) - border;
+
+ if (but->flag & UI_HAS_ICON)
+ okwidth -= UI_DPI_ICON_SIZE;
+ if (but->type == SEARCH_MENU_UNLINK && !but->editstr)
+ okwidth -= BLI_rcti_size_y(rect);
+
+ okwidth = max_ii(okwidth, 0);
/* need to set this first */
uiStyleFontSet(fstyle);
@@ -1347,7 +1353,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
}
/* unlink icon for this button type */
- if (but->type == SEARCH_MENU_UNLINK && but->drawstr[0]) {
+ if (but->type == SEARCH_MENU_UNLINK && !but->editstr && but->drawstr[0]) {
rcti temp = *rect;
temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 89469d47fba..ca0bf00ea69 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -971,7 +971,9 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160); /* frame */
- rgba_char_args_set(btheme->tnode.console_output, 190, 190, 80, 255); /* group input/output */
+ rgba_char_args_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
+ rgba_char_args_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */
+ rgba_char_args_set(btheme->tnode.console_output, 223, 202, 53, 255); /* interface nodes */
btheme->tnode.noodle_curving = 5;
/* space logic */
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 74047abb17e..766a91df5db 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1961,7 +1961,7 @@ void UI_view2d_listview_visible_cells(View2D *v2d, short columnwidth, short rowh
* - x,y = coordinates to convert
* - viewx,viewy = resultant coordinates
*/
-void UI_view2d_region_to_view(View2D *v2d, int x, int y, float *r_viewx, float *r_viewy)
+void UI_view2d_region_to_view(View2D *v2d, float x, float y, float *r_viewx, float *r_viewy)
{
float div, ofs;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index fc270203710..4b5581f84f0 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -455,6 +455,15 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL);
+ /* for debugging unneeded area redraws and partial redraw */
+#if 0
+ glEnable(GL_BLEND);
+ glColor4f(drand48(), drand48(), drand48(), 0.1f);
+ glRectf(ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin,
+ ar->drawrct.xmax - ar->winrct.xmin, ar->drawrct.ymax - ar->winrct.ymin);
+ glDisable(GL_BLEND);
+#endif
+
ar->do_draw = FALSE;
memset(&ar->drawrct, 0, sizeof(ar->drawrct));
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 92b82d84c38..6547b336119 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -446,7 +446,7 @@ typedef struct PaintOperation {
void *custom_paint;
- int prevmouse[2];
+ float prevmouse[2];
double starttime;
ViewContext vc;
@@ -545,13 +545,11 @@ static void paint_stroke_update_step(bContext *C, struct PaintStroke *stroke, Po
float startsize = BKE_brush_size_get(scene, brush);
float startalpha = BKE_brush_alpha_get(scene, brush);
- float mousef[2];
+ float mouse[2];
float pressure;
- int mouse[2], redraw, eraser;
+ int redraw, eraser;
- RNA_float_get_array(itemptr, "mouse", mousef);
- mouse[0] = (int)(mousef[0]);
- mouse[1] = (int)(mousef[1]);
+ RNA_float_get_array(itemptr, "mouse", mouse);
pressure = RNA_float_get(itemptr, "pressure");
eraser = RNA_boolean_get(itemptr, "pen_flip");
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index efb810455b7..01850d71a44 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -805,7 +805,7 @@ static void paint_2d_canvas_free(ImagePaintState *s)
image_undo_remove_masks();
}
-int paint_2d_stroke(void *ps, const int prev_mval[2], const int mval[2], int eraser)
+int paint_2d_stroke(void *ps, const float prev_mval[2], const float mval[2], int eraser)
{
float newuv[2], olduv[2];
int redraw = 0;
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index d2badbaa156..f0be444a8ac 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -3210,7 +3210,7 @@ static void project_paint_begin(ProjPaintState *ps)
BLI_linklist_free(image_LinkList, NULL);
}
-static void paint_proj_begin_clone(ProjPaintState *ps, const int mouse[2])
+static void paint_proj_begin_clone(ProjPaintState *ps, const float mouse[2])
{
/* setup clone offset */
if (ps->tool == PAINT_TOOL_CLONE) {
@@ -4048,23 +4048,17 @@ static int project_paint_op(void *state, const float lastpos[2], const float pos
}
-int paint_proj_stroke(bContext *C, void *pps, const int prevmval_i[2], const int mval_i[2])
+int paint_proj_stroke(bContext *C, void *pps, const float prev_pos[2], const float pos[2])
{
ProjPaintState *ps = pps;
int a, redraw;
- float pos[2], prev_pos[2];
-
- pos[0] = (float)(mval_i[0]);
- pos[1] = (float)(mval_i[1]);
-
- prev_pos[0] = (float)(prevmval_i[0]);
- prev_pos[1] = (float)(prevmval_i[1]);
/* clone gets special treatment here to avoid going through image initialization */
if (ps->tool == PAINT_TOOL_CLONE && ps->mode == BRUSH_STROKE_INVERT) {
Scene *scene = ps->scene;
View3D *v3d = ps->v3d;
float *cursor = give_cursor(scene, v3d);
+ int mval_i[2] = {(int)pos[0], (int)pos[1]};
view3d_operator_needs_opengl(C);
@@ -4164,7 +4158,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
return;
}
-void *paint_proj_new_stroke(bContext *C, Object *ob, const int mouse[2], int mode)
+void *paint_proj_new_stroke(bContext *C, Object *ob, const float mouse[2], int mode)
{
ProjPaintState *ps = MEM_callocN(sizeof(ProjPaintState), "ProjectionPaintState");
project_state_init(C, ob, ps, mode);
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 0085998bd58..a4230439737 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -141,9 +141,9 @@ int get_imapaint_zoom(struct bContext *C, float *zoomx, float *zoomy);
void *paint_2d_new_stroke(struct bContext *, struct wmOperator *);
void paint_2d_redraw(const bContext *C, void *ps, int final);
void paint_2d_stroke_done(void *ps);
-int paint_2d_stroke(void *ps, const int prev_mval[2], const int mval[2], int eraser);
-void *paint_proj_new_stroke(struct bContext *C, struct Object *ob, const int mouse[2], int mode);
-int paint_proj_stroke(struct bContext *C, void *ps, const int prevmval_i[2], const int mval_i[2]);
+int paint_2d_stroke(void *ps, const float prev_mval[2], const float mval[2], int eraser);
+void *paint_proj_new_stroke(struct bContext *C, struct Object *ob, const float mouse[2], int mode);
+int paint_proj_stroke(struct bContext *C, void *ps, const float prevmval_i[2], const float mval_i[2]);
void paint_proj_stroke_done(void *ps);
void paint_brush_init_tex(struct Brush *brush);
void paint_brush_exit_tex(struct Brush *brush);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index a838a9c26cb..a30566d5b3f 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -248,14 +248,30 @@ static void brush_tool_set(const Brush *brush, size_t tool_offset, int tool)
/* generic functions for setting the active brush based on the tool */
static Brush *brush_tool_cycle(Main *bmain, Brush *brush_orig, const int tool, const size_t tool_offset, const int ob_mode)
{
- Brush *brush;
+ Brush *brush, *first_brush;
if (!brush_orig && !(brush_orig = bmain->brush.first)) {
return NULL;
}
+ if (brush_tool(brush_orig, tool_offset) != tool) {
+ /* If current brush's tool is different from what we need,
+ * start cycling from the beginning of the list.
+ * Such logic will activate the same exact brush not relating from
+ * which tool user requests other tool.
+ */
+ first_brush = bmain->brush.first;
+ }
+ else {
+ /* If user wants to switch to brush with the same tool as
+ * currently active brush do a cycling via all possible
+ * brushes with requested tool.
+ */
+ first_brush = brush_orig->id.next ? brush_orig->id.next : bmain->brush.first;
+ }
+
/* get the next brush with the active tool */
- for (brush = brush_orig->id.next ? brush_orig->id.next : bmain->brush.first;
+ for (brush = first_brush;
brush != brush_orig;
brush = brush->id.next ? brush->id.next : bmain->brush.first)
{
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 945fa14d613..95cbc4b78b4 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -255,6 +255,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2])
{
Scene *scene = CTX_data_scene(C);
+ wmWindow *window = CTX_wm_window(C);
ARegion *ar = CTX_wm_region(C);
Paint *paint = BKE_paint_get_active_from_context(C);
PaintMode mode = BKE_paintmode_get_active_from_context(C);
@@ -328,7 +329,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEve
/* always redraw region if brush is shown */
if (ar && (paint->flags & PAINT_SHOW_BRUSH))
- ED_region_tag_redraw(ar);
+ WM_paint_cursor_tag_redraw(window, ar);
}
/* Returns zero if no sculpt changes should be made, non-zero otherwise */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b54b28e2a18..27ee7cdb886 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -501,11 +501,26 @@ static void paint_mesh_restore_co(Sculpt *sd, Object *ob)
/*** BVH Tree ***/
+static void sculpt_extend_redraw_rect_previous(Object *ob, rcti *rect)
+{
+ /* expand redraw rect with redraw rect from previous step to
+ * prevent partial-redraw issues caused by fast strokes. This is
+ * needed here (not in sculpt_flush_update) as it was before
+ * because redraw rectangle should be the same in both of
+ * optimized PBVH draw function and 3d view redraw (if not -- some
+ * mesh parts could disappear from screen (sergey) */
+ SculptSession *ss = ob->sculpt;
+
+ if (ss->cache) {
+ if (!BLI_rcti_is_empty(&ss->cache->previous_r))
+ BLI_rcti_union(rect, &ss->cache->previous_r);
+ }
+}
+
/* Get a screen-space rectangle of the modified area */
static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
Object *ob, rcti *rect)
{
- SculptSession *ss;
PBVH *pbvh = ob->sculpt->pbvh;
float bb_min[3], bb_max[3];
@@ -525,17 +540,6 @@ static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
return 0;
}
- /* expand redraw rect with redraw rect from previous step to
- * prevent partial-redraw issues caused by fast strokes. This is
- * needed here (not in sculpt_flush_update) as it was before
- * because redraw rectangle should be the same in both of
- * optimized PBVH draw function and 3d view redraw (if not -- some
- * mesh parts could disappear from screen (sergey) */
- ss = ob->sculpt;
- if (ss->cache) {
- if (!BLI_rcti_is_empty(&ss->cache->previous_r))
- BLI_rcti_union(rect, &ss->cache->previous_r);
- }
return 1;
}
@@ -547,6 +551,7 @@ void sculpt_get_redraw_planes(float planes[4][4], ARegion *ar,
rcti rect;
sculpt_get_redraw_rect(ar, rv3d, ob, &rect);
+ sculpt_extend_redraw_rect_previous(ob, &rect);
paint_calc_redraw_planes(planes, ar, rv3d, ob, &rect);
@@ -4224,6 +4229,8 @@ static void sculpt_flush_update(bContext *C)
if (ss->cache)
ss->cache->previous_r = r;
+ sculpt_extend_redraw_rect_previous(ob, &r);
+
r.xmin += ar->winrct.xmin + 1;
r.xmax += ar->winrct.xmin - 1;
r.ymin += ar->winrct.ymin + 1;
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index cca71bb1331..7d238bf7887 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -194,7 +194,11 @@ static void action_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
/* copy/paste */
WM_keymap_add_item(keymap, "ACTION_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
-
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "ACTION_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
+
/* auto-set range */
WM_keymap_add_item(keymap, "ACTION_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
WM_keymap_add_item(keymap, "ACTION_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index e144fdd290e..43df3be45ac 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -280,7 +280,7 @@ static int get_file_icon(struct direntry *file)
return ICON_FILE_BLANK;
}
-static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height)
+static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height, bool drag)
{
uiBut *but;
int x, y;
@@ -292,7 +292,9 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
/*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/
but = uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "");
- uiButSetDragPath(but, path);
+
+ if (drag)
+ uiButSetDragPath(but, path);
}
@@ -326,7 +328,7 @@ void file_calc_previews(const bContext *C, ARegion *ar)
UI_view2d_totRect_set(v2d, sfile->layout->width, sfile->layout->height);
}
-static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int sy, ImBuf *imb, FileLayout *layout, short dropshadow)
+static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int sy, ImBuf *imb, FileLayout *layout, bool dropshadow, bool drag)
{
if (imb) {
uiBut *but;
@@ -385,8 +387,10 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
}
/* dragregion */
- but = uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, "");
- uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale);
+ if (drag) {
+ but = uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, "");
+ uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale);
+ }
glDisable(GL_BLEND);
}
@@ -466,6 +470,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
int i;
short is_icon;
short align;
+ bool do_drag;
int column_space = 0.6f * UI_UNIT_X;
numfiles = filelist_numfiles(files);
@@ -514,6 +519,9 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
uiSetRoundBox(UI_CNR_NONE);
+ /* don't drag parent or refresh items */
+ do_drag = !(STREQ(file->relname, "..") || STREQ(file->relname, "."));
+
if (FILE_IMGDISPLAY == params->display) {
is_icon = 0;
imb = filelist_getimage(files, i);
@@ -522,10 +530,10 @@ void file_draw_list(const bContext *C, ARegion *ar)
is_icon = 1;
}
- file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
+ file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE), do_drag);
}
else {
- file_draw_icon(block, file->path, sx, sy - (UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
+ file_draw_icon(block, file->path, sx, sy - (UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE, do_drag);
sx += ICON_DEFAULT_WIDTH_SCALE + 0.2f * UI_UNIT_X;
}
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index acb9e42d91b..e2bc88cf0eb 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -386,7 +386,11 @@ static void graphedit_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
/* copy/paste */
WM_keymap_add_item(keymap, "GRAPH_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
-
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "GRAPH_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "GRAPH_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
+
/* auto-set range */
WM_keymap_add_item(keymap, "GRAPH_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 578006115a5..ce8ee25eef0 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -2329,7 +2329,7 @@ void logic_buttons(bContext *C, ARegion *ar)
RNA_pointer_create((ID *)ob, &RNA_Object, ob, &object_ptr);
uiLayoutSetContextPointer(row, "object", &object_ptr);
- uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", IFACE_("Add Controller"), ICON_NONE);
+ uiItemMenuEnumO(row, C, "LOGIC_OT_controller_add", "type", IFACE_("Add Controller"), ICON_NONE);
if (RNA_boolean_get(&settings_ptr, "show_state_panel")) {
@@ -2426,7 +2426,7 @@ void logic_buttons(bContext *C, ARegion *ar)
RNA_pointer_create((ID *)ob, &RNA_Object, ob, &object_ptr);
uiLayoutSetContextPointer(row, "object", &object_ptr);
- uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", IFACE_("Add Sensor"), ICON_NONE);
+ uiItemMenuEnumO(row, C, "LOGIC_OT_sensor_add", "type", IFACE_("Add Sensor"), ICON_NONE);
if ((ob->scaflag & OB_SHOWSENS) == 0) continue;
@@ -2497,7 +2497,7 @@ void logic_buttons(bContext *C, ARegion *ar)
RNA_pointer_create((ID *)ob, &RNA_Object, ob, &object_ptr);
uiLayoutSetContextPointer(row, "object", &object_ptr);
- uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", IFACE_("Add Actuator"), ICON_NONE);
+ uiItemMenuEnumO(row, C, "LOGIC_OT_actuator_add", "type", IFACE_("Add Actuator"), ICON_NONE);
if ((ob->scaflag & OB_SHOWACT) == 0) continue;
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index b46584cda07..2476a9b8b99 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -312,7 +312,10 @@ void node_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "NODE_OT_clipboard_copy", CKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "NODE_OT_clipboard_paste", VKEY, KM_PRESS, KM_CTRL, 0);
-
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "NODE_OT_clipboard_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "NODE_OT_clipboard_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
WM_keymap_add_item(keymap, "NODE_OT_viewer_border", BKEY, KM_PRESS, KM_CTRL, 0);
transform_keymap_for_space(keyconf, keymap, SPACE_NODE);
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index d22ea674668..a92edc6711f 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -543,18 +543,21 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
&ptr, "hide", -1, 0, 0, -1, -1,
TIP_("Restrict viewport visibility (Ctrl - Recursive)"));
uiButSetFunc(bt, restrictbutton_view_cb, scene, ob);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
bt = uiDefIconButR(block, ICONTOG, 0, ICON_RESTRICT_SELECT_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
&ptr, "hide_select", -1, 0, 0, -1, -1,
TIP_("Restrict viewport selection (Ctrl - Recursive)"));
uiButSetFunc(bt, restrictbutton_sel_cb, scene, ob);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
bt = uiDefIconButR(block, ICONTOG, 0, ICON_RESTRICT_RENDER_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
&ptr, "hide_render", -1, 0, 0, -1, -1,
TIP_("Restrict rendering (Ctrl - Recursive)"));
uiButSetFunc(bt, restrictbutton_rend_cb, scene, ob);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -570,18 +573,21 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
NULL, 0, 0, 0, 0, TIP_("Restrict/Allow visibility in the 3D View"));
uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
restrict_bool = group_restrict_flag(gr, OB_RESTRICT_SELECT);
bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
NULL, 0, 0, 0, 0, TIP_("Restrict/Allow selection in the 3D View"));
uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
restrict_bool = group_restrict_flag(gr, OB_RESTRICT_RENDER);
bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X, UI_UNIT_Y,
NULL, 0, 0, 0, 0, TIP_("Restrict/Allow renderability"));
uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -593,6 +599,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, te->directdata, 0, 0, 0, 0, TIP_("Render this RenderLayer"));
uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -607,6 +614,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, layflag, 0, 0, 0, 0, TIP_("Render this Pass"));
uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
layflag++; /* is lay_xor */
if (ELEM8(passflag, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT,
@@ -615,8 +623,9 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
bt = uiDefIconButBitI(block, TOG, passflag, 0, (*layflag & passflag) ? ICON_DOT : ICON_BLANK1,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, layflag, 0, 0, 0, 0, TIP_("Exclude this Pass from Combined"));
+ uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
}
- uiButSetFunc(bt, restrictbutton_r_lay_cb, tselem->id, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -630,11 +639,15 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
UI_UNIT_Y, &(md->mode), 0, 0, 0, 0,
TIP_("Restrict/Allow visibility in the 3D View"));
uiButSetFunc(bt, restrictbutton_modifier_cb, scene, ob);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
bt = uiDefIconButBitI(block, ICONTOGN, eModifierMode_Render, 0, ICON_RESTRICT_RENDER_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, &(md->mode), 0, 0, 0, 0, TIP_("Restrict/Allow renderability"));
uiButSetFunc(bt, restrictbutton_modifier_cb, scene, ob);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
}
else if (tselem->type == TSE_POSE_CHANNEL) {
bPoseChannel *pchan = (bPoseChannel *)te->directdata;
@@ -647,12 +660,16 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
UI_UNIT_Y, &(bone->flag), 0, 0, 0, 0,
TIP_("Restrict/Allow visibility in the 3D View"));
uiButSetFunc(bt, restrictbutton_bone_visibility_cb, ob->data, bone);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
bt = uiDefIconButBitI(block, ICONTOG, BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, &(bone->flag), 0, 0, 0, 0,
TIP_("Restrict/Allow selection in the 3D View"));
uiButSetFunc(bt, restrictbutton_bone_select_cb, ob->data, bone);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
}
else if (tselem->type == TSE_EBONE) {
EditBone *ebone = (EditBone *)te->directdata;
@@ -663,12 +680,16 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
UI_UNIT_Y, &(ebone->flag), 0, 0, 0, 0,
TIP_("Restrict/Allow visibility in the 3D View"));
uiButSetFunc(bt, restrictbutton_ebone_visibility_cb, NULL, ebone);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
bt = uiDefIconButBitI(block, ICONTOG, BONE_UNSELECTABLE, 0, ICON_RESTRICT_SELECT_OFF,
(int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), (int)te->ys, UI_UNIT_X,
UI_UNIT_Y, &(ebone->flag), 0, 0, 0, 0,
TIP_("Restrict/Allow selection in the 3D View"));
uiButSetFunc(bt, restrictbutton_ebone_select_cb, NULL, ebone);
+ uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
}
}
@@ -729,6 +750,8 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa
if (TSELEM_OPEN(tselem, soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree);
}
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
}
static void operator_call_cb(struct bContext *UNUSED(C), void *arg_kmi, void *arg2)
@@ -1005,6 +1028,8 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
if (TSELEM_OPEN(tselem, soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree);
}
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -1034,11 +1059,11 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa
dx = (int)UI_GetStringWidth(te->name);
- if (dx < 100) dx = 100;
- spx = te->xs + 2 * UI_UNIT_X - 4;
- if (spx + dx + 10 > ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax - spx - 10;
+ if (dx < 5*UI_UNIT_X) dx = 5*UI_UNIT_X;
+ spx = te->xs + 1.8f * UI_UNIT_X;
+ if (spx + dx + 0.5f*UI_UNIT_X > ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax - spx - 0.5f*UI_UNIT_X;
- bt = uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (int)te->ys, dx + 10, UI_UNIT_Y - 1, (void *)te->name,
+ bt = uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (int)te->ys, dx + UI_UNIT_X, UI_UNIT_Y - 1, (void *)te->name,
1.0, (float)len, 0, 0, "");
uiButSetRenameFunc(bt, namebutton_cb, tselem);
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index a236a97a803..8229b89fb94 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -187,6 +187,10 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SEQUENCER_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+#ifdef __APPLE__
+ WM_keymap_add_item(keymap, "SEQUENCER_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
+ WM_keymap_add_item(keymap, "SEQUENCER_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
+#endif
WM_keymap_add_item(keymap, "SEQUENCER_OT_images_separate", YKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 61cdddfc740..92b6b78e536 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -242,7 +242,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
- #ifdef __APPLE__
+#ifdef __APPLE__
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_END);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", PREV_WORD);
@@ -268,7 +268,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "TEXT_OT_find", GKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0);
WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
- #endif
+#endif
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 05099d14b12..c19158928ef 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -251,7 +251,7 @@ static bool set_draw_settings_cached(int clearcache, MTFace *texface, Material *
static int c_has_texface;
Object *litob = NULL; /* to get mode to turn off mipmap in painting mode */
- int backculled = GEMAT_BACKCULL || gtexdraw.use_backface_culling;
+ int backculled = 1;
int alphablend = 0;
int textured = 0;
int lit = 0;
@@ -650,9 +650,10 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
for (a = 0, mp = mface; a < totpoly; a++, mtpoly++, mp++) {
short matnr = mp->mat_nr;
int mf_smooth = mp->flag & ME_SMOOTH;
- Material *mat = me->mat[matnr];
+ Material *mat = (me->mat) ? me->mat[matnr] : NULL;
int mode = mat ? mat->game.flag : GEMAT_INVISIBLE;
+
if (!(mode & GEMAT_INVISIBLE) && (mode & GEMAT_TEXT) && mp->totloop >= 3) {
/* get the polygon as a tri/quad */
int mp_vi[4];
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 989525fffb8..af7758b96f6 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -491,9 +491,6 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
else
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
- if (t->mode == TFM_EDGE_SLIDE && (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT))
- WM_event_add_notifier(C, NC_GEOM | ND_DATA, NULL);
-
/* for realtime animation record - send notifiers recognised by animation editors */
// XXX: is this notifier a lame duck?
if ((t->animtimer) && IS_AUTOKEY_ON(t->scene))
@@ -5934,25 +5931,27 @@ void drawEdgeSlide(const struct bContext *C, TransInfo *t)
glLineWidth(line_size);
UI_ThemeColorShadeAlpha(TH_EDGE_SELECT, 80, alpha_shade);
glBegin(GL_LINES);
- glVertex3fv(curr_sv->v_a->co);
- glVertex3fv(curr_sv->v_co_orig);
- glVertex3fv(curr_sv->v_b->co);
- glVertex3fv(curr_sv->v_co_orig);
+ if (curr_sv->v_a) {
+ glVertex3fv(curr_sv->v_a->co);
+ glVertex3fv(curr_sv->v_co_orig);
+ }
+ if (curr_sv->v_b) {
+ glVertex3fv(curr_sv->v_b->co);
+ glVertex3fv(curr_sv->v_co_orig);
+ }
bglEnd();
UI_ThemeColorShadeAlpha(TH_SELECT, -30, alpha_shade);
glPointSize(ctrl_size);
+ bglBegin(GL_POINTS);
if (sld->flipped_vtx) {
- bglBegin(GL_POINTS);
- bglVertex3fv(curr_sv->v_b->co);
- bglEnd();
+ if (curr_sv->v_b) bglVertex3fv(curr_sv->v_b->co);
}
else {
- bglBegin(GL_POINTS);
- bglVertex3fv(curr_sv->v_a->co);
- bglEnd();
+ if (curr_sv->v_a) bglVertex3fv(curr_sv->v_a->co);
}
+ bglEnd();
UI_ThemeColorShadeAlpha(TH_SELECT, 255, alpha_shade);
glPointSize(guide_size);
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index 7303ccc95f3..436cdbfe6b5 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -165,6 +165,11 @@ Controller::~Controller()
_inter = NULL;
}
+ if (_ProgressBar) {
+ delete _ProgressBar;
+ _ProgressBar = NULL;
+ }
+
//delete _current_dirs;
}
diff --git a/source/blender/freestyle/intern/geometry/Bezier.cpp b/source/blender/freestyle/intern/geometry/Bezier.cpp
index e69830f3529..b9099df9a68 100644
--- a/source/blender/freestyle/intern/geometry/Bezier.cpp
+++ b/source/blender/freestyle/intern/geometry/Bezier.cpp
@@ -106,6 +106,11 @@ BezierCurve::BezierCurve(vector<Vec2d>& iPoints, double error)
BezierCurve::~BezierCurve()
{
+ if (!_Segments.empty()) {
+ vector<BezierCurveSegment*>::iterator v, vend;
+ for (v = _Segments.begin(), vend = _Segments.end(); v != vend; ++v)
+ delete *v;
+ }
if (_currentSegment)
delete _currentSegment;
}
diff --git a/source/blender/freestyle/intern/geometry/FitCurve.cpp b/source/blender/freestyle/intern/geometry/FitCurve.cpp
index c043f2cb0b9..cc21ba05f3d 100644
--- a/source/blender/freestyle/intern/geometry/FitCurve.cpp
+++ b/source/blender/freestyle/intern/geometry/FitCurve.cpp
@@ -487,6 +487,8 @@ void FitCurveWrapper::FitCurve(vector<Vec2d>& data, vector<Vec2d>& oCurve, doubl
FitCurve(d, size, error);
+ delete[] d;
+
// copy results
for (vector<Vector2>::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; ++v) {
oCurve.push_back(Vec2d(v->x(), v->y())) ;
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp
index c684eaf483e..3b1232c51af 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp
@@ -704,7 +704,7 @@ int float_array_from_PyObject(PyObject *obj, float *v, int n)
return float_array_from_PyList(obj, v, n);
}
else if (PyTuple_Check(obj) && PyTuple_Size(obj) == n) {
- return float_array_from_PyList(obj, v, n);
+ return float_array_from_PyTuple(obj, v, n);
}
return 0;
}
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
index c0372a10aef..e17f16a2fa7 100644
--- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
+++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
@@ -526,12 +526,12 @@ static PyObject *StrokeAttribute_color_get(BPy_StrokeAttribute *self, void *UNUS
static int StrokeAttribute_color_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
{
- Vec3f *v = Vec3f_ptr_from_PyObject(value);
- if (!v) {
+ float v[3];
+ if (!float_array_from_PyObject(value, v, 3)) {
PyErr_SetString(PyExc_ValueError, "value must be a 3-dimensional vector");
return -1;
}
- self->sa->setColor(v->x(), v->y(), v->z());
+ self->sa->setColor(v[0], v[1], v[2]);
return 0;
}
@@ -550,12 +550,12 @@ static PyObject *StrokeAttribute_thickness_get(BPy_StrokeAttribute *self, void *
static int StrokeAttribute_thickness_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure))
{
- Vec2f *v = Vec2f_ptr_from_PyObject(value);
- if (!v) {
+ float v[2];
+ if (!float_array_from_PyObject(value, v, 2)) {
PyErr_SetString(PyExc_ValueError, "value must be a 2-dimensional vector");
return -1;
}
- self->sa->setThickness(v->x(), v->y());
+ self->sa->setThickness(v[0], v[1]);
return 0;
}
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
index 1279d1824fb..2215bd9df02 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
@@ -214,6 +214,13 @@ Smoother::Smoother(Stroke &ioStroke)
_safeTest = (_nbVertices > 4);
}
+Smoother::~Smoother()
+{
+ delete[] _vertex;
+ delete[] _curvature;
+ delete[] _normal;
+}
+
void Smoother::smooth(int nbIteration, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference,
real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real iCarricatureFactor)
{
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
index bd2b28059d8..18472ff2c2a 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
@@ -154,7 +154,7 @@ class LIB_STROKE_EXPORT Smoother
public:
Smoother(Stroke &ioStroke);
- virtual ~Smoother() {}
+ virtual ~Smoother();
void smooth(int nbIterations, real iFactorPoint, real ifactorCurvature, real iFactorCurvatureDifference,
real iAnisoPoint, real iAnisoNormal, real iAnisoCurvature, real icarricatureFactor);
diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp
index 77b7c565279..b70564d147c 100644
--- a/source/blender/freestyle/intern/system/PseudoNoise.cpp
+++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp
@@ -32,15 +32,12 @@
namespace Freestyle {
-static const unsigned NB_VALUE_NOISE = 512;
-
-real *PseudoNoise::_values;
+real PseudoNoise::_values[];
PseudoNoise::PseudoNoise() {}
void PseudoNoise::init(long seed)
{
- _values = new real[NB_VALUE_NOISE];
RandGen::srand48(seed);
for (unsigned int i = 0; i < NB_VALUE_NOISE; i++)
_values[i] = -1.0 + 2.0 * RandGen::drand48();
diff --git a/source/blender/freestyle/intern/system/PseudoNoise.h b/source/blender/freestyle/intern/system/PseudoNoise.h
index b190e8c8568..e98556026d0 100644
--- a/source/blender/freestyle/intern/system/PseudoNoise.h
+++ b/source/blender/freestyle/intern/system/PseudoNoise.h
@@ -49,7 +49,8 @@ public:
static void init(long seed);
protected:
- static real *_values;
+ static const unsigned NB_VALUE_NOISE = 512;
+ static real _values[NB_VALUE_NOISE];
};
} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/TimeStamp.cpp b/source/blender/freestyle/intern/system/TimeStamp.cpp
index dc4e717486d..7c02095ad51 100644
--- a/source/blender/freestyle/intern/system/TimeStamp.cpp
+++ b/source/blender/freestyle/intern/system/TimeStamp.cpp
@@ -30,6 +30,6 @@
namespace Freestyle {
LIB_SYSTEM_EXPORT
-TimeStamp *TimeStamp::_instance = 0;
+TimeStamp TimeStamp::_instance;
} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/TimeStamp.h b/source/blender/freestyle/intern/system/TimeStamp.h
index 2ebfb359dd5..6322ab3fd65 100644
--- a/source/blender/freestyle/intern/system/TimeStamp.h
+++ b/source/blender/freestyle/intern/system/TimeStamp.h
@@ -37,9 +37,7 @@ class LIB_SYSTEM_EXPORT TimeStamp
public:
static inline TimeStamp *instance()
{
- if (_instance == NULL)
- _instance = new TimeStamp;
- return _instance;
+ return &_instance;
}
inline unsigned getTimeStamp() const
@@ -66,7 +64,7 @@ protected:
TimeStamp(const TimeStamp&) {}
private:
- static TimeStamp *_instance;
+ static TimeStamp _instance;
unsigned _time_stamp;
};
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 816a5b0bdc3..45613f2083f 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -857,6 +857,7 @@ PointerRNA RNA_property_pointer_get_default(PointerRNA *ptr, PropertyRNA *prop);
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter);
void RNA_property_collection_next(CollectionPropertyIterator *iter);
+void RNA_property_collection_skip(CollectionPropertyIterator *iter, int num);
void RNA_property_collection_end(CollectionPropertyIterator *iter);
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop);
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index a7e81416b80..ac2c994a4f8 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2820,6 +2820,29 @@ void RNA_property_collection_next(CollectionPropertyIterator *iter)
cprop->next(iter);
}
+void RNA_property_collection_skip(CollectionPropertyIterator *iter, int num)
+{
+ CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(iter->prop);
+ int i;
+
+ if (num > 1 && (iter->idprop || (cprop->property.flag & PROP_RAW_ARRAY))) {
+ /* fast skip for array */
+ ArrayIterator *internal = iter->internal;
+
+ if (!internal->skip) {
+ internal->ptr += internal->itemsize*(num-1);
+ iter->valid = (internal->ptr < internal->endptr);
+ if(iter->valid)
+ RNA_property_collection_next(iter);
+ return;
+ }
+ }
+
+ /* slow iteration otherwise */
+ for (i = 0; i < num && iter->valid; i++)
+ RNA_property_collection_next(iter);
+}
+
void RNA_property_collection_end(CollectionPropertyIterator *iter)
{
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(iter->prop);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 818caa82e1f..8a49df1a35d 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -6647,7 +6647,10 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_NodeTree_node_new");
RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
- parm = RNA_def_string(func, "type", "", MAX_NAME, "Type", "Type of node to add");
+ /* XXX warning note should eventually be removed,
+ * added this here to avoid frequent confusion with API changes from "type" to "bl_idname"
+ */
+ parm = RNA_def_string(func, "type", "", MAX_NAME, "Type", "Type of node to add (Warning: should be same as node.bl_idname, not node.type!)");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "node", "Node", "", "New node");
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 140b9d74d06..07aaa30f7ef 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -922,32 +922,6 @@ static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRN
pt->flag &= ~PTARGET_CURRENT;
}
}
-static int rna_ParticleTarget_name_length(PointerRNA *ptr)
-{
- ParticleTarget *pt = ptr->data;
-
- if (pt->flag & PTARGET_VALID) {
- ParticleSystem *psys = NULL;
-
- if (pt->ob)
- psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
- else {
- Object *ob = (Object *) ptr->id.data;
- psys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
- }
-
- if (psys) {
- if (pt->ob)
- return strlen(pt->ob->id.name + 2) + 2 + strlen(psys->name);
- else
- return strlen(psys->name);
- }
- else
- return 15;
- }
- else
- return 15;
-}
static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
{
@@ -976,6 +950,15 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
strcpy(str, "Invalid target!");
}
+static int rna_ParticleTarget_name_length(PointerRNA *ptr)
+{
+ char tstr[MAX_ID_NAME + MAX_ID_NAME + 64];
+
+ rna_ParticleTarget_name_get(ptr, tstr);
+
+ return strlen(tstr);
+}
+
static int particle_id_check(PointerRNA *ptr)
{
ID *id = ptr->id.data;
@@ -1062,15 +1045,6 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int
}
}
-static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str);
-
-static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
-{
- char tstr[32];
- rna_ParticleDupliWeight_name_get(ptr, tstr);
- return strlen(tstr);
-}
-
static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
{
ParticleDupliWeight *dw = ptr->data;
@@ -1081,6 +1055,15 @@ static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
strcpy(str, "No object");
}
+static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
+{
+ char tstr[MAX_ID_NAME + 64];
+
+ rna_ParticleDupliWeight_name_get(ptr, tstr);
+
+ return strlen(tstr);
+}
+
static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 0d224469b4e..9327522aa9d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -453,6 +453,9 @@ static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value)
for (nested_set = set; nested_set; nested_set = nested_set->set) {
if (nested_set == scene)
return;
+ /* prevent eternal loops, set can point to next, and next to set, without problems usually */
+ if (nested_set->set == set)
+ return;
}
scene->set = set;
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index c5c8789001a..2d89317b4ae 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -194,7 +194,7 @@ static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *
return uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
}
-static void rna_uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name,
+static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name,
const char *text_ctxt, int translate, int icon)
{
wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
@@ -208,7 +208,7 @@ static void rna_uiItemMenuEnumO(uiLayout *layout, const char *opname, const char
name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
/* XXX This will search operator again :( */
- uiItemMenuEnumO(layout, opname, propname, name, icon);
+ uiItemMenuEnumO(layout, C, opname, propname, name, icon);
}
static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctxt, int translate,
@@ -549,6 +549,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index 1c067892702..5e90aa10294 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -346,9 +346,9 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
BMOpSlot *slot_targetmap = NULL; /* for weldop */
/* need to avoid infinite recursion here */
- if (amd->start_cap && amd->start_cap != ob)
+ if (amd->start_cap && amd->start_cap != ob && amd->start_cap->type == OB_MESH)
start_cap = mesh_get_derived_final(scene, amd->start_cap, CD_MASK_MESH);
- if (amd->end_cap && amd->end_cap != ob)
+ if (amd->end_cap && amd->end_cap != ob && amd->end_cap->type == OB_MESH)
end_cap = mesh_get_derived_final(scene, amd->end_cap, CD_MASK_MESH);
unit_m4(offset);
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index 04198d9feb9..2be2f350a73 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -136,7 +136,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
* in other scenes when compositing */
if (bmd->object != ob) {
/* weak! - but we can too easy end up with circular dep crash otherwise */
- if (modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) {
+ if (bmd->object->type == OB_MESH && modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) {
dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH);
}
else {
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 48caa40ca9c..c82eb1f4096 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2270,7 +2270,7 @@ static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *s
static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop)
{
CollectionPropertyIterator rna_macro_iter;
- int count = 0;
+ int count;
PyObject *list;
PyObject *item;
@@ -2279,20 +2279,12 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py
list = PyList_New(0);
- /* first loop up-until the start */
- for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter);
- rna_macro_iter.valid;
- RNA_property_collection_next(&rna_macro_iter))
- {
- /* PointerRNA itemptr = rna_macro_iter.ptr; */
- if (count == start) {
- break;
- }
- count++;
- }
+ /* skip to start */
+ RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter);
+ RNA_property_collection_skip(&rna_macro_iter, start);
/* add items until stop */
- for (; rna_macro_iter.valid;
+ for (count = start; rna_macro_iter.valid;
RNA_property_collection_next(&rna_macro_iter))
{
item = pyrna_struct_CreatePyObject(&rna_macro_iter.ptr);
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 1cf6bc820ea..984420d313f 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -871,7 +871,7 @@ static float *get_object_orco(Render *re, Object *ob)
if (!orco) {
if (ELEM(ob->type, OB_CURVE, OB_FONT)) {
- orco = BKE_curve_make_orco(re->scene, ob);
+ orco = BKE_curve_make_orco(re->scene, ob, NULL);
}
else if (ob->type==OB_SURF) {
orco = BKE_curve_surf_make_orco(ob);
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 65976668502..c87f2df25bc 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -1109,9 +1109,12 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
/* mipmap test */
image_mipmap_test(tex, ibuf);
- if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
- if ((tex->imaflag & TEX_CALCALPHA) == 0)
- texres->talpha = 1;
+ if (ima) {
+ if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
+ if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+ texres->talpha = 1;
+ }
+ }
}
texr.talpha = texres->talpha;
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 166aef48ec7..cfa914091f1 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -63,6 +63,7 @@ struct wmDropBox;
struct wmDrag;
struct ImBuf;
struct ImageFormatData;
+struct ARegion;
typedef struct wmJob wmJob;
@@ -130,6 +131,7 @@ void *WM_paint_cursor_activate(struct wmWindowManager *wm,
void *customdata);
void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle);
+void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *ar);
void WM_cursor_warp (struct wmWindow *win, int x, int y);
float WM_cursor_pressure (const struct wmWindow *win);
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index 8d37db000c0..cebafcea12d 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -95,7 +95,7 @@ void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *key
const char *WM_key_event_string(short type);
int WM_key_event_operator_id(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, int hotkey, struct wmKeyMap **keymap_r);
-char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const bool sloppy, char *str, int len);
+char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const bool strict, char *str, int len);
#ifdef __cplusplus
}
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 005d02647a4..438004b5d76 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -798,6 +798,12 @@ void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
}
}
+void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *ar)
+{
+ win->screen->do_draw_paintcursor = TRUE;
+ wm_tag_redraw_overlay(win, ar);
+}
+
void wm_draw_update(bContext *C)
{
wmWindowManager *wm = CTX_wm_manager(C);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index f79ac1c9083..89dc6ccc038 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2002,8 +2002,7 @@ static void wm_paintcursor_tag(bContext *C, wmPaintCursor *pc, ARegion *ar)
for (; pc; pc = pc->next) {
if (pc->poll == NULL || pc->poll(C)) {
wmWindow *win = CTX_wm_window(C);
- win->screen->do_draw_paintcursor = TRUE;
- wm_tag_redraw_overlay(win, ar);
+ WM_paint_cursor_tag_redraw(win, ar);
}
}
}
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index d5b6d2cd0c8..4a0e8270bc9 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -863,14 +863,9 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
}
#endif
- if (kmi->ptr) {
- PointerRNA properties_ptr;
- RNA_pointer_create(NULL, kmi->ptr->type, properties, &properties_ptr);
-
- if (RNA_struct_equals(&properties_ptr, kmi->ptr, is_strict)) {
- if (keymap_r) *keymap_r = keymap;
- return kmi;
- }
+ if (kmi->ptr && IDP_EqualsProperties_ex(properties, kmi->ptr->data, is_strict)) {
+ if (keymap_r) *keymap_r = keymap;
+ return kmi;
}
}
else {
@@ -938,9 +933,9 @@ static wmKeyMapItem *wm_keymap_item_find_props(
static wmKeyMapItem *wm_keymap_item_find(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const short hotkey, const short UNUSED(sloppy), wmKeyMap **keymap_r)
+ IDProperty *properties, const short hotkey, const bool strict, wmKeyMap **keymap_r)
{
- wmKeyMapItem *found = wm_keymap_item_find_props(C, opname, opcontext, properties, 1, hotkey, keymap_r);
+ wmKeyMapItem *found = wm_keymap_item_find_props(C, opname, opcontext, properties, strict, hotkey, keymap_r);
if (!found && properties) {
wmOperatorType *ot = WM_operatortype_find(opname, TRUE);
@@ -953,14 +948,14 @@ static wmKeyMapItem *wm_keymap_item_find(
RNA_pointer_create(NULL, ot->srna, properties_default, &opptr);
if (WM_operator_properties_default(&opptr, true) ||
- (ot->prop && RNA_property_is_set(&opptr, ot->prop)))
+ (!strict && ot->prop && RNA_property_is_set(&opptr, ot->prop)))
{
/* for operator that has enum menu, unset it so it always matches */
- if (ot->prop) {
+ if (!strict && ot->prop) {
RNA_property_unset(&opptr, ot->prop);
}
- found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, 0, hotkey, keymap_r);
+ found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, false, hotkey, keymap_r);
}
IDP_FreeProperty(properties_default);
@@ -973,9 +968,9 @@ static wmKeyMapItem *wm_keymap_item_find(
char *WM_key_event_operator_string(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const bool sloppy, char *str, int len)
+ IDProperty *properties, const bool strict, char *str, int len)
{
- wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, strict, NULL);
if (kmi) {
WM_keymap_item_to_string(kmi, str, len);
@@ -989,7 +984,7 @@ int WM_key_event_operator_id(
const bContext *C, const char *opname, int opcontext,
IDProperty *properties, int hotkey, wmKeyMap **keymap_r)
{
- wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, hotkey, true, keymap_r);
if (kmi)
return kmi->id;
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 6912adbb60c..ebe35369844 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -905,7 +905,8 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol,
converter->GetGLSLMaterials());
- converter->CacheBlenderMaterial(ma, bl_mat);
+ if ((!ma->mode & MA_FACETEXTURE))
+ converter->CacheBlenderMaterial(ma, bl_mat);
}
const bool use_vcol = GetMaterialUseVColor(ma, bl_mat->glslmat);
@@ -920,7 +921,8 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace
kx_blmat->Initialize(scene, bl_mat, (ma?&ma->game:NULL), lightlayer);
polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat);
- converter->CachePolyMaterial(ma, polymat);
+ if ((!ma->mode & MA_FACETEXTURE))
+ converter->CachePolyMaterial(ma, polymat);
}
}
else {
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 86e8c9c6e76..8703a545a4f 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -601,7 +601,7 @@ void KX_BlenderSceneConverter::RegisterPolyMaterial(RAS_IPolyMaterial *polymat)
void KX_BlenderSceneConverter::CachePolyMaterial(struct Material *mat, RAS_IPolyMaterial *polymat)
{
- if (m_use_mat_cache)
+ if (m_use_mat_cache && mat)
m_polymat_cache[mat] = polymat;
}
@@ -612,7 +612,7 @@ RAS_IPolyMaterial *KX_BlenderSceneConverter::FindCachedPolyMaterial(struct Mater
void KX_BlenderSceneConverter::CacheBlenderMaterial(struct Material *mat, BL_Material *blmat)
{
- if (m_use_mat_cache)
+ if (m_use_mat_cache && mat)
m_mat_cache[mat] = blmat;
}
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp
index fa00cafa148..07295d238ef 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -55,7 +55,6 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_pose(NULL),
m_blendpose(NULL),
m_blendinpose(NULL),
- m_ptrrna(NULL),
m_obj(gameobj),
m_startframe(0.f),
m_endframe(0.f),
@@ -71,24 +70,6 @@ BL_Action::BL_Action(class KX_GameObject* gameobj)
m_done(true),
m_calc_localtime(true)
{
- if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_ARMATURE)
- {
- BL_ArmatureObject *obj = (BL_ArmatureObject*)m_obj;
-
- m_ptrrna = new PointerRNA();
- RNA_id_pointer_create(&obj->GetArmatureObject()->id, m_ptrrna);
- }
- else
- {
- BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj;
- BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
-
- if (shape_deformer)
- {
- m_ptrrna = new PointerRNA();
- RNA_id_pointer_create(&shape_deformer->GetKey()->id, m_ptrrna);
- }
- }
}
BL_Action::~BL_Action()
@@ -99,8 +80,6 @@ BL_Action::~BL_Action()
game_free_pose(m_blendpose);
if (m_blendinpose)
game_free_pose(m_blendinpose);
- if (m_ptrrna)
- delete m_ptrrna;
ClearControllerList();
}
@@ -426,7 +405,11 @@ void BL_Action::Update(float curtime)
bPose *temp = arm->pose;
arm->pose = m_pose;
- animsys_evaluate_action(m_ptrrna, m_action, NULL, m_localtime);
+
+ PointerRNA ptrrna;
+ RNA_id_pointer_create(&arm->id, &ptrrna);
+
+ animsys_evaluate_action(&ptrrna, m_action, NULL, m_localtime);
arm->pose = temp;
}
@@ -465,8 +448,10 @@ void BL_Action::Update(float curtime)
{
Key *key = shape_deformer->GetKey();
+ PointerRNA ptrrna;
+ RNA_id_pointer_create(&key->id, &ptrrna);
- animsys_evaluate_action(m_ptrrna, m_action, NULL, m_localtime);
+ animsys_evaluate_action(&ptrrna, m_action, NULL, m_localtime);
// Handle blending between shape actions
if (m_blendin && m_blendframe < m_blendin)
diff --git a/source/gameengine/Ketsji/BL_Action.h b/source/gameengine/Ketsji/BL_Action.h
index 370bbf51d72..e4088633e61 100644
--- a/source/gameengine/Ketsji/BL_Action.h
+++ b/source/gameengine/Ketsji/BL_Action.h
@@ -42,7 +42,6 @@ private:
struct bPose* m_pose;
struct bPose* m_blendpose;
struct bPose* m_blendinpose;
- struct PointerRNA *m_ptrrna;
std::vector<class SG_Controller*> m_sg_contr_list;
class KX_GameObject* m_obj;
std::vector<float> m_blendshape;
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp
index 3f2a9a6df6a..ff3b3a2692c 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.cpp
+++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp
@@ -97,8 +97,8 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat)
return;
gpumat = mGPUMat;
-
- if (ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) {
+ if (ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED || (ras->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW &&
+ mat->alphablend != GEMAT_SOLID && !ras->GetUsingOverrideShader())) {
GPU_material_vertex_attributes(gpumat, &attribs);
attrib_num = GetAttribNum();
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index af8c855f3b0..7d1190bef5c 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -238,13 +238,21 @@ void RAS_BucketManager::Renderbuckets(
BucketList::iterator bit;
list<RAS_MeshSlot>::iterator mit;
for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) {
- // RAS_MaterialBucket *bucket = *bit; /* UNUSED */
+ /* This (and the similar lines of code for the alpha buckets) is kind of a hacky fix for #34382. If we're
+ * drawing shadows and the material doesn't cast shadows, then the mesh is still modified, so we don't want to
+ * set MeshModified to false yet. This will happen correctly in the main render pass.
+ */
+ if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows())
+ continue;
+
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
}
}
for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) {
- // RAS_MaterialBucket* bucket = *bit; /* UNUSED */
+ if (rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW && !(*bit)->GetPolyMaterial()->CastsShadows())
+ continue;
+
for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) {
mit->m_mesh->SetMeshModified(false);
}