Need to do something after... it's actually for pymel's new component implementation, so there may be an arbitrarily large amount of things that users might want to do after, and I don't think '.executeDeferred" will really work. =/
Thanks for the suggestion though... I think we'll just have to add some special case code to pymel's select command that checks for '.sme[*]' - Paul On Mon, Jun 8, 2009 at 7:52 AM, John Creson<[email protected]> wrote: > You might try piling up the refresh and the selection at the end of whatever > is happening before with an executeDeferred. > > import maya.utils as utils > > utils.executeDeferred("cmds.refresh();cmds.select(subd + '.sme[*][*]')") > > Are you trying to end what is happening at this selection, or is there > something that you need to do with the selection after you've selected it? > > -JohnC > > On Mon, Jun 8, 2009 at 10:38 AM, Paul Molodowitch <[email protected]> > wrote: >> >> I spoke too soon - still getting a crash when I'm selecting .sme[*][*] >> in my own code, even with a refresh. Unfortunately, I'm not sure what >> the key difference between it and the test case I already posted is... >> >> - Paul >> >> On Fri, Jun 5, 2009 at 9:20 PM, Paul Molodowitch<[email protected]> >> wrote: >> > Yup, no more crash. Thanks for the workaround! >> > >> > - Paul >> > >> > On Fri, Jun 5, 2009 at 4:39 PM, John Creson<[email protected]> wrote: >> >> I just took another look at the initial construct with an emphasis on >> >> the >> >> "avoid" question... >> >> >> >> >> >> import maya.cmds as cmds >> >> import maya.utils as utils >> >> >> >> polyCube = cmds.polyCube()[0] >> >> subd = cmds.polyToSubdiv(polyCube)[0] >> >> cmds.refresh() >> >> cmds.select(subd + '.sme[*][*]') >> >> >> >> print(cmds.ls(sl=True)) >> >> >> >> >> >> >> >> the refresh seems to avoid this crash. >> >> >> >> Or in MEL (which also crashed without the refresh) >> >> >> >> string $polyCube[] = `polyCube`; >> >> string $subd[] = `polyToSubdiv $polyCube[0]`; >> >> refresh; >> >> select -r ($subd[0] + ".sme[*][*]") >> >> ls -sl >> >> >> >> Paul, is this acceptable to you for now? >> >> >> >> >> >> On Fri, Jun 5, 2009 at 5:18 AM, Dimitry <[email protected]> >> >> wrote: >> >>> >> >>> but if I trying to select unordered vertexes i got crash >> >>> >> >>> #unitMesh= ls(selection=True)[0] >> >>> mc.select(clear=True) >> >>> select (unitMesh.vtx[6422:6429], add=True) >> >>> select (unitMesh.vtx[3273:3275, 3278:3279, 3282:3283, 3285], add=True) >> >>> >> >>> nows somebody how possible to avoid it? >> >>> >> >> >> >> >> >> >> >> >> >> > >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
