I have this maxscript open file dialogue but I don't know how to link the other code to operate on the file.
Code: Select all
filepath = getOpenFileName \
types:"Data(*.csv)|*.csv|All|*.*|"
Code: Select all
PreWarGrassClump01004,-77168.7031,91268.8828,7828.1479,-4.4434,-3.7479,318.1284,1.1000
Code: Select all
clearlistener()
adata = (dotnetClass "System.IO.File").ReadAllLines "E:csv.txt"
for i = 1 to adata.count do
(
pInfo = (filterString adata[i] "|")
print pInfo
s = sphere segments:(pInfo[6] as integer)
s.radius = pInfo[2] as integer
s.pos = [pInfo[3] as integer,pInfo[4] as integer, pInfo[5] as integer]
s.name = pInfo[1]
)
Code: Select all
(
file = memStreamMgr.openFile @"E:csv.txt"
while NOT file.eos() do
(
local line = filterString (file.readLine()) ", "
if line.count == 8 AND isValidNode (local obj = getNodeByName line[1]) do
obj.scale = [line[8] as float, line[8] as float, line[8] as float]
)
memStreamMgr.close file
)
Code: Select all
(
file = memStreamMgr.openFile @"E:csv.txt"
while NOT file.eos() do
(
local line = filterString (file.readLine()) ","
if line.count == 8 AND isValidNode (local obj = getNodeByName line[1]) do
obj.rotation = eulerAngles (line[5] as float) (line[6] as float) (line[7] as float)
)
memStreamMgr.close file
)
Code: Select all
(
file = memStreamMgr.openFile @"E:csv.txt"
while NOT file.eos() do
(
local line = filterString (file.readLine()) ","
if line.count == 8 AND isValidNode (local obj = getNodeByName line[1]) do
obj.pos = [line[2] as float, line[3] as float, line[4] as float]
)
memStreamMgr.close file
)