diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-02-26 02:15:59 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-02-26 02:15:59 +0300 |
commit | 3cf2821f2f09d3c55dd88c2b6fb3b26e1ff69a7e (patch) | |
tree | 66ffef104bffcd2490d929c9789fc2cbc11e73ad /source/blender/makesrna | |
parent | bda0456933e87c2f623a8e4f980bf7cfc6b3982a (diff) | |
parent | 5c3216e2334863137019b55a44d5b9cfea842c10 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 14 |
3 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f8b3bdd62e9..ecb011991e5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1312,8 +1312,12 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value) static bConstraint *rna_Object_constraints_new(Object *object, int type) { + bConstraint *new_con = BKE_constraint_add_for_object(object, NULL, type); + + ED_object_constraint_tag_update(object, new_con); WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, object); - return BKE_constraint_add_for_object(object, NULL, type); + + return new_con; } static void rna_Object_constraints_remove(Object *object, ReportList *reports, PointerRNA *con_ptr) diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 5fd4762e5be..ca0b4063616 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1275,7 +1275,7 @@ static void rna_def_field(BlenderRNA *brna) prop = RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_power"); RNA_def_property_range(prop, 0.0f, 10.0f); - RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)"); + RNA_def_property_ui_text(prop, "Falloff Power", ""); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); @@ -1394,6 +1394,11 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_SMOKE_DENSITY); RNA_def_property_ui_text(prop, "Apply Density", "Adjust force strength based on smoke density"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + prop = RNA_def_property(srna, "use_gravity_falloff", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GRAVITATION); + RNA_def_property_ui_text(prop, "Gravity Falloff", "Multiply force by 1/distance²"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + /* Pointer */ diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 28ce63a61bd..8d161466d56 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -524,12 +524,15 @@ static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA va BKE_constraints_active_set(&pchan->constraints, (bConstraint *)value.data); } -static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, int type) +static bConstraint *rna_PoseChannel_constraints_new(ID *id, bPoseChannel *pchan, Main *main, int type) { - /*WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); */ - /* TODO, pass object also */ - /* TODO, new pose bones don't have updated draw flags */ - return BKE_constraint_add_for_pose(NULL, pchan, NULL, type); + Object *ob = (Object *)id; + bConstraint *new_con = BKE_constraint_add_for_pose(ob, pchan, NULL, type); + + ED_object_constraint_dependency_tag_update(main, ob, new_con); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, id); + + return new_con; } static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, ReportList *reports, PointerRNA *con_ptr) @@ -764,6 +767,7 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro /* Constraint collection */ func = RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new"); RNA_def_function_ui_description(func, "Add a constraint to this object"); + RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_SELF_ID); /* ID and Main needed for refresh */ /* return type */ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint"); RNA_def_function_return(func, parm); |