if MatEditor.isOpen() != false AND maxOps.mtlDlgMode == #advanced then (
viewNode = sme.GetView (sme.activeView)
view = trackViewNodes[#sme][(viewNode.name)]
selNodeInterface = viewNode.getSelectedNodes() --get selected node in SME
selNodeNames = sort(for m in selNodeInterface collect m.name) --collect all selected node/s names in SME
selNodeMatsInSceneNames = sort(for o in sceneMaterials where o.name != undefined and FindItem selNodeNames o.name > 0 collect o.name) --collects only the names of materials in the scene
theViewMats = for n = 1 to view.numsubs where (superClassOf view[n].reference == material) collect view[n].reference -- collects all mats in SME view
)
viewNode
view
selNodeInterface
selNodeNames
selNodeMatsInSceneNames
theViewMats
I've managed to get the names of selected nodes that are a scene material with:
selNodeMatsInSceneNamesAnd all the materials in the view in an array with:
theViewMatsI was wondering if it's possible to collect the selected nodes but only materials and also not applied to scene (that will be easy once I can only get the selected nodes and not the entire view)
The output of above code is:
<IObject:IFP_NodeViewImp>
SubAnim:View1
#(<MixinInterface:Node>, <MixinInterface:Node>, <MixinInterface:Node>, <MixinInterface:Node>)
#("02 - Default", "Map #4", "Material #47", "Material #48")
#("Material #47")
#(02 - Default:Standard, Material #47:Composite, Material #48:Standard, Material #74:Standard, Material #75:Standard, Material #76:Shell_Material)
By 3dwannab · 2015-08-28