View Full Version : Maya Crash with deleteUI()

02 February 2011, 02:35 PM
Hi all!

I'm trying to implement drag&drop with maya layouts, simple: drag a button from one grid layout into another. To "simulate" this, I'm deleting the dragged button from original layout and create a new one at target layout...

I stopped in the delete layout part, when I try to do deleteUI() maya crashed :S I try with evalDeferred too and crash too

I see the bug in I dont know if exists any workaround or so...

I put here the code I run...

import maya.cmds as cmds

def DRAG (dragControl, x, y, modifiers):

def DROP (dragControl, dropControl, messages, x, y, dragType):

col = cmds.columnLayout(columnAttach=('both', 5), rowSpacing=1, columnWidth=200)
cmds.gridLayout(p=col, ag=1, cwh=[90,120])
cmds.button(dgc=DRAG, w=50, h=80)
cmds.gridLayout(p=col, dpc=DROP, bgc=(0.3, 0.2, 0.3), ag=1, cwh=[90,120])

Thnx very much!

02 February 2011, 05:21 PM
Wouldn't it be easier to parent the button to the second gridLayout that you're going to drop it on?

cmds.button(buttonName, edit=True, parent=gridLayoutName)

CGTalk Moderation
02 February 2011, 05:21 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.