Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maya crash when using one parameter in plugin

0 REPLIES 0
Reply
Message 1 of 1
Beforelastdawn
265 Views, 0 Replies

Maya crash when using one parameter in plugin

Hi! I am using Maya2022 to load plugin from Cadnano (version2.3 for PyQt5 port). Firstly, I install PyQt5 in Maya, then I do some modification in original code in spCadNano so that it can show in Maya. But I meet one problem, when I want to insert the lattice, Maya freeze for senconds and then crash without any erroe messages and not crash log. I check in event viewer, there is one error show Qt5Core.dll error. And then I try to check the code line by line, I found that when I want to using one parameter "partItem" then Maya crash.

----------------------

if app().isInMaya():
        from .solidview.solidrootitem import SolidRootItem
              self.splitter.setOrientation(Qt.Vertical)
              self.setUnifiedTitleAndToolBarOnMac(False)
              modState = self.actionModify.isChecked()
              self.solidroot = SolidRootItem(parent=None, document=doc,
                                    modState=modState)

.......

class SolidRootItem(object):
def __init__(self, parent, document, modState):
      self._document = document
      self._controller = ViewRootController(self, document)
      self._modelPart = None
      self._partItems = {}
      self._modifyState = modState
      self._selectionFilterDict = {}
      self.oldSelectionStrandList = []
      self._selectedDict = {}

def partAddedSlot(self, sender, modelPart):
      self._modelPart = modelPart
      partItem = PartItem(modelPart, self)
      self._partItems[partItem] = True

      self.setModifyState(self._modifyState)

.......

class PartItem(object):
      def __init__(self, modelPart, parent=None):
          self._parentItem = parent
          pluginPath = os.path.join(os.environ['CADNANO_PATH'],
                "views",
                 "solidview")
          hchPath = os.path.join(pluginPath, "halfcylinderhelixnode.py")
          smiPath = os.path.join(pluginPath, "predecoratornode.py")

         if(not cmds.pluginInfo(hchPath, query=True, loaded=True)):
                 cmds.loadPlugin(hchPath)

         if(not cmds.pluginInfo(smiPath, query=True, loaded=True)):
                 cmds.loadPlugin(smiPath)

         if(not cmds.pluginInfo(hchPath, query=True, loaded=True)):
                   print("HalfCylinderHelixNode failed to load")
                   return

         self._type = modelPart.crossSectionType()
         self.mayaOrigin = (-15 * 2.25, 16 * 2.25, 0.0)
         self.helixRadius = 1.125 # diamiter is 2.25nm
         self._virtualHelixItems = {}
         self._part = modelPart
         self._controller = PartItemController(self, modelPart)
         self.modifyState = False

.........

class PartItemController(object):
        def __init__(self, partItem, modelPart):
              self._partItem = partItem
              self._modelPart = modelPart
              self.connectSignals()
------------------------------------

 

When the code run at the "self._partItem = partItem", maya crash!

So do you know what's the key for this problem?

Labels (1)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums