Table Import modify P based on csv order

   1978   1   1
User Avatar
Member
52 posts
Joined: 7月 2013
Offline
I use a table import SOP and a point sop to create a group of points. Since, the imported CSV file does not have x,y and z fields, Px, Py and Pz are all zero.

I want to modify point positions, based on their order in the CSV file.

For example, if there are 100 lines in the CSV and I want the points to be positioned 10 rows by 10 pixels.

I know I need to create a multi line expression. CMD E on a mac. I use python.

I can do the for each loops, but I don't know how to reference all of the points in order. I can't even get the following code to work.

count = 1
return count

Brad Carvey
Brad Carvey
User Avatar
Member
8575 posts
Joined: 7月 2007
Offline
Point Wrangle:

int cols = int(ceil(sqrt(@numpt)));
int col = @ptnum%cols;
int row = floor(@ptnum/cols);

@P = set(col, row, 0);

you can replace, int cols … line with any number of columns you want
like int cols = 10;
int cols = int(ceil(sqrt(@numpt))); just tries to keep your grid squareish
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links