Notifications
Clear all
[Closed] Copy(duplicate) any material related node in Maxscript
Aug 31, 2017 6:24 pm
Hello guys I can’t find any documentation how to duplicate materials in Slate|Standard Editor… Is there anyone who knows how to make it happen?
Basically I want to make a copy of the selected material in the SME rename it and show it in the SME of course, is it doable ?
2 Replies
Aug 31, 2017 6:24 pm
Hello there,
Thanks to Neil Blevins and his scripts (soulburnscripts) i can tell you that you should find more info for the slate material editor searching for ‘sme’ in the maxscript help. The function you are asking for is probably ‘sme.GetMtlInParamEditor()’.
Enjoy,
har1sf0x
Aug 31, 2017 6:24 pm
You need to use something like this:
Short Version:
(sme.getview (sme.activeview)).createnode (copy (sme.GetMtlInParamEditor())) &#([100,100])[1]
Long Version:
(
--Get Index of Active View
actIndex = sme.activeview
--Get the actual SME View
theView = sme.getview actIndex
--Create a copy of the current material in the Parameter Editor
cloneMat = copy (sme.GetMtlInParamEditor())
--Rename cloned material so it is unique
cloneMat.name = "Cloned Material"
--Define a new Position in the editor for the new Mtl
newPos = [100,100]
--Create the material in the SME View
theView.createnode cloneMat &newPos
)
From Selected Node:
(
--Get Index of Active View
actIndex = sme.activeview
--Get the actual SME View
theView = sme.getview actIndex
--Get the reference of the selected mtl from the Node Interface
SourceMat = (theView.getSelectedNodes())[1].reference
--Create a copy of the selected material in the Parameter Editor
cloneMat = copy SourceMat
--Rename cloned material so it is unique
cloneMat.name = "Cloned Material"
--Define a new Position in the editor for the new Mtl
newPos = [100,100]
--Create the material in the SME View
theView.createnode cloneMat &newPos
)
Hope that helps,
-Eric