[Bf-blender-cvs] [2cdfc1b4af2] master: LibOverride: Make constraints fully overrideable.

Bastien Montagne noreply at git.blender.org
Wed Jun 3 18:47:00 CEST 2020


Commit: 2cdfc1b4af21d765e575441a6d4f1385f99e97bd
Author: Bastien Montagne
Date:   Wed Jun 3 18:45:24 2020 +0200
Branches: master
https://developer.blender.org/rB2cdfc1b4af21d765e575441a6d4f1385f99e97bd

LibOverride: Make constraints fully overrideable.

All settings of constraints should be overrideable now.
Modifiers will follow tomorrow.

Part of T77083.

===================================================================

M	source/blender/makesrna/intern/rna_constraint.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index dc0cde953f4..07ad8cbb37d 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -824,6 +824,8 @@ static void rna_def_constraint_headtail_common(StructRNA *srna)
 {
   PropertyRNA *prop;
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR);
   RNA_def_property_float_sdna(prop, "bConstraint", "headtail");
   RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1");
@@ -835,12 +837,16 @@ static void rna_def_constraint_headtail_common(StructRNA *srna)
                            "Follow B-Bone",
                            "Follow shape of B-Bone segments when calculating Head/Tail position");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_target_common(StructRNA *srna)
 {
   PropertyRNA *prop;
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "tar");
   RNA_def_property_ui_text(prop, "Target", "Target object");
@@ -852,6 +858,8 @@ static void rna_def_constraint_target_common(StructRNA *srna)
   RNA_def_property_string_sdna(prop, NULL, "subtarget");
   RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ...");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constrainttarget(BlenderRNA *brna)
@@ -864,6 +872,8 @@ static void rna_def_constrainttarget(BlenderRNA *brna)
   RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
   RNA_def_struct_sdna(srna, "bConstraintTarget");
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "tar");
   RNA_def_property_ui_text(prop, "Target", "Target object");
@@ -879,6 +889,8 @@ static void rna_def_constrainttarget(BlenderRNA *brna)
       prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update");
 
   /* space, flag and type still to do  */
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constrainttarget_bone(BlenderRNA *brna)
@@ -892,6 +904,8 @@ static void rna_def_constrainttarget_bone(BlenderRNA *brna)
   RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path");
   RNA_def_struct_sdna(srna, "bConstraintTarget");
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "tar");
   RNA_def_property_ui_text(prop, "Target", "Target armature");
@@ -913,6 +927,8 @@ static void rna_def_constrainttarget_bone(BlenderRNA *brna)
   RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_ui_text(prop, "Blend Weight", "Blending weight of this bone");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_childof(BlenderRNA *brna)
@@ -928,6 +944,8 @@ static void rna_def_constraint_childof(BlenderRNA *brna)
 
   rna_def_constraint_target_common(srna);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX);
   RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent");
@@ -985,6 +1003,8 @@ static void rna_def_constraint_childof(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_python(BlenderRNA *brna)
@@ -996,6 +1016,8 @@ static void rna_def_constraint_python(BlenderRNA *brna)
   RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation");
   RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data");
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
   RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
   RNA_def_property_struct_type(prop, "ConstraintTarget");
@@ -1021,6 +1043,8 @@ static void rna_def_constraint_python(BlenderRNA *brna)
   RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR);
   RNA_def_property_clear_flag(prop, PROP_EDITABLE);
   RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_armature_deform_targets(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1065,6 +1089,8 @@ static void rna_def_constraint_armature_deform(BlenderRNA *brna)
   RNA_def_struct_sdna_from(srna, "bArmatureConstraint", "data");
   RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
   RNA_def_property_collection_sdna(prop, NULL, "targets", NULL);
   RNA_def_property_struct_type(prop, "ConstraintTargetBone");
@@ -1095,6 +1121,8 @@ static void rna_def_constraint_armature_deform(BlenderRNA *brna)
                            "Use the current bone location for envelopes and choosing B-Bone "
                            "segments instead of rest position");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_kinematic(BlenderRNA *brna)
@@ -1121,6 +1149,8 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
 
   rna_def_constraint_target_common(srna);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
   RNA_def_property_range(prop, 0, 10000);
   RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations");
@@ -1240,6 +1270,8 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
   RNA_def_property_range(prop, 0.0, 100.f);
   RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_track_to(BlenderRNA *brna)
@@ -1266,6 +1298,8 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
 
   RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "reserved1");
   RNA_def_property_enum_items(prop, track_axis_items);
@@ -1283,6 +1317,8 @@ static void rna_def_constraint_track_to(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_locate_like(BlenderRNA *brna)
@@ -1300,6 +1336,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
 
   rna_def_constraint_target_common(srna);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X);
   RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location");
@@ -1334,6 +1372,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
   RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET);
   RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_rotate_like(BlenderRNA *brna)
@@ -1370,6 +1410,8 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
 
   rna_def_constraint_target_common(srna);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X);
   RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation");
@@ -1420,6 +1462,8 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Offset", "DEPRECATED: Add original rotation into copied rotation");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_size_like(BlenderRNA *brna)
@@ -1434,6 +1478,8 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
 
   rna_def_constraint_target_common(srna);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X);
   RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale");
@@ -1476,6 +1522,8 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
       "Additive",
       "Use addition instead of multiplication to combine scale (2.7 compatibility)");
   RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update");
+
+  RNA_define_lib_overridable(false);
 }
 
 static void rna_def_constraint_same_volume(BlenderRNA *brna)
@@ -1518,6 +1566,8 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna)
   RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data");
   RNA_def_struct_ui_icon(srna, ICON_CON_SAMEVOL);
 
+  RNA_define_lib_overridable(true);
+
   prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "free_axis");
   RNA_def_property_enum_items(prop, axis_items);
@@ -1535,6 +1585,8 @@ static void rna_def_constra

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list