Guest User

Untitled

a guest
Feb 6th, 2023
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. macroScript SelectNodesByMaterial
  2. category:"Jahman"
  3. tooltip:"SME select nodes by material"
  4. (
  5. fn GetSMESelection nodes:false =
  6. (
  7. local index = sme.activeView
  8. local viewNode = sme.GetView index
  9. local SME_Selection = #()
  10.  
  11. if index > 0 do
  12. (
  13. local tv = trackViewNodes[#sme][index]
  14.  
  15. for n = 1 to tv.numSubs do
  16. (
  17. local ref = tv[n].reference
  18. local _node = viewNode.GetNodeByRef ref
  19.  
  20. if _node != undefined and _node.selected do append SME_Selection ( if nodes then #( ref, _node ) else ref )
  21.  
  22. )
  23. )
  24.  
  25. SME_Selection
  26.  
  27. )
  28.  
  29. on execute do
  30. (
  31. if not SME.IsOpen() do SME.Open()
  32.  
  33. local nodes = #()
  34. for m in GetSMESelection() do join nodes (refs.dependentNodes m)
  35. select nodes
  36.  
  37. )
  38. )
  39.  
  40. macroScript SmePickMaterialFromSelection
  41. category:"Jahman"
  42. tooltip:"SME get material from selection"
  43. (
  44. if not SME.IsOpen() do SME.Open()
  45.  
  46. (SME.GetMainframe()).setfocus()
  47. if SME.GetNumViews() == 0 do SME.CreateView "View1"
  48. actionMan.executeAction 369891408 "55581" -- Get from Selected
  49.  
  50. )
Advertisement
Add Comment
Please, Sign In to add comment