Modify Points of a Multires Modifier using Python

Hi,
Is it possible to modify points of a Multires Modifier through Python? I can get points from the Multires Modifier but I cannot modify them. Here is my simple test of a Cube:

import bpy


bpy.ops.mesh.primitive_cube_add(enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
bpy.ops.object.modifier_add(type='MULTIRES')
bpy.ops.object.multires_subdivide(modifier="Multires", mode='CATMULL_CLARK')
bpy.ops.object.multires_subdivide(modifier="Multires", mode='CATMULL_CLARK')

active_obj = bpy.context.active_object

depsgraph = bpy.context.evaluated_depsgraph_get()
multires_mesh = depsgraph.objects[active_obj.name].data

# test to modify
print(len(multires_mesh.vertices))  # It Will be 98 Points. Multires!
for v in multires_mesh.vertices:
    v.co[0] *= 2.0

#depsgraph.update()
active_obj.data.update()

But if you run this code no points will be modified.

I have one answer here https://blender.stackexchange.com/questions/214957/modify-points-of-a-multires-modifier-through-python
But all multires data will be reverted back if I go to EditMode then to ObjectMode.

It’s so sad that it’s not possible to modify multires sculpt with python. I would create some good addons for sculpting. (

1 Like