I have the following script, which I was hoping would add a basic red material to my spheres as they are sequentially created. Unfortunately, the script does not work. Could someone please help me tweak the script to make it function as desired?
import bpy, csv bpy.ops.script.python_file_run(filepath="C:\\Program Files\\Blender Foundation\\Blender\\2.79\\scripts\\presets\\units_length\\meters.py") bpy.ops.mesh.primitive_plane_add(radius=50,view_align=False, enter_editmode=False, location=(0, 0, 0)) fp = "C:/Blender/Spheres.csv" with open( fp ) as csvfile: rdr = csv.reader(csvfile, delimiter=';') for i, row in enumerate( rdr ): if i == 0: continue # Skip column title # Generate UV sphere at x = row0, y = row1, z = row2, and radius = row3. bpy.ops.mesh.primitive_uv_sphere_add(size = float(row), location = float(row),float(row),float(row))) bpy.ops.material.new() bpy.context.object.active_material.diffuse_color = (1, 0, 0)