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:
		@@ -1761,7 +1761,7 @@ float BM_mesh_calc_volume(BMesh *bm, bool is_signed)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * TODO (as we need)
 | 
					 * TODO (as we need)
 | 
				
			||||||
 * - option to walk over edges.
 | 
					 * - option to walk over faces by verts.
 | 
				
			||||||
 * - option to walk over non manifold edges.
 | 
					 * - option to walk over non manifold edges.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * \param bm  the BMesh.
 | 
					 * \param bm  the BMesh.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -166,7 +166,10 @@ void bmo_recalc_face_normals_exec(BMesh *bm, BMOperator *op)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		for (j = 0; j < fg_len; j++) {
 | 
							for (j = 0; j < fg_len; j++) {
 | 
				
			||||||
			faces_grp[j] = faces_arr[groups_array[fg_sta + 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) {
 | 
							if (is_calc) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3018,16 +3018,16 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
 | 
				
			|||||||
		/* recurse for nested properties */
 | 
							/* recurse for nested properties */
 | 
				
			||||||
		if (RNA_property_type(prop) == PROP_POINTER) {
 | 
							if (RNA_property_type(prop) == PROP_POINTER) {
 | 
				
			||||||
			PointerRNA propptr = RNA_property_pointer_get(ptr, prop);
 | 
								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)) {
 | 
								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);
 | 
									template_keymap_item_properties(layout, name, &propptr);
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* add property */
 | 
							/* 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;
 | 
						RNA_STRUCT_END;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1531,7 +1531,7 @@ void IDP_spit(IDProperty *prop)
 | 
				
			|||||||
		ret_str = PyObject_Repr(ret_dict);
 | 
							ret_str = PyObject_Repr(ret_dict);
 | 
				
			||||||
		Py_DECREF(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);
 | 
							Py_DECREF(ret_str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user