I have a Python script that's recursively parenting children objects to parents. I can use bpy.ops.object.parent_set(), which produces the desired outcome but is too slow for what I'm doing.
Another solution I found was to not call bpy.ops, but rather to set the parent directly, as outlined in this answer. Basically it proposes to do this kind of thing:
childObject.parent = parentObject
childObject.matrix_parent_inverse = parentObject.matrix_world.inverted()
This works really great except for that it requires a call to bpy.context.evaluated_depsgraph_get().update() first so that the parentObject's matrix_world matrix actually is correct. Although this approach is significantly faster than calling bpy.ops, it still requires a dependency graph update when it seems that all I really need is to update the parent's the matrix_world and nothing else.
Is there a way to only update the matrix_world without calling bpy.context.evaluated_depsgraph_get().update() ?
Thanks!