Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to get the selected object material in Slate Material Editor?

How to get the selected object material in Slate Material Editor?

278989625
Participant Participant
675 Views
4 Replies
Message 1 of 5

How to get the selected object material in Slate Material Editor?

278989625
Participant
Participant

我在互联网上找到了一个类似的脚本,但它删除了视图并清除了所有材料。仅获得所选对象的材料,但我想保留原始材料,只添加新获得的材料。
这对我来说非常重要,但我不知道如何编写代码。请帮助我。

0 Likes
Accepted solutions (1)
676 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor

to start, ask your questions in any English (broken, simplified, especial, custom, etc.)

0 Likes
Message 3 of 5

278989625
Participant
Participant
I found a similar script on the Internet, but it deleted the view and cleared all materials. Only the materials of the selected objects are obtained, but I want to keep the original materials and only add the newly obtained materials.
This is very important to me, but I don't know how to write code. Please help me.
0 Likes
Message 4 of 5

miauuuu
Collaborator
Collaborator
Accepted solution
(
	if selection.count != 0 then
	(
		view = sme.getview sme.activeview
		selObjsArr = selection as array
		for i = 1 to selObjsArr.count where (mat = selObjsArr[i].material) != undefined do
		(
			view.createnode mat [(i - 1) * 200, (i - 1) * 200]
		)
	)
)
https://miauu-maxscript.com/
0 Likes
Message 5 of 5

Serejah
Advocate
Advocate

there's a built in SME action for this

(sme.getmainframe()).setfocus();
actionman.executeaction 369891408 "55581" -- "Get from Selected"
0 Likes