# How to import a 3d object by csv file

I'm new to Blender and I'm trying to create a 3d scene starting from a csv file. I explain my problem: I have some 3d objects that I append in the scene with this function:

import bpy

bpy.ops.wm.append(


stadium is the 3d element that I have to put in the virtual scene. If I create a csv file like this:

name; path

cinema; directory= "C:/Users/Valentina/Desktop/ku/cinema.blend\\Object\\" , filepath= "cinema.blend" , filename= "cinema"

...
...


Will I be able to import the 3d object in the scene by reading the csv file? For example:

import csv
with open ('my_file.csv', 'r') as f:
for row in r:
bpy.ops.wm.append(row[1])


Am I totally wrong?

• The CSV seems to be broken. Your file looks like it uses semicolon-space as a separator first, and then comma-space. You also use equals-space, making it even harder to parse this file. – dr. Sybren Feb 27 '17 at 12:28

With a text file like this:

test1;E:\yourpath\file1.blend\Object\;Cube
test2;E:\yourpath\file2.blend\Object\;Sphere


Where:

• First field: a name
• Second field: the complete path to your object
• Third field: your object name

You can:

import bpy
import csv

textFile = 'E:\\Blender\\yourpath\\import.txt'

with open( textFile, 'r' ) as file: