Import
Last updated
Last updated
To make sure Databrain recognizes the correct data types you will need to setup the spreadsheet correctly.
Use the following keys to mark the appropriate fields:
FIELD_NAMES
The actual name of the value/variable
FIELD_TYPES
The type of the value. (vector3, float, integer, boolean etc.)
IGNORE
Mark rows and cells you don't want to import with this key.
The CSV converter supports following types by default. If you have a special case you would have to override the ConvertFromCSV method -> see Manual conversion
string
int
float
double
bool
vector2
vector3
vector4
quaternion
rect
List<string>
List<int>
List<float>
List<bool>
You can override the ConvertFromCSV method in your custom DataObject class to read from the imported CSV string and convert custom data in any way you want.
Make sure to separate values by comma. For example:
Vector3
0.3, 2.0, 4.0
Color
255, 220, 120, 255
List<string>
A, B, C, D, E, F
To import a Google spreadsheet select the import module in the Databrain editor. Make sure Google Import is selected.
In Databrain a Google Spreadsheet equals to a namespace in Databrain. Whereas a Google Worksheet equals to a data type.
Open a spreadsheet file in Google.
In the top right corner, click Share.
Click Get shareable link
in the top right of the Share with others
box.
To choose whether a person can view, comment, or edit the file, click the Down arrow next to Anyone with the link.
Select the namespace in the import module.
Copy the link and paste it in the Google Share Link field.
Each data type equals a worksheet. That's why we now have to set the worksheet ID for each data type.
Open a spreadsheet file in Google.
Select the correct worksheet and search for the gid number in the browser URL field. Select and copy it.
Enter the gid number in the appropriate worksheet id field.
Select whether you want to append or replace the data objects.
Click on import.