Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python for 3ds max - Replace selected objects with objects from an external file
from MaxPlus import FileManager
from MaxPlus import SelectionManager
model_path = r"D:\Models\Some_model.max"
place_holders = []
for o in SelectionManager.Nodes:
place_holders.append(o)
FileManager.Merge(model_path,True,True)
model = SelectionManager.GetNode(0)
for i in range(len(place_holders)):
place_holders[i].SetObject(model.GetObject())
place_holders[i].SetMaterial(model.GetMaterial())
place_holders[i].SetName(model.Name + "_" + str(i))
model.Delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.