سؤال

How i can read/import object location data (for every object/model in scene) from textile in MaxScript?

My TextFile: x,y,z,modelname

Thanks.

هل كانت مفيدة؟

المحلول

New line for each record?

(
    file = memStreamMgr.openFile @"C:\sample.ext"

    while NOT file.eos() do
    (
        local line = filterString (file.readLine()) ", "
        if line.count == 4 AND isValidNode (local obj = getNodeByName line[4]) do
            obj.pos = [line[1] as float, line[2] as float, line[3] as float]
    )
    memStreamMgr.close file
)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top