Home Coding, Scripting, Shaders

Maxscript Save selected

Hi everyone, is it possible to run in 3ds max script Save selection?

Replies

  • Nels
    Here's the script, but it saves objects separately however I need to save a group of objects

    for obj in selection do 
      ( 
      tempPos = obj.position 
      obj.position = [0,0,0] 
      saveNodes obj ("c:/temp/" + obj.name + ".max") 
      obj.position = tempPos 
      ) 
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    So you want to center all your selected objects to [0,0,0] , save them to a max file, and then set them back to their original position? If so, this should work:

    objSel = selection as array
    objPos = for obj in objSel collect (obj.position)
    for obj in objSel do (obj.position = [0,0,0])
    dirPath = "c:/temp/"
    if (doesFileExist dirPath == false) do (makeDir dirPath all:true)
    saveNodes objSel (dirPath + "objs.max")
    for i=1 to objSel.count do (objSel[i].position = objPos[i])
  • Nels
    Thanks a lot, it works!
    Is it possible to save each group separately, adding +1 to each next saved name?
Sign In or Register to comment.