Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_remesh.c
| Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | static int voxel_remesh_exec(bContext *C, wmOperator *op) | ||||
| BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, &CD_MASK_MESH, true); | BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, &CD_MASK_MESH, true); | ||||
| if (mesh->flag & ME_REMESH_SMOOTH_NORMALS) { | if (mesh->flag & ME_REMESH_SMOOTH_NORMALS) { | ||||
| BKE_mesh_smooth_flag_set(ob->data, true); | BKE_mesh_smooth_flag_set(ob->data, true); | ||||
| } | } | ||||
| if (ob->mode == OB_MODE_SCULPT) { | if (ob->mode == OB_MODE_SCULPT) { | ||||
| BKE_sculpt_ensure_orig_mesh_data(CTX_data_scene(C), ob); | |||||
| ED_sculpt_undo_geometry_end(ob); | ED_sculpt_undo_geometry_end(ob); | ||||
| } | } | ||||
| BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); | WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 439 Lines • ▼ Show 20 Lines | |||||
| } eSymmetryAxes; | } eSymmetryAxes; | ||||
| typedef struct QuadriFlowJob { | typedef struct QuadriFlowJob { | ||||
| /* from wmJob */ | /* from wmJob */ | ||||
| struct Object *owner; | struct Object *owner; | ||||
| short *stop, *do_update; | short *stop, *do_update; | ||||
| float *progress; | float *progress; | ||||
| Scene *scene; | |||||
| int target_faces; | int target_faces; | ||||
| int seed; | int seed; | ||||
| bool use_mesh_symmetry; | bool use_mesh_symmetry; | ||||
| eSymmetryAxes symmetry_axes; | eSymmetryAxes symmetry_axes; | ||||
| bool use_preserve_sharp; | bool use_preserve_sharp; | ||||
| bool use_preserve_boundary; | bool use_preserve_boundary; | ||||
| bool use_mesh_curvature; | bool use_mesh_curvature; | ||||
| ▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | #endif | ||||
| if (qj->smooth_normals) { | if (qj->smooth_normals) { | ||||
| if (qj->use_mesh_symmetry) { | if (qj->use_mesh_symmetry) { | ||||
| BKE_mesh_calc_normals(ob->data); | BKE_mesh_calc_normals(ob->data); | ||||
| } | } | ||||
| BKE_mesh_smooth_flag_set(ob->data, true); | BKE_mesh_smooth_flag_set(ob->data, true); | ||||
| } | } | ||||
| if (ob->mode == OB_MODE_SCULPT) { | if (ob->mode == OB_MODE_SCULPT) { | ||||
| BKE_sculpt_ensure_orig_mesh_data(qj->scene, ob); | |||||
| ED_sculpt_undo_geometry_end(ob); | ED_sculpt_undo_geometry_end(ob); | ||||
| } | } | ||||
| BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | ||||
| *do_update = true; | *do_update = true; | ||||
| *stop = 0; | *stop = 0; | ||||
| } | } | ||||
| Show All 27 Lines | static void quadriflow_end_job(void *customdata) | ||||
| } | } | ||||
| } | } | ||||
| static int quadriflow_remesh_exec(bContext *C, wmOperator *op) | static int quadriflow_remesh_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| QuadriFlowJob *job = MEM_mallocN(sizeof(QuadriFlowJob), "QuadriFlowJob"); | QuadriFlowJob *job = MEM_mallocN(sizeof(QuadriFlowJob), "QuadriFlowJob"); | ||||
| job->owner = CTX_data_active_object(C); | job->owner = CTX_data_active_object(C); | ||||
| job->scene = CTX_data_scene(C); | |||||
| job->target_faces = RNA_int_get(op->ptr, "target_faces"); | job->target_faces = RNA_int_get(op->ptr, "target_faces"); | ||||
| job->seed = RNA_int_get(op->ptr, "seed"); | job->seed = RNA_int_get(op->ptr, "seed"); | ||||
| job->use_mesh_symmetry = RNA_boolean_get(op->ptr, "use_mesh_symmetry"); | job->use_mesh_symmetry = RNA_boolean_get(op->ptr, "use_mesh_symmetry"); | ||||
| job->use_preserve_sharp = RNA_boolean_get(op->ptr, "use_preserve_sharp"); | job->use_preserve_sharp = RNA_boolean_get(op->ptr, "use_preserve_sharp"); | ||||
| job->use_preserve_boundary = RNA_boolean_get(op->ptr, "use_preserve_boundary"); | job->use_preserve_boundary = RNA_boolean_get(op->ptr, "use_preserve_boundary"); | ||||
| ▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines | |||||