Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 27 Sep 2018 01:53:08 +0000 (11:53 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 27 Sep 2018 01:53:08 +0000 (11:53 +1000)
1  2 
source/blender/editors/mesh/editmesh_extrude_spin.c

@@@ -139,33 -122,24 +139,48 @@@ static int edbm_spin_invoke(bContext *C
                }
        }
  
 -      return edbm_spin_exec(C, op);
 +
 +#ifdef USE_GIZMO
 +      /* Start with zero angle, drag out the value. */
 +      prop = RNA_struct_find_property(op->ptr, "angle");
 +      if (!RNA_property_is_set(op->ptr, prop)) {
 +              RNA_property_float_set(op->ptr, prop, 0.0f);
 +      }
 +#endif
 +
 +      int ret = edbm_spin_exec(C, op);
 +
 +#ifdef USE_GIZMO
 +      if (ret & OPERATOR_FINISHED) {
 +              /* Setup gizmos */
 +              if (v3d && ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0)) {
 +                      wmGizmoGroupType *gzgt = WM_gizmogrouptype_find("MESH_GGT_spin_redo", false);
 +                      if (!WM_gizmo_group_type_ensure_ptr(gzgt)) {
 +                              struct Main *bmain = CTX_data_main(C);
 +                              WM_gizmo_group_type_reinit_ptr(bmain, gzgt);
 +                      }
 +              }
 +      }
 +#endif
 +
 +      return ret;
  }
  
+ static bool edbm_spin_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
+ {
+       const char *prop_id = RNA_property_identifier(prop);
+       const bool dupli = RNA_boolean_get(op->ptr, "dupli");
+       if (dupli) {
+               if (STREQ(prop_id, "use_auto_merge") ||
+                   STREQ(prop_id, "use_normal_flip"))
+               {
+                       return false;
+               }
+       }
+       return true;
+ }
  void MESH_OT_spin(wmOperatorType *ot)
  {
        PropertyRNA *prop;