Fix T65878: "Bpy.ops.object.camera_add" doesn't take the rotation
authorPhilipp Oeser <info@graphics-engineer.com>
Mon, 17 Jun 2019 13:21:36 +0000 (15:21 +0200)
committerPhilipp Oeser <info@graphics-engineer.com>
Mon, 17 Jun 2019 14:09:00 +0000 (16:09 +0200)
argument into account

- if a rotation is given, always take it into account [which means
setting alignment to ALIGN_WORLD prior]
- caused by recent rB06fe2a5e0c5d

Reviewers: brecht

Maniphest Tasks: T65878

Differential Revision: https://developer.blender.org/D5085

source/blender/editors/object/object_add.c

index 99c3d7d..a7b4a18 100644 (file)
@@ -423,6 +423,8 @@ bool ED_object_add_generic_get_opts(bContext *C,
 
     if (RNA_struct_property_is_set(op->ptr, "rotation")) {
       *is_view_aligned = false;
+      RNA_property_enum_set(op->ptr, prop, ALIGN_WORLD);
+      alignment = ALIGN_WORLD;
     }
     else if (alignment_set) {
       *is_view_aligned = alignment == ALIGN_VIEW;