Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_add.c
| Show First 20 Lines • Show All 2,680 Lines • ▼ Show 20 Lines | else if (ob->type == OB_MESH) { | ||||
| /* make new mesh data from the original copy */ | /* make new mesh data from the original copy */ | ||||
| /* note: get the mesh from the original, not from the copy in some | /* note: get the mesh from the original, not from the copy in some | ||||
| * cases this doesn't give correct results (when MDEF is used for eg) | * cases this doesn't give correct results (when MDEF is used for eg) | ||||
| */ | */ | ||||
| Scene *scene_eval = (Scene *)DEG_get_evaluated_id(depsgraph, &scene->id); | Scene *scene_eval = (Scene *)DEG_get_evaluated_id(depsgraph, &scene->id); | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &CD_MASK_MESH); | Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &CD_MASK_MESH); | ||||
| me_eval = BKE_mesh_copy_for_eval(me_eval, false); | me_eval = BKE_mesh_copy_for_eval(me_eval, false); | ||||
| BKE_mesh_edges_set_draw_render(me_eval); | |||||
campbellbarton: This isn't correct AFAICS, the edges should draw based on edge-angle, see… | |||||
| BKE_mesh_nomain_to_mesh(me_eval, newob->data, newob, &CD_MASK_MESH, true); | BKE_mesh_nomain_to_mesh(me_eval, newob->data, newob, &CD_MASK_MESH, true); | ||||
| BKE_object_free_modifiers(newob, 0); /* after derivedmesh calls! */ | BKE_object_free_modifiers(newob, 0); /* after derivedmesh calls! */ | ||||
| } | } | ||||
| else if (ob->type == OB_FONT) { | else if (ob->type == OB_FONT) { | ||||
| ob->flag |= OB_DONE; | ob->flag |= OB_DONE; | ||||
| if (keep_original) { | if (keep_original) { | ||||
| basen = duplibase_for_convert(bmain, depsgraph, scene, view_layer, base, NULL); | basen = duplibase_for_convert(bmain, depsgraph, scene, view_layer, base, NULL); | ||||
| ▲ Show 20 Lines • Show All 760 Lines • Show Last 20 Lines | |||||
This isn't correct AFAICS, the edges should draw based on edge-angle, see bmesh_quick_edgedraw_flag, we could have a function that does this, it could run here, after applying transform too (and a few other operations that change object data in object mode).
Even so, this is an improvement IMHO from the current state, this line should comment that full edge draw calculation should ideally be performed.