Multires: Pass mesh instead of object

There is nothing we need from object in this case.
This commit is contained in:
Sergey Sharybin 2018-09-24 16:59:27 +02:00
parent 518451757e
commit a933293f11
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #56915, Selectability in Solid Xray Mode
Referenced by issue #56904, Crash when scaling particle emitter during animation playback
3 changed files with 8 additions and 8 deletions

View File

@ -130,7 +130,7 @@ bool multiresModifier_reshapeFromDeformModifier(
struct ModifierData *md);
bool multiresModifier_reshapeFromCCG(
struct MultiresModifierData *mmd,
struct Object *object,
struct Mesh *coarse_mesh,
struct SubdivCCG *subdiv_ccg);
/* Subdivision integration, defined in multires_subdiv.c */

View File

@ -426,8 +426,9 @@ void multires_force_update(Object *ob)
if (sculpt_session != NULL && sculpt_session->pbvh != NULL) {
PBVH *pbvh = sculpt_session->pbvh;
if (BKE_pbvh_type(pbvh) == PBVH_GRIDS) {
Mesh *mesh = ob->data;
multiresModifier_reshapeFromCCG(
sculpt_session->multires, ob, sculpt_session->subdiv_ccg);
sculpt_session->multires, mesh, sculpt_session->subdiv_ccg);
}
else {
/* NOTE: Disabled for until OpenSubdiv is enabled by default. */

View File

@ -420,7 +420,7 @@ typedef struct MultiresPropagateCornerData {
static void multires_reshape_propagate_prepare(
MultiresPropagateData *data,
Object *object,
Mesh *coarse_mesh,
const int reshape_level,
const int top_level)
{
@ -430,7 +430,6 @@ static void multires_reshape_propagate_prepare(
/* Nothing to do, reshape will happen on the whole grid content. */
return;
}
Mesh *coarse_mesh = object->data;
const int num_grids = coarse_mesh->totloop;
MDisps *mdisps = CustomData_get_layer(&coarse_mesh->ldata, CD_MDISPS);
MDisps *old_mdisps = MEM_dupallocN(mdisps);
@ -468,9 +467,10 @@ static void multires_reshape_propagate_prepare_from_mmd(
const bool use_render_params)
{
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Mesh *mesh = object->data;
const int level = multires_get_level(
scene_eval, object, mmd, use_render_params, true);
multires_reshape_propagate_prepare(data, object, level, mmd->totlvl);
multires_reshape_propagate_prepare(data, mesh, level, mmd->totlvl);
}
static void multires_reshape_propagate_corner_data(
@ -1070,10 +1070,9 @@ static void reshape_from_ccg_task(
bool multiresModifier_reshapeFromCCG(
MultiresModifierData *mmd,
Object *object,
Mesh *coarse_mesh,
SubdivCCG *subdiv_ccg)
{
Mesh *coarse_mesh = object->data;
CCGKey key;
BKE_subdiv_ccg_key_top_level(&key, subdiv_ccg);
/* Sanity checks. */
@ -1102,7 +1101,7 @@ bool multiresModifier_reshapeFromCCG(
/* Initialize propagation to higher levels. */
MultiresPropagateData propagate_data;
multires_reshape_propagate_prepare(
&propagate_data, object, key.level, mmd->totlvl);
&propagate_data, coarse_mesh, key.level, mmd->totlvl);
/* Threaded grids iteration. */
ParallelRangeSettings parallel_range_settings;
BLI_parallel_range_settings_defaults(&parallel_range_settings);