Hi,
In this python script,i create a chessboard:
import bpy
cubeblanc= bpy.data.objects["CubeBlanc"]. #with white material
cubenoir= bpy.data.objects["CubeNoir"]. #with black material
for i in range(0,10):
for j in range(0,10):
blanc = bpy.data.objects.new('blanc', cubeblanc.data)
blanc.location.x = 4*i
blanc.location.y= 4*j
blanc.scale.z=0.1
bpy.data.collections["Collection"].objects.link(blanc)
blanc.select_set(True)
noir = bpy.data.objects.new('noir', cubenoir.data)
noir.location.x = 4*i+2
noir.location.y= 4*j
noir.scale.z=0.1
bpy.data.collections["Collection"].objects.link(noir)
noir.select_set(True)
blanc = bpy.data.objects.new('blanc', cubeblanc.data)
blanc.location.x = 4*i+2
blanc.location.y= 4*j+2
blanc.scale.z=0.1
bpy.data.collections["Collection"].objects.link(blanc)
blanc.select_set(True)
noir = bpy.data.objects.new('noir', cubenoir.data)
noir.location.x = 4*i
noir.location.y= 4*j+2
noir.scale.z=0.1
bpy.data.collections["Collection"].objects.link(noir)
noir.select_set(True)
for ob in bpy.context.scene.objects:
if ob.type == 'MESH':
ob.select = True
bpy.context.scene.objects.active = ob
else:
ob.select = False
bpy.ops.object.join()
Now,i must create in python a new object named “chessboard” bringing together the “white” and “black” objects;
So,what lines to this script should I add?
thanks
thanks