patch [#23316] Fix bug that doesn't show "X:" "Y:" "Z:" for vectors with length
patch [#23317] Changed some operators' RNA to accept lengths by Lorenzo Tozzi (oni_niubbo) with the minor change to use XYZ subtype rather then LENGTH.
This commit is contained in:
@@ -4109,7 +4109,7 @@ void CURVE_OT_spin(wmOperatorType *ot)
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
|
||||
}
|
||||
|
||||
@@ -4278,7 +4278,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at.", -1e4, 1e4);
|
||||
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at.", -1e4, 1e4);
|
||||
}
|
||||
|
||||
/***************** extrude operator **********************/
|
||||
|
@@ -1032,7 +1032,7 @@ void MESH_OT_spin(wmOperatorType *ot)
|
||||
RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates");
|
||||
RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f);
|
||||
|
||||
RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
|
||||
|
||||
}
|
||||
@@ -1139,7 +1139,7 @@ void MESH_OT_screw(wmOperatorType *ot)
|
||||
RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 256);
|
||||
RNA_def_int(ot->srna, "turns", 1, 0, INT_MAX, "Turns", "Turns", 0, 256);
|
||||
|
||||
RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX);
|
||||
}
|
||||
|
||||
|
@@ -176,7 +176,7 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object.", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object.", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", -FLT_MAX, FLT_MAX);
|
||||
|
||||
prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
|
||||
|
@@ -465,7 +465,7 @@ void TRANSFORM_OT_translate(struct wmOperatorType *ot)
|
||||
ot->cancel = transform_cancel;
|
||||
ot->poll = ED_operator_areaactive;
|
||||
|
||||
RNA_def_float_vector(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float_vector_xyz(ot->srna, "value", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
|
||||
|
||||
Transform_Properties(ot, P_CONSTRAINT|P_PROPORTIONAL|P_MIRROR|P_ALIGN_SNAP);
|
||||
}
|
||||
|
@@ -90,6 +90,7 @@ void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc);
|
||||
|
||||
PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
|
||||
PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
|
||||
PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
|
||||
PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
|
||||
PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
|
||||
PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value,
|
||||
|
@@ -732,7 +732,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
|
||||
/* get string to use for array index */
|
||||
if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE))
|
||||
return quatitem[index];
|
||||
else if((index < 4) && ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
|
||||
else if((index < 4) && ELEM7(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
|
||||
return vectoritem[index];
|
||||
else if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA))
|
||||
return coloritem[index];
|
||||
|
@@ -2201,6 +2201,17 @@ PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identi
|
||||
return prop;
|
||||
}
|
||||
|
||||
PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
|
||||
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
prop= RNA_def_float_vector(cont_, identifier, len, default_value, hardmin, hardmax, ui_name, ui_description, softmin, softmax);
|
||||
prop->subtype = PROP_XYZ;
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value,
|
||||
float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
|
||||
{
|
||||
|
Reference in New Issue
Block a user