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:
authorJeroen Bakker <j.bakker@atmind.nl>2022-03-02 18:03:01 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2022-03-02 18:03:01 +0300
commita41c2a513761e8884e92526b069ff6eed8168676 (patch)
treee624093127815a09d2807dccddaabea35510e154 /source/blender/editors/object/object_constraint.c
parenta23b4429915ca8597510b57353c4df331487c620 (diff)
parentc23ec04b4e30f300a670f1cb1dc882e0608d09ad (diff)
Merge branch 'master' into temp-image-buffer-rasterizertemp-image-buffer-rasterizer
Diffstat (limited to 'source/blender/editors/object/object_constraint.c')
-rw-r--r--source/blender/editors/object/object_constraint.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 4ccd35b512b..3f4ed27a175 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -511,7 +511,7 @@ static void test_constraint(
*
* In other cases it should be impossible to have a type mismatch.
*/
- if (ct->tar->type != OB_CURVE) {
+ if (ct->tar->type != OB_CURVES_LEGACY) {
con->flag |= CONSTRAINT_DISABLE;
}
else {
@@ -1443,6 +1443,11 @@ static int constraint_delete_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
ListBase *lb = ED_object_constraint_list_from_constraint(ob, con, NULL);
/* Store name temporarily for report. */
@@ -1510,6 +1515,11 @@ static int constraint_apply_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ListBase *constraints = ED_object_constraint_list_from_constraint(ob, con, &pchan);
@@ -1602,6 +1612,11 @@ static int constraint_copy_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ListBase *constraints = ED_object_constraint_list_from_constraint(ob, con, &pchan);
@@ -1682,6 +1697,11 @@ static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *obact = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, obact, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ED_object_constraint_list_from_constraint(obact, con, &pchan);
@@ -2275,7 +2295,8 @@ static bool get_new_constraint_target(
break;
}
- if (((!only_curve) || (ob->type == OB_CURVE)) && ((!only_mesh) || (ob->type == OB_MESH))) {
+ if (((!only_curve) || (ob->type == OB_CURVES_LEGACY)) &&
+ ((!only_mesh) || (ob->type == OB_MESH))) {
/* set target */
*tar_ob = ob;
found = true;