Bueno, he conseguido aplicar un material a cada cubo diferente ( que no es lo que quiero) pero el color no lo ajusta....
xsi = Application
def Createcolumnas(altura, size, offset, bevel, color):
for x in range(0,altura,color):
for z in range(0,altura,color):
for y in range(1,altura,color):
cubo = xsi.ActiveSceneRoot.AddGeometry("Cube", "MeshSurface", "MiCubo")
cubo.length.Value = size
xsi.ApplyTopoOp("BevelComponent", cubo.Name + ".edge[*]", "siUnspecified", "siPersistentOperation", "")
xsi.SetValue(cubo.Name + ".polymsh.bevelop.ratio", bevel, "")
xsi.SelectAllUsingFilter("PolygonMesh", "siCheckComponentVisibility", "", "")
xsi.ApplyShader("Phong", "", "", "", "siLetLocalMaterialsOverlap")
xsi.SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.blue", 0, "")
xsi.SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.green", 0, "")
xsi.SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.red", 1, "")
cubo.Kinematics.Global.PosX.Value = (size + offset) * x
cubo.Kinematics.Global.PosZ.Value = (size + offset) * z
cubo.Kinematics.Global.PosY.Value = (size + offset) * y
columnas = int(xsi.XSIInputBox("Cantidad de Columnas:"))
Createcolumnas(columnas, 1, 1, 0.5, 1)