I have two max files :
1) few groups with lots of objects in each group.
2) One object with material and texture on it.
I need to open each group, then to replace each object with the object in the second
file (object without material ---> object with material)
This is what I have done for now:
group_name = #()
Obj_name = #()
count = 0
group_arr = #()
fobj_names = #()
objs_in_group_arr = #(#())
for i= 1 to selection.count do
group_flag = true
if classof(selection[i].baseobject) == Dummy then
append group_arr selection[i]
group_flag = false
count = count + 1
group_name = filterString selection[i].name "."
objs_in_group_arr[count] = #()
if (group_flag == true) then
Obj_name = filterString selection[i].name "."
if(Obj_name == group_name) then
append objs_in_group_arr[count] selection[i]
fobj_names = getmaxfileobjectnames "second.max"
mergemaxfile "first.max" fobj_names #select
for i = 1 to group_arr.count do
-- It doesn't work from here,I need to replace it in a different way
new_mesh = meshop.cloneFaces selection selection.faces
setGroupOpen group_arr true
for j = 1 to objs_in_group_arr[i].count do
new_mesh.position = objs_in_group_arr[i][j].position
I have problems with the replace code.
1) Should i use the cloneFaces command to copy the object?
2) Is it true to just replace the objects positions and then delete the old one?
3) Is it a shortest way to select the objects from each group?