go edit mode func

gpv2
Pullusb 2022-11-10 18:51:00 +01:00
parent a021535b3f
commit ef566c494f
1 changed files with 11 additions and 1 deletions

View File

@ -1101,3 +1101,13 @@ def create_follow_path_constraint(ob, curve, follow_curve=False):
# print('const.forward_axis: ', const.forward_axis) # print('const.forward_axis: ', const.forward_axis)
# const.use_curve_follow = True # const.use_curve_follow = True
# return curve, const # return curve, const
def go_edit_mode(ob, context=None):
'''set mode to object, set passed obhject as active and go Edit'''
context = context or bpy.context
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
ob.select_set(True)
context.view_layer.objects.active = ob
bpy.ops.object.mode_set(mode='EDIT', toggle=False)