Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/multires_reshape.c
| Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | void multiresModifier_base_apply(struct Depsgraph *depsgraph, | ||||
| * multires they need to be re-evaluated for the new base mesh. */ | * multires they need to be re-evaluated for the new base mesh. */ | ||||
| multires_reshape_apply_base_refine_from_deform(&reshape_context); | multires_reshape_apply_base_refine_from_deform(&reshape_context); | ||||
| multires_reshape_object_grids_to_tangent_displacement(&reshape_context); | multires_reshape_object_grids_to_tangent_displacement(&reshape_context); | ||||
| multires_reshape_context_free(&reshape_context); | multires_reshape_context_free(&reshape_context); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | |||||
| /** \name Versioning: Convert to Catmull-Clark subdivision type | |||||
| * \{ */ | |||||
| void multiresModifier_convert_to_catmull_clark(Object *object, MultiresModifierData *mmd) | |||||
| { | |||||
| if (!mmd->simple) { | |||||
| return; | |||||
| } | |||||
| multires_force_sculpt_rebuild(object); | |||||
| /* Store the grids displacement in object space against the simple limit surface. */ | |||||
| MultiresReshapeContext reshape_context; | |||||
| if (!multires_reshape_context_create_from_subdivide( | |||||
| &reshape_context, object, mmd, mmd->totlvl)) { | |||||
| return; | |||||
| } | |||||
| multires_reshape_store_original_grids(&reshape_context); | |||||
| multires_reshape_assign_final_coords_from_mdisps(&reshape_context); | |||||
| multires_reshape_context_free(&reshape_context); | |||||
| /* Disable simple mode. */ | |||||
| mmd->simple = false; | |||||
| /* Calculate the new tangent displacement against the new Catmull-Clark limit surface. */ | |||||
| if (!multires_reshape_context_create_from_subdivide( | |||||
| &reshape_context, object, mmd, mmd->totlvl)) { | |||||
| return; | |||||
| } | |||||
| multires_reshape_object_grids_to_tangent_displacement(&reshape_context); | |||||
| multires_reshape_context_free(&reshape_context); | |||||
| } | |||||
| /** \} */ | |||||