[Maya-Python] Re: creating MDataHandle in the command

2009-10-27 Thread Chad Vernon
MPlug.elementByLogicalIndex(n) will automatically create a plug at that index if one doesn't exist there. So your command just needs to find the next available index. MPlug.getExistingArrayAttributeIndices will give you the current indices. -Chad On Tue, Oct 27, 2009 at 7:03 PM, Jakub Krompolc w

[Maya-Python] creating MDataHandle in the command

2009-10-27 Thread Jakub Krompolc
I`m trying to use arrayDataBuilder in the command, but it seems I can`t do that without dataBlock. And as documentation says "The data block is only valid during the compute method of the depend node", it looks like you can`t generate array attributes using command itself, even the node specified.

[Maya-Python] Re: 'Pickeling' pymel objects?

2009-10-27 Thread chadrik
PyNodes already have special code to ensure they will pickle, and they will correctly unpickle as long as the maya objects in the pickle exist in the current scene. the question is, "what should pymel do if the node/attr does not exist?" > > Ah-hah! That's cool. > So, I actually ran into

[Maya-Python] Re: PyQt - pumpThread (threads in Maya crash)

2009-10-27 Thread John Creson
are you starting a qapp in your code? maya2008 doesn't like living qapps and sometimes gets into fights possibly the Browser class is doing it for you? starting more than one qapp will quickly blip maya from your screen and, until someone works it out, don't try pumpthread on a mac - it doesn't w

[Maya-Python] Re: 'Pickeling' pymel objects?

2009-10-27 Thread AK Eric
Ah-hah! That's cool. So, I actually ran into a very similar problem on Monday: I was trying to use pickle to store objects built via functools.partial (which I suppose you could equate to a PyNode class instance in this case), but pickle said it couldn't do it, which was a bummer (no pickling fu

[Maya-Python] PyQt - pumpThread (threads in Maya crash)

2009-10-27 Thread Taylor Carrasco
Probably a basic threading question - I'm using the default pumpThread module in the following manner... if sys.executable.endswith("maya.bin"): import pumpThread class Browser(QMainWindow): def __init__(self): QMainWindow.__init__(self) omitted code . # Launch

[Maya-Python] Re: 'Pickeling' pymel objects?

2009-10-27 Thread chadrik
> I don't use pymel, but I do use Python and pickle in Maya ;) From > your above example, it looks like x is a tuple with two strings in > it? Or is pymel storing more complex objects as the name > representation of the nodes rather than strings? yeah, pymel represents nodes as instances of a P

[Maya-Python] Re: 'Pickeling' pymel objects?

2009-10-27 Thread AK Eric
I don't use pymel, but I do use Python and pickle in Maya ;) From your above example, it looks like x is a tuple with two strings in it? Or is pymel storing more complex objects as the name representation of the nodes rather than strings? I'm not sure why this would choke (if it's just a tuple

[Maya-Python] Re: 'Pickeling' pymel objects?

2009-10-27 Thread Chad Dombrova
well, that's kind of a tricky question. creating the missing nodes would be very difficult because we would have to essentially recreate a maya ascii/binary scene loader: pickle all attribute values and connections and attempt to recreate them if missing. IMHO this would be too complex a

[Maya-Python] 'Pickeling' pymel objects?

2009-10-27 Thread Sune
Hi there, I have a small "issue" with pymel and pickle. If I pickle out say a list that contains some pymel objects, once I try to unpickle that file, Maya chokes if the pickled pymel nodes are not in the scene. Any suggestions? Here is an example: from pymel import * import pickle x = (ls('Le