top of page

# maya/scripts/qt_dev/
# Execute the following code in a python tab of Maya's script editor.
import particles_ui as pui
dialog = pui.ParticlesDialog()
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtUiTools import *
from sliders import *
from gen_points1 import *
from gen_points_Ring import*
import particles_tabs_ui
import maya.cmds as cmds
class ParticlesDialog(QDialog):
   # "__init__" is a special function that is automatically called 
   # by python when an instance of our DemoDialog class is created. 
   def __init__(self, parent=None):
       # Because our class is derived from QDialog its constructor is called.
       QDialog.__init__(self, parent)

        # This maintains a list of the particle transform node names
       self.particle_transforms = []
               # Ensure our window stays in front and give it a title
       self.setWindowTitle("NParticle Maker")
       self.setFixedSize(437, 200)
       # Create and assign the main (vertical) layout.
       vlayout = QVBoxLayout()
       # We want to have the tabs at the top of the dialog
       # We want to have the sliders at the top of the dialog
       # Ensure the buttonPanel is pushed down to the lower edge of the
       # Dialog window.
   def addTabsPanel(self, parentLayout):
       self.tabs = QTabWidget()
       page_1 = particles_tabs_ui.BoxTabPage("Box")
       page_2 = particles_tabs_ui.SphereTabPage("Sphere")
       page_3 = particles_tabs_ui.ConeTabPage("Cone")
       page_4 = particles_tabs_ui.DiskTabPage("Disk")
       page_5 = particles_tabs_ui.CylinderTabPage("Cylinder")
       page_6 = particles_tabs_ui.RingTabPage("Ring")
       page_7 = particles_tabs_ui.TorousTabPage("Torous")
   def addButtonPanel(self, parentLayout):
       # Add a Button and connect it to our custom buttonAction() method.
       self.okButton = QPushButton("OK")
       self.deleteButton = QPushButton("Delete")
               # For easthetics we add the button to a horizonal layout and use
               # stretch() to ensure it is pushed to the right hand edge.
       hlayout = QHBoxLayout()
   def createAction(self):
       page = self.tabs.currentWidget()
               #print("button has been clicked")
       tnode = page.doAction()
   def deleteAction(self):
       if len(self.particle_transforms) > 0:
           tnode = self.particle_transforms.pop()
           # Check if the particles exists before trying to
           # delete it !!!
           if len(self.particle_transforms) == 0:


bottom of page