📋 Metadata
- Author: roaoao
- Date: 2017-05-20 21:46:54
- Type:
answer - Reply to: post_00679
💬 Content
Leafar:
But why the other object is still selected??
Updated script:
from .bl_utils import uname; new_name = uname(D.objects, C.active_object.name); bpy.ops.mesh.separate(type='SELECTED'); bpy.ops.object.mode_set(mode='OBJECT'); bpy.ops.object.select_all(action='DESELECT'); C.scene.objects.active = D.objects[new_name]; D.objects[new_name].select = True; bpy.ops.object.mode_set(mode='EDIT')
Leafar:
And now I realize that the perfect script is duplicating first the selection of the faces, verts or edges.
Don´t you think?
Yes, both tools can be useful. Use this code instead:
from .bl_utils import uname; new_name = uname(D.objects, C.active_object.name); bpy.ops.mesh.duplicate(); bpy.ops.mesh.separate(type='SELECTED'); bpy.ops.object.mode_set(mode='OBJECT'); bpy.ops.object.select_all(action='DESELECT'); C.scene.objects.active = D.objects[new_name]; D.objects[new_name].select = True; bpy.ops.object.mode_set(mode='EDIT')