2 Demonstrates combining the mesh of two scene nodes
4 from PySide2
import QtWidgets
7 def GetObjectMesh(node):
8 node.Convert(MaxPlus.ClassIds.TriMeshGeometry)
9 object_state = node.EvalWorldState()
10 obj_original = object_state.Getobj()
11 tri_obj = MaxPlus.TriObject._CastFrom(obj_original)
12 tri_mesh = tri_obj.GetMesh()
17 msg =
"Please select 2 nodes to combine."
23 a = GetObjectMesh(node1)
24 b = GetObjectMesh(node2)
28 new_mesh=new_obj.GetMesh()
32 def show_alert(message):
33 msgBox = QtWidgets.QMessageBox()
34 msgBox.setText(message)
38 w = QtWidgets.QDialog(MaxPlus.GetQMaxMainWindow())
40 w.setWindowTitle(
'Combine 2 Nodes')
42 main_layout = QtWidgets.QVBoxLayout()
43 label = QtWidgets.QLabel(
"Combine 2 Nodes")
44 main_layout.addWidget(label)
46 combine_btn = QtWidgets.QPushButton(
"Combine")
47 combine_btn.clicked.connect(CombineNodes)
48 main_layout.addWidget(combine_btn)
50 w.setLayout(main_layout)
54 if __name__ ==
'__main__':