Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_constraint.c
| Show First 20 Lines • Show All 950 Lines • ▼ Show 20 Lines | static void rna_def_constraint_childof(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent"); | RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | ||||
| prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ); | ||||
| RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent"); | RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | ||||
| prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SET_INVERSE); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix"); | |||||
sybren: I think it would be a nice touch to mention that it's automatically set to false when the… | |||||
| RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | |||||
| prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX); | prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX); | ||||
| RNA_def_property_float_sdna(prop, NULL, "invmat"); | RNA_def_property_float_sdna(prop, NULL, "invmat"); | ||||
| RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); | RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before"); | 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"); | |||||
| } | } | ||||
| static void rna_def_constraint_python(BlenderRNA *brna) | static void rna_def_constraint_python(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "PythonConstraint", "Constraint"); | srna = RNA_def_struct(brna, "PythonConstraint", "Constraint"); | ||||
| ▲ Show 20 Lines • Show All 2,245 Lines • ▼ Show 20 Lines | void RNA_def_constraint(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Proxy Local", | "Proxy Local", | ||||
| "Constraint was added in this proxy instance (i.e. did not belong to source Armature)"); | "Constraint was added in this proxy instance (i.e. did not belong to source Armature)"); | ||||
| prop = RNA_def_property(srna, "use_start_transform", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_START_MATRIX); | |||||
| RNA_def_property_ui_icon(prop, ICON_LINKED, -1); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "Use Start Transform", | |||||
| "Evaluate this constraint as if it was the first one in the stack, then use " | |||||
| "influence to blend with the output of the preceeding constraints"); | |||||
| RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); | |||||
| /* values */ | /* values */ | ||||
| prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "enforce"); | RNA_def_property_float_sdna(prop, NULL, "enforce"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Influence", "Amount of influence constraint will have on the final solution"); | prop, "Influence", "Amount of influence constraint will have on the final solution"); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update"); | RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update"); | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||
I think it would be a nice touch to mention that it's automatically set to false when the inverse matrix has been recomputed. I often see this in datasheets of microcontrollers, and it really helps me understand what's going on.