|
Hi All,
I’m using instance replace to ... errmm obviously replace a series of objects with an instanced one.
The issue I have is that it doesn’t keep the materials for the original object but uses the object to be replaced material.
Am i just being blind and missing something obvious or does it not transfer the material as well?
To demonstrate, the original script that I cannibalised is as follows.
-- Author : HanyElTiby mailto:Ha_tiby@Hotm*****
-- Version: 3ds max 4 --
--
--***********************************************************************************************
-- MODIFY THIS AT YOUR OWN RISK
rollout Instance_Replace "Make instances" width:200 height:100
(
pickbutton btn1 "Pick_master" pos:[85,9] width:100 height:23
label lbl1 "Master Object :" pos:[10,12] width:75 height:20
button btn3 "Make Instances" pos:[10,40] width:176 height:23
on btn1 picked obj do
(
global Master_Obj = obj
btn1.text = obj.name
)
on btn3 pressed do
for i in selection do instancereplace i Master_Obj
)
rollout Help "Help" width:200 Height:60
(
label lbl5 "1 : Pick master Object first 2 : Select Objects to be instances then press Make Instances button" pos:[10,10] width:180 height:45
) -- create the rollout window and add the rollout if InstanceReplaceFloater != undefined do
(
closerolloutfloater InstanceReplaceFloater
)
InstanceReplaceFloater = newRolloutFloater "InstanceReplace" 210 120
addRollout Instance_Replace InstanceReplaceFloater
addRollout Help InstanceReplaceFloater rolledup:true
Cheers
El-d
|
|
|
|
I’m afraid the help is quite clear on this. Materials are NOT instanced from the source object to the destination object.
All you should need to do is assign the material from the one to the other:-
on btn3 pressed do
(
for i in selection do
(
instancereplace i Master_Obj
i.material = Master_Obj.material
)
)
Material assignments like that are automatically instances unless you specifically ask for a copy.
Max 4.2 through 2010, XP-Pro 64 SP2.
NVidia 8800GTX-768 (Driver 185.85).
Core 2 Quad Q6600 2.4GHz, 4Gb Ram, 4Gb Swap, DX9.0c.
|
Attachment
|
|
|
|
|