I want to select Cube.001,Cube.002,Cube.003,Cube.004 at the same time. trying this script
bpy.data.objects["Cube.001","Cube.002","Cube.003","Cube.004"].select_set(state=True)
But is not working. What should i do to select this four objects ?
I want to select Cube.001,Cube.002,Cube.003,Cube.004 at the same time. trying this script
bpy.data.objects["Cube.001","Cube.002","Cube.003","Cube.004"].select_set(state=True)
But is not working. What should i do to select this four objects ?
If you want to select all objects at once, then use: bpy.ops.object.select_all(action='SELECT') (select_all operator). In case you want to only select a subset of objects you have to iterate through the list of scene objects (bpy.context.scene.objects) or through the list of objects in the blend-file:
Blender 2.7x
# Deselect all objects
bpy.ops.object.select_all(action='DESELECT')
for o in bpy.data.objects:
# Check for given object names
if o.name in ("Cube.026","Cube.027","Cube.028"):
o.select = True
Blender 2.8x
# Deselect all objects
bpy.ops.object.select_all(action='DESELECT')
for o in bpy.data.objects:
# Check for given object names
if o.name in ("Cube.026","Cube.027","Cube.028"):
o.select_set(True)
for o in ("Cube.026", "Cube.027","Cube.028","Cube.029","Cube.030","Cube.031"): obj = bpy.context.scene.objects.get(o) if obj: obj.select_set(True)
– Avi Aninda Sep 05 '19 at 09:50