Fix T55877: Crash snapping non-edit-mesh to grid
This commit is contained in:
@@ -390,14 +390,12 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
|
||||
|
||||
/* for new/open operators */
|
||||
void UI_context_active_but_prop_get_templateID(
|
||||
bContext *C,
|
||||
PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
bContext *C,
|
||||
PointerRNA *r_ptr, PropertyRNA **r_prop)
|
||||
{
|
||||
TemplateID *template_ui;
|
||||
uiBut *but = UI_context_active_but_get(C);
|
||||
|
||||
memset(r_ptr, 0, sizeof(*r_ptr));
|
||||
*r_prop = NULL;
|
||||
|
||||
if (but && but->func_argN) {
|
||||
template_ui = but->func_argN;
|
||||
|
||||
@@ -92,15 +92,6 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||
obedit = objects[ob_index];
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
|
||||
if ((em->bm->totvertsel == 0) &&
|
||||
(em->bm->totedgesel == 0) &&
|
||||
(em->bm->totfacesel == 0))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ED_transverts_check_obedit(obedit)) {
|
||||
ED_transverts_create_from_obedit(&tvs, obedit, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user