minor improvements

- calc normals only check flag when needed.
- keymap, dont get name unless its needed.
- keymap, avoid property lookup.
- idprop debug print, include pointer, helpful for troubleshooting.
This commit is contained in:
2013-07-09 00:13:17 +00:00
parent 6c0d97fbcf
commit 14ab39c5e0
4 changed files with 8 additions and 5 deletions

View File

@@ -1761,7 +1761,7 @@ float BM_mesh_calc_volume(BMesh *bm, bool is_signed)
/**
* TODO (as we need)
* - option to walk over edges.
* - option to walk over faces by verts.
* - option to walk over non manifold edges.
*
* \param bm the BMesh.

View File

@@ -166,7 +166,10 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
for (j = 0; j < fg_len; j++) {
faces_grp[j] = faces_arr[groups_array[fg_sta + j]];
is_calc |= BMO_elem_flag_test_bool(bm, faces_grp[j], FACE_FLAG);
if (is_calc == false) {
is_calc = BMO_elem_flag_test_bool(bm, faces_grp[j], FACE_FLAG);
}
}
if (is_calc) {

View File

@@ -3018,16 +3018,16 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
/* recurse for nested properties */
if (RNA_property_type(prop) == PROP_POINTER) {
PointerRNA propptr = RNA_property_pointer_get(ptr, prop);
const char *name = RNA_property_ui_name(prop);
if (propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
const char *name = RNA_property_ui_name(prop);
template_keymap_item_properties(layout, name, &propptr);
continue;
}
}
/* add property */
uiItemR(flow, ptr, RNA_property_identifier(prop), 0, NULL, ICON_NONE);
uiItemFullR(flow, ptr, prop, -1, 0, 0, NULL, ICON_NONE);
}
RNA_STRUCT_END;
}

View File

@@ -1531,7 +1531,7 @@ void IDP_spit(IDProperty *prop)
ret_str = PyObject_Repr(ret_dict);
Py_DECREF(ret_dict);
printf("IDProperty: %s\n", _PyUnicode_AsString(ret_str));
printf("IDProperty(%p): %s\n", prop, _PyUnicode_AsString(ret_str));
Py_DECREF(ret_str);