Mesh: Add utility to calculate deform modifier up to index
Intention is to be used to create mesh at the state which is an input to the multires modifier.
This commit is contained in:
@@ -87,6 +87,12 @@ struct Mesh *mesh_create_eval_final_view(struct Depsgraph *depsgraph,
|
||||
struct Object *ob,
|
||||
const struct CustomData_MeshMasks *dataMask);
|
||||
|
||||
struct Mesh *mesh_create_eval_final_view_index(struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
struct Object *ob,
|
||||
const struct CustomData_MeshMasks *dataMask,
|
||||
int index);
|
||||
|
||||
struct Mesh *mesh_create_eval_no_deform(struct Depsgraph *depsgraph,
|
||||
struct Scene *scene,
|
||||
struct Object *ob,
|
||||
|
||||
@@ -2013,6 +2013,27 @@ Mesh *mesh_create_eval_final_view(Depsgraph *depsgraph,
|
||||
return final;
|
||||
}
|
||||
|
||||
Mesh *mesh_create_eval_final_view_index(Depsgraph *depsgraph,
|
||||
Scene *scene,
|
||||
Object *ob,
|
||||
const CustomData_MeshMasks *dataMask,
|
||||
int index)
|
||||
{
|
||||
Mesh *final;
|
||||
|
||||
/* XXX hack
|
||||
* psys modifier updates particle state when called during dupli-list generation,
|
||||
* which can lead to wrong transforms. This disables particle system modifier execution.
|
||||
*/
|
||||
ob->transflag |= OB_NO_PSYS_UPDATE;
|
||||
|
||||
mesh_calc_modifiers(depsgraph, scene, ob, 1, false, dataMask, index, false, false, NULL, &final);
|
||||
|
||||
ob->transflag &= ~OB_NO_PSYS_UPDATE;
|
||||
|
||||
return final;
|
||||
}
|
||||
|
||||
Mesh *mesh_create_eval_no_deform(Depsgraph *depsgraph,
|
||||
Scene *scene,
|
||||
Object *ob,
|
||||
|
||||
Reference in New Issue
Block a user