Hi,
I have a Microsoft Excel spreadsheet file of X,Y,Z coordinates and would like to import them into Softimage 2015 to create a linear curve. (Linear curves are the ones you can create when you go into the Model panel and press Create>Curve>Linear). Do you know how I can do this?
Perhaps something with Softimage's spreadsheet view? Or perhaps something with the Edit > Info Geometry section? (because when you create a curve, select it, then go into the Edit > Info Geometry section, you can see the curve's points.) I've tried these things but have not succeeded yet.
Thanks in advance
Creating a Linear Curve by Importing Spreadsheet Coordinates
-
Orange Apple
- Posts: 4
- Joined: 25 May 2016, 18:55
-
Draise
- Posts: 894
- Joined: 09 Oct 2012, 18:48
- Skype: ondraise
- Location: Colombia
Re: Creating a Linear Curve by Importing Spreadsheet Coordinates
You may need to convert your excel data into python or javascript and load it into SI from there to work with it? I also have had the same question - wondering how to build arrays from Excel data.
In Blender you can pull data from CSV files if needs be, which Excel can spit out.
I assume SI could????
In Blender you can pull data from CSV files if needs be, which Excel can spit out.
I assume SI could????
-
Orange Apple
- Posts: 4
- Joined: 25 May 2016, 18:55
Re: Creating a Linear Curve by Importing Spreadsheet Coordinates
Hi,
I found the answer. I used Python in the script editor:
import csv
Application.SICreateCurve("NameOfObject(For Use in Softimage)", 1, 1)
with open('C:\Users\_____\Desktop\FileName.csv', 'rb') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in spamreader:
Application.SIAddPointOnCurveAtEnd("NameOfObject(For Use in Softimage)", row[0], row[1], row[2], False, 0, "")
#print str(row[0])+" "+str(row[1])+" "+str(row[2])
csvfile.close()
Notes:
-Customize the filepath, the name of the file (eg filename.csv) (make sure the spreadsheet is saved as a .csv file), and customize the NameOfObject(For Use in Softimage) fields as well
-the row[number] represents the number of columns of data that are in the spreadsheet (I used XYZ coordinates so I had 3)
-if you delete the # in front of the #print... , you can display the numbers that work
-I found that if you import large coordinates, some of the coordinates may not be added to the curve
-This code is for creating a linear curve, which is shown by the "...1, 1)" part. To find out how to make a different type of curve, Go to the create panel and press Curve>Create Curve by CVs (for example) and then look at the numbers that are shown by the reader thing on the bottom-left/middle of the screen (to the left of the script editor button)
I found the answer. I used Python in the script editor:
import csv
Application.SICreateCurve("NameOfObject(For Use in Softimage)", 1, 1)
with open('C:\Users\_____\Desktop\FileName.csv', 'rb') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in spamreader:
Application.SIAddPointOnCurveAtEnd("NameOfObject(For Use in Softimage)", row[0], row[1], row[2], False, 0, "")
#print str(row[0])+" "+str(row[1])+" "+str(row[2])
csvfile.close()
Notes:
-Customize the filepath, the name of the file (eg filename.csv) (make sure the spreadsheet is saved as a .csv file), and customize the NameOfObject(For Use in Softimage) fields as well
-the row[number] represents the number of columns of data that are in the spreadsheet (I used XYZ coordinates so I had 3)
-if you delete the # in front of the #print... , you can display the numbers that work
-I found that if you import large coordinates, some of the coordinates may not be added to the curve
-This code is for creating a linear curve, which is shown by the "...1, 1)" part. To find out how to make a different type of curve, Go to the create panel and press Curve>Create Curve by CVs (for example) and then look at the numbers that are shown by the reader thing on the bottom-left/middle of the screen (to the left of the script editor button)