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
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.
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
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
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
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
> 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
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
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
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
10 matches
Mail list logo