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
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-31 13:57:24 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-31 13:57:24 +0300
commit9b4e56c091f0df255cc09607061d130847a5f438 (patch)
tree061dec5b7a2df3d560dcdb9bf70e5878e8fb6279 /source/blender/editors
parentd41bf6b8e8e9b00262cfb5547fda376e620eb864 (diff)
parent28369f725c10f167e504f0acd695a0f9d3c2a709 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/BKE_camera.h source/blender/blenkernel/BKE_dynamicpaint.h source/blender/blenkernel/BKE_object.h source/blender/blenkernel/intern/camera.c source/blender/blenkernel/intern/dynamicpaint.c source/blender/blenkernel/intern/object.c source/blender/blenkernel/intern/smoke.c source/blender/editors/object/object_transform.c source/blender/editors/physics/dynamicpaint_ops.c source/blender/editors/space_view3d/view3d_edit.c source/blender/editors/space_view3d/view3d_view.c source/blender/modifiers/intern/MOD_dynamicpaint.c source/blenderplayer/bad_level_call_stubs/stubs.c
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_object.h6
-rw-r--r--source/blender/editors/object/object_constraint.c51
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c7
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
4 files changed, 36 insertions, 30 deletions
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 38cf754dda2..b3a2f6f7ca6 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -197,13 +197,13 @@ struct ListBase *get_active_constraints(struct Object *ob);
struct ListBase *get_constraint_lb(struct Object *ob, struct bConstraint *con, struct bPoseChannel **r_pchan);
struct bConstraint *get_active_constraint(struct Object *ob);
-void object_test_constraints(struct Object *ob);
+void object_test_constraints(struct Main *bmain, struct Object *ob);
void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con);
-void ED_object_constraint_update(struct Object *ob);
+void ED_object_constraint_update(struct Main *bmain, struct Object *ob);
void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
-void ED_object_constraint_tag_update(struct Object *ob, struct bConstraint *con);
+void ED_object_constraint_tag_update(struct Main *bmain, struct Object *ob, struct bConstraint *con);
void ED_object_constraint_dependency_tag_update(struct Main *bmain, struct Object *ob, struct bConstraint *con);
/* object_modes.c */
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 28ff1ffab1c..6c4a79ec4b4 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -262,7 +262,7 @@ static void set_constraint_nth_target(bConstraint *con, Object *target, const ch
/* ------------- Constraint Sanity Testing ------------------- */
-static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con, int type)
+static void test_constraint(Main *bmain, Object *owner, bPoseChannel *pchan, bConstraint *con, int type)
{
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
ListBase targets = {NULL, NULL};
@@ -280,7 +280,7 @@ static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con
* the constraint is deemed invalid
*/
/* default IK check ... */
- if (BKE_object_exists_check(data->tar) == 0) {
+ if (BKE_object_exists_check(bmain, data->tar) == 0) {
data->tar = NULL;
con->flag |= CONSTRAINT_DISABLE;
}
@@ -291,7 +291,7 @@ static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con
}
if (data->poletar) {
- if (BKE_object_exists_check(data->poletar) == 0) {
+ if (BKE_object_exists_check(bmain, data->poletar) == 0) {
data->poletar = NULL;
con->flag |= CONSTRAINT_DISABLE;
}
@@ -310,7 +310,7 @@ static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con
bPivotConstraint *data = con->data;
/* target doesn't have to exist, but if it is non-null, it must exist! */
- if (data->tar && BKE_object_exists_check(data->tar) == 0) {
+ if (data->tar && BKE_object_exists_check(bmain, data->tar) == 0) {
data->tar = NULL;
con->flag |= CONSTRAINT_DISABLE;
}
@@ -433,7 +433,7 @@ static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con
/* disable and clear constraints targets that are incorrect */
for (ct = targets.first; ct; ct = ct->next) {
/* general validity checks (for those constraints that need this) */
- if (BKE_object_exists_check(ct->tar) == 0) {
+ if (BKE_object_exists_check(bmain, ct->tar) == 0) {
/* object doesn't exist, but constraint requires target */
ct->tar = NULL;
con->flag |= CONSTRAINT_DISABLE;
@@ -503,7 +503,7 @@ static int constraint_type_get(Object *owner, bPoseChannel *pchan)
/* checks validity of object pointers, and NULLs,
* if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag.
*/
-static void test_constraints(Object *owner, bPoseChannel *pchan)
+static void test_constraints(Main *bmain, Object *owner, bPoseChannel *pchan)
{
bConstraint *curcon;
ListBase *conlist = NULL;
@@ -526,44 +526,44 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
/* Check all constraints - is constraint valid? */
if (conlist) {
for (curcon = conlist->first; curcon; curcon = curcon->next) {
- test_constraint(owner, pchan, curcon, type);
+ test_constraint(bmain, owner, pchan, curcon, type);
}
}
}
-void object_test_constraints(Object *owner)
+void object_test_constraints(Main *bmain, Object *owner)
{
if (owner->constraints.first)
- test_constraints(owner, NULL);
+ test_constraints(bmain, owner, NULL);
if (owner->type == OB_ARMATURE && owner->pose) {
bPoseChannel *pchan;
for (pchan = owner->pose->chanbase.first; pchan; pchan = pchan->next) {
if (pchan->constraints.first)
- test_constraints(owner, pchan);
+ test_constraints(bmain, owner, pchan);
}
}
}
-static void object_test_constraint(Object *owner, bConstraint *con)
+static void object_test_constraint(Main *bmain, Object *owner, bConstraint *con)
{
if (owner->type == OB_ARMATURE && owner->pose) {
if (BLI_findindex(&owner->constraints, con) != -1) {
- test_constraint(owner, NULL, con, CONSTRAINT_OBTYPE_OBJECT);
+ test_constraint(bmain, owner, NULL, con, CONSTRAINT_OBTYPE_OBJECT);
}
else {
bPoseChannel *pchan;
for (pchan = owner->pose->chanbase.first; pchan; pchan = pchan->next) {
if (BLI_findindex(&pchan->constraints, con) != -1) {
- test_constraint(owner, pchan, con, CONSTRAINT_OBTYPE_BONE);
+ test_constraint(bmain, owner, pchan, con, CONSTRAINT_OBTYPE_BONE);
break;
}
}
}
}
else {
- test_constraint(owner, NULL, con, CONSTRAINT_OBTYPE_OBJECT);
+ test_constraint(bmain, owner, NULL, con, CONSTRAINT_OBTYPE_OBJECT);
}
}
@@ -689,6 +689,7 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
static int stretchto_reset_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_STRETCHTO);
bStretchToConstraint *data = (con) ? (bStretchToConstraint *)con->data : NULL;
@@ -699,7 +700,7 @@ static int stretchto_reset_exec(bContext *C, wmOperator *op)
/* just set original length to 0.0, which will cause a reset on next recalc */
data->orglength = 0.0f;
- ED_object_constraint_update(ob);
+ ED_object_constraint_update(bmain, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, NULL);
return OPERATOR_FINISHED;
@@ -735,6 +736,7 @@ void CONSTRAINT_OT_stretchto_reset(wmOperatorType *ot)
static int limitdistance_reset_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_DISTLIMIT);
bDistLimitConstraint *data = (con) ? (bDistLimitConstraint *)con->data : NULL;
@@ -745,7 +747,7 @@ static int limitdistance_reset_exec(bContext *C, wmOperator *op)
/* just set original length to 0.0, which will cause a reset on next recalc */
data->dist = 0.0f;
- ED_object_constraint_update(ob);
+ ED_object_constraint_update(bmain, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, NULL);
return OPERATOR_FINISHED;
@@ -1198,11 +1200,11 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
BKE_constraints_active_set(lb, con);
}
-void ED_object_constraint_update(Object *ob)
+void ED_object_constraint_update(Main *bmain, Object *ob)
{
if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
- object_test_constraints(ob);
+ object_test_constraints(bmain, ob);
if (ob->type == OB_ARMATURE)
DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
@@ -1225,7 +1227,7 @@ static void object_pose_tag_update(Main *bmain, Object *ob)
void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
{
- ED_object_constraint_update(ob);
+ ED_object_constraint_update(bmain, ob);
if (ob->pose) {
object_pose_tag_update(bmain, ob);
@@ -1233,13 +1235,13 @@ void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
DEG_relations_tag_update(bmain);
}
-void ED_object_constraint_tag_update(Object *ob, bConstraint *con)
+void ED_object_constraint_tag_update(Main *bmain, Object *ob, bConstraint *con)
{
if (ob->pose) {
BKE_pose_tag_update_constraint_flags(ob->pose);
}
- object_test_constraint(ob, con);
+ object_test_constraint(bmain, ob, con);
if (ob->type == OB_ARMATURE)
DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
@@ -1254,7 +1256,7 @@ void ED_object_constraint_tag_update(Object *ob, bConstraint *con)
void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con)
{
- ED_object_constraint_tag_update(ob, con);
+ ED_object_constraint_tag_update(bmain, ob, con);
if (ob->pose) {
object_pose_tag_update(bmain, ob);
@@ -1271,6 +1273,7 @@ static int constraint_poll(bContext *C)
static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
{
+ Main *bmain = CTX_data_main(C);
PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint);
Object *ob = ptr.id.data;
bConstraint *con = ptr.data;
@@ -1280,7 +1283,7 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
if (BKE_constraint_remove_ex(lb, ob, con, true)) {
/* there's no active constraint now, so make sure this is the case */
BKE_constraints_active_set(&ob->constraints, NULL);
- ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
+ ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
/* relatiols */
DEG_relations_tag_update(CTX_data_main(C));
@@ -1816,7 +1819,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
}
/* make sure all settings are valid - similar to above checks, but sometimes can be wrong */
- object_test_constraints(ob);
+ object_test_constraints(bmain, ob);
if (pchan)
BKE_pose_update_constraint_flags(ob->pose);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 5ae6cec84ba..f351f4ff2b2 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -750,18 +750,19 @@ static void data_select_linked_cb(int event, TreeElement *te, TreeStoreElem *UNU
static void constraint_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *C_v)
{
bContext *C = C_v;
+ Main *bmain = CTX_data_main(C);
SpaceOops *soops = CTX_wm_space_outliner(C);
bConstraint *constraint = (bConstraint *)te->directdata;
Object *ob = (Object *)outliner_search_back(soops, te, ID_OB);
if (event == OL_CONSTRAINTOP_ENABLE) {
constraint->flag &= ~CONSTRAINT_OFF;
- ED_object_constraint_update(ob);
+ ED_object_constraint_update(bmain, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
}
else if (event == OL_CONSTRAINTOP_DISABLE) {
constraint->flag = CONSTRAINT_OFF;
- ED_object_constraint_update(ob);
+ ED_object_constraint_update(bmain, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT, ob);
}
else if (event == OL_CONSTRAINTOP_DELETE) {
@@ -777,7 +778,7 @@ static void constraint_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tsel
if (BKE_constraint_remove_ex(lb, ob, constraint, true)) {
/* there's no active constraint now, so make sure this is the case */
BKE_constraints_active_set(&ob->constraints, NULL);
- ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
+ ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob);
te->store_elem->flag &= ~TSE_SELECTED;
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 2ac2bf683e0..f37f446ad3e 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -54,6 +54,7 @@
#include "BKE_font.h"
#include "BKE_layer.h"
#include "BKE_library.h"
+#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
@@ -2803,6 +2804,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot)
/* like a localview without local!, was centerview() in 2.4x */
static int viewselected_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);