Page 1 of 1

Scatter CSV format

PostPosted: Wed May 30, 2018 1:11 am
by chrisw69
Hi All,

I'm trying to write a scatter CSV file exporter, but cant seem to find any info about the file specs. The documentation seems very light - it specifys there need to be 12 float values to make 1 transform, but doesnt say what order the values should be output as. Through trial and error, I've found the 4th, 8th & 12 value are the X,Z & Y position values from Max, but cant seem to work the rest out - is there any additional documentation on this?

I would have posted this in a more appropriate sub forum but this one seems to be the only one I can post to (though this is unrealted to VR)

I also cant seem to search the forums, as apparently there is a spreadsheet somewhere which converts Modo values to Octane CSV values - which should give me the info I need, but I'm unable to search for it :(

Re: Scatter CSV format

PostPosted: Wed May 30, 2018 1:21 am
by aoktar
Check this quote from my codes

Re: Scatter CSV format

PostPosted: Thu May 31, 2018 12:18 am
by chrisw69
That's brilliant thank you!

Re: Scatter CSV format

PostPosted: Thu May 31, 2018 7:12 am
by paride4331
Hi chrisw69,
this 3dsMax script should work:

Code: Select all
(
FileName = GetSaveFileName types:"object coordinates |*.csv|" filename:selection[1].name
if FileName == undefined then Exit
File = CreateFile FileName
InstanceObjs = #()
for obj in geometry where (instanceMgr.getInstances obj &instances) > 1 and (findItem instanceObjs obj) == 0 do
join instanceObjs instances
for obj in InstanceObjs do
(
tr = obj.transform as matrix3
c1 = tr.row1 [1]
c2 = tr.row3 [1]
c3 = -tr.row2 [1]
c4 = tr.row4 [1]
c5 = tr.row1 [3]
c6 = tr.row3[3]
c7 = -tr.row2 [3]
c8 = tr.row4 [3]
c9 = -tr.row1 [2]
c10 = -tr.row3 [2]
c11 = tr.row2 [2]
c12 = -tr.row4 [2]

Format ("% % % % % % % % % % % %\n") c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 to:file
)
close file
print "File was created"
)


Regards
Paride

Re: Scatter CSV format

PostPosted: Fri Jun 01, 2018 2:20 am
by roeland
You can check in standalone by selecting a scatter node and clicking the Edit button in the Node Inspector.

The format is as follows (with a few spaces added for clarity):

Code: Select all
M00 M01 M02 M03 M10 M11 M12 M13 M20 M21 M22 M23 ID
1   0   0   10  0   1   0   20  0   0   1   30  40

First there is a header with column names. The Mxx columns are the matrix elements, these are the first 3 rows of a 4×4 transform matrix (the 4th row by definition is (0, 0, 0, 1). The ID column is optional and contains the instance IDs.

Then there is the table with values.
The example above contains one instance with a translation of (+10, +20, +30) and instance ID 40.

The header is optional, if it is not there there must be exactly 12 columns with the matrix elements.

You can use comma, space or tab as separators. Octane merges multiple delimiters to one.