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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-04-21 14:14:26 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-04-21 14:14:26 +0300
commit2e3f072d5d8a99ccbd23a25766dfebf3067e6162 (patch)
tree2acdb566df2b0618df7dae83100aaf2b69eed9e3
parent183e3f6bb93e97a281a9bb2baf168631163577d0 (diff)
parentb72d9216f12edb37e79ce2fe17c72bb5a072db6a (diff)
Merge branch 'blender-v2.93-release'
-rw-r--r--source/blender/editors/space_view3d/view3d_placement.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_placement.c b/source/blender/editors/space_view3d/view3d_placement.c
index c7a2c580f36..1afdcdd2993 100644
--- a/source/blender/editors/space_view3d/view3d_placement.c
+++ b/source/blender/editors/space_view3d/view3d_placement.c
@@ -1472,10 +1472,27 @@ static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEve
RNA_float_set_array(&op_props, "rotation", rotation);
RNA_float_set_array(&op_props, "location", location);
RNA_float_set_array(&op_props, "scale", scale);
- /* Always use default size here. */
+
+ /* Always use the defaults here since desired bounds have been set interactively, it does
+ * not make sense to use a different values from a previous command. */
if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CUBE) {
RNA_float_set(&op_props, "size", 2.0f);
}
+ if (ELEM(ipd->primitive_type,
+ PLACE_PRIMITIVE_TYPE_CYLINDER,
+ PLACE_PRIMITIVE_TYPE_SPHERE_UV,
+ PLACE_PRIMITIVE_TYPE_SPHERE_ICO)) {
+ RNA_float_set(&op_props, "radius", 1.0f);
+ }
+ if (ELEM(
+ ipd->primitive_type, PLACE_PRIMITIVE_TYPE_CYLINDER, PLACE_PRIMITIVE_TYPE_CONE)) {
+ RNA_float_set(&op_props, "depth", 2.0f);
+ }
+ if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CONE) {
+ RNA_float_set(&op_props, "radius1", 1.0f);
+ RNA_float_set(&op_props, "radius2", 0.0f);
+ }
+
WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &op_props);
WM_operator_properties_free(&op_props);
}