Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/paint.c
| Show First 20 Lines • Show All 1,672 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| /* Update after mesh evaluation in the dependency graph, to rebuild PBVH or | /* Update after mesh evaluation in the dependency graph, to rebuild PBVH or | ||||
| * other data when modifiers change the mesh. */ | * other data when modifiers change the mesh. */ | ||||
| Object *ob_orig = DEG_get_original_object(ob_eval); | Object *ob_orig = DEG_get_original_object(ob_eval); | ||||
| Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); | Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval); | ||||
| BLI_assert(me_eval != NULL); | BLI_assert(me_eval != NULL); | ||||
| sculpt_update_object(depsgraph, ob_orig, me_eval, false, false, false); | /* This request the creation of connectivity info for meshes as some brushes and tools may | ||||
| * request the creation of a color layer, which rebuilds the PBVH and deletes the previous pmap | |||||
| * while the tool is executing. */ | |||||
| sculpt_update_object(depsgraph, ob_orig, me_eval, true, false, false); | |||||
| } | } | ||||
| void BKE_sculpt_update_object_for_edit( | void BKE_sculpt_update_object_for_edit( | ||||
sergey: This is a weird semantic. Ensure is "make sure", "guarantee". Conditional behavior based on… | |||||
| Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors) | Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors) | ||||
| { | { | ||||
| /* Update from sculpt operators and undo, to update sculpt session | /* Update from sculpt operators and undo, to update sculpt session | ||||
| * and PBVH after edits. */ | * and PBVH after edits. */ | ||||
| Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); | Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_orig); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_orig); | ||||
| Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &CD_MASK_BAREMESH); | Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &CD_MASK_BAREMESH); | ||||
| ▲ Show 20 Lines • Show All 267 Lines • Show Last 20 Lines | |||||
This is a weird semantic. Ensure is "make sure", "guarantee". Conditional behavior based on experimental feature set enabled does not fit this definition.
Consider something like this instead:
/* Create new color layer on object if it doesn't have one and if experimental feature set has sculpt vertex color enabled. * Returns truth if new layer has been added, false otherwise. */ bool BKE_sculpt_color_layer_create_if_needed(Object *object) { }P.S. After reading the rest of the patch, I don't see where the return value is used. Is still fine to have it, but can as well replace with void.