Using EcoSystem To CSV

EcoSystem to CSV and CSV to EcoSystem are two Python scripts for Vue 6 Infinite and Vue 5 Infinite that work together to provide a rudimentary method for editing EcoSystems using a spreadsheet. An ecosystem consists of a number of instances of the objects that make it up. The scripts come in a single Zip Archive. This file includes two python files: ecotocsv.py and csvtoeco.py.

EcoSystem to CSV / CSV to EcoSystem

ecotocsv.py, when run with an object with an EcoSystem texture, produces a CSV (Comma Separated Value) file that can be loaded into a text editor and many spreadsheet packages. Each line in the CSV file contains information about one instance in the EcoSystem. The typical first few lines of CSV file produced by ecotocsv.py would look something like:


Instance,Position X,Position Y,Position Z,Rotation X,Rotation Y,Rotation Z,Scale X,Scale Y,Scale Z,Filename,Action
0,122,157,83,0,9,351,0.92,0.5,1.2,\moje inf\square stone 2.vob,T1,128,153,83,1.2,358,351,0.88,0.81,1.17,\moje inf\square stone4.vob,T
2,126,160,83,9,352,6,0.83,0.95,1.03,\moje inf\square stone8.vob,T3,123,154,83,0,351,349,0.97,0.95,1.07,\moje inf\square stone 2.vob,T

csvtoeco.py, when run on the same object with the same EcoSystem applied as before (without repopulation or other runs of csvtoeco.py on it), modifies the EcoSystem’s instances. After running ecotocsv.py and before running csvtoeco.py I would suggest saving your file so that if the changes don’t work quite as you expected you can modify the CSV file again, reload the scene and try it again.

The CSV file has Twelve Columns:

  1. Instance
  2. Position X
  3. Position Y
  4. Position Z
  5. Rotation X
  6. Rotation Y
  7. Rotation Z
  8. Scale X
  9. Scale Y
  10. Scale Z
  11. Filename
  12. Action

Instance is the number of the instance in the EcoSystem. Don’t edit this number.

Position X, Y and Z are the X, Y and Z coordinates of the instance.

Rotation X, Y and Z are the X, Y and Z rotations applied to the instance.

Scale X, Y and Z are the scale factors of the instance.

Filename is the filename of the instance’s base object. Editing this has no effect when csvtoeco.py is run.

Action is an action to be carried out on the instance. It can either be T for Transform or D for Delete. If it is T, any changes to Position, Rotation or Scale you make will be applied to the instance on running csvtoeco.py. If it is D, this instance will be deleted.

Example 1

To delete the 2nd Instance from the EcoSystem from the example file above change the T on the line with Instance number 2 to a D.

Instance,Position X,Position Y,Position Z,Rotation X,Rotation Y,Rotation Z,Scale X,Scale Y,Scale Z,Filename,Action
0,122,157,83,0,9,351,0.92,0.5,1.2,\moje inf\square stone 2.vob,T1,128,153,83,1.2,358,351,0.88,0.81,1.17,\moje inf\square stone4.vob,T
2,126,160,83,9,352,6,0.83,0.95,1.03,\moje inf\square stone 8.vob,D3,123,154,83,0,351,349,0.97,0.95,1.07,\moje inf\square stone 2.vob,T

Example 2

To line up the instances’ X positions so they form a straight line, change all the numbers in the Position X column to the same number.

Instance,Position X,Position Y,Position Z,Rotation X,Rotation Y,Rotation Z,Scale X,Scale Y,Scale Z,Filename,Action
0,122,157,83,0,9,351,0.92,0.5,1.2,\moje inf\square stone2.vob,T1,122,153,83,1.2,358,351,0.88,0.81,1.17,\moje inf\square stone4.vob,T
2,122,160,83,9,352,6,0.83,0.95,1.03,\moje inf\square stone 8.vob,T3,122,154,83,0,351,349,0.97,0.95,1.07,\moje inf\square stone 2.vob,T

impworks © Copyright Mark Caldwell 1996 - 2024