Here's some oddness - try executing the following set of commands:
===
def delayedError():
import maya.OpenMaya as api
import maya.cmds as cmds
dagMod = api.MDagModifier()
manip = dagMod.createNode("textButtonManip")
dagMod.doIt()
mfnDag =
Hey all - I was wondering if there was a way to add a dynamic message
attribute without receiving a warning - ie, if I do:
import maya.cmds as cmds
cmds.addAttr(longName="msgAttr", attributeType="message")
... I receive:
// Warning: file: C:/3D/Maya2008/scripts/AETemplates/
AEreplaceCompound.me
me=attr, attributeType="message",
*args, **kwargs)
... will avoid the warning. But it seems like such a potentially
messy solution, I think I'd rather just change my script to not use
compound attributes (they're not as useful as I'd hoped, anyway), and
hope the
Out of curiosity, anyone know if the bug of .../maya/2008/scripts not
being added to the sys.path correctly is fixed in 2009?
For whatever reason, folks often have trouble with directions like
"don't add it to .../maya/2008/scripts, add it to .../maya/scripts
instead"...
(If you have no idea wha
Hey - I was wondering if anyone has gotten doctest to work
successfully from inside the script editor of a full-gui running maya.
That is, doctest works fine if maya is started from within python via
maya.standalone.initialize(), but if I run a doctest from the script
editor, it never sees ANY ou
Hey all - I just ran into this fun error:
swig/python detected a memory leak of type 'MCallbackId *', no
destructor found.
After a quick search, I see that it was mentioned back in January by
Farsheed, and a few others since then, so I assume it's a known bug...
so I won't go into the details.
Just a FYI for anyone else out there - creating a scriptJob with the
runOnce flag and the parent flag set to a piece of ui, whose script
deletes that same piece of ui, will cause a crash.
If you're unconditionally deleting the ui whenever the scriptJob is
triggered, the easy workaround is simply
Update - ok, so went to implement chad's solution, and was a bit
surprised to find that it didn't work.
Turns out what's going on here is the differing ways standard python
interpreters and maya's interpreter handle echoing of output.
After some digging, I found that this behavior is controlled
For the curious:
it would seem there's a bug with
api.MNodeMessage.addNodeDirtyPlugCallback in python in maya 2008 -
thankfully, it appears to have been fixed in 2009!
Huzzah!
Anyway, this code seems to fail with maya 2008, and succeeds in
2009...
- Paul
http://pastebin.com/f4332cc67
# test
Example usage of MDGContext:
import maya.OpenMaya as om
atTime10 = om.MDGContext(om.MTime(10))
import maya.OpenMaya as om
atTime10 = om.MDGContext(om.MTime(10))
selList = om.MSelectionList()
selList.add("pCube1.translateX")
plug = om.MPlug()
selList.getPlug(0, plug)
print "Value now: ", plug.asD
Hi all - so, I ran across an undocumented method of MFnMesh,
getUvShellsIds, which is used in
/docs/Maya2009/en_US/API/flip_u_v_cmd_8cpp-example.html
Might anyone know if undocumented function such as this are
undocumented for a reason - ie, they might be changed soon, they're
untested, etc
Just made a bug report to autodesk, but since that's not viewable to
the general public, posting here too:
Dynamic attributes created with addAttr that have the storable flag
set to false are still written out to the file - see:
http://pastebin.com/f3b83af36
import maya.cmds as cmds
# Create a
Hi all - so, I'm wondering if there's a way to detect when changes to
an attribute are caused by an undo / redo.
Ie, I have a script that that, whenever a certain attribute is
changed, automatically makes some other changes to the scene as well.
In other words, the flow looks like:
state1 --(att
Hey folks - was wondering if anyone else out there can confirm
something for me: it looks like having autoKeyframe on messes up the
undo queue. Specifically, I can't seem to redo past something that
would set an autoKeyframe.
To reproduce:
1. Make a cube (or any object, really)
2. Set a keyfram
that non-storable
attribute, the altered value IS saved (as a reference edit).
- Paul
On Mar 21, 6:07 am, Dean Edmonds wrote:
> On Fri, Mar 20, 2009 at 17:23, barnabas79 wrote:
>
> > Dynamic attributes created with addAttr that have the storable flag
> > set to false are st
efault
cmds.setAttr(refNode + '.notStorable', 3)
# Save our referencing scene, reopen it, and check
cmds.file( rename='storableTest_referencing.ma' )
cmds.file( force=True, save=True, type='mayaAscii')
cmds.file( 'storableTest_referencing.ma', o=True )
print &q
Hi all - so, I can't use ctypes within maya. If I try, I get this:
import ctypes
# Error: No module named _ctypes
# Traceback (most recent call last):
# File "", line 1, in
# File "...\Autodesk\Maya2009\bin\python25.zip\ctypes\__init__.py",
line 10, in
#
# ImportError: No module named _cty
Ok, after doing some poking around, looks like the problem is on
python's end: on my regular windows x64 python install, I can't import
ctypes, whereas on my 32-bit python, I can.
So, I guess there's not just no ctypes in windows 64-bit maya...
- Paul
On Apr 5, 9:21 am, barnabas
Howdy pythoners...
So, I guess this isn't exactly python-specific, but I was wondering if
someone on here could help me:
Basically, I'm trying to create instances of the various component
types for testing with pymel, but can't find out how to create the
following (or what they are, really):
'k
Hi - does anyone know how to find out the what the available
'component' plugs are on a given node?
Ie: pCube1.vtx[3]
'.vtx' is not an attribute, but instead, a way to reference / access
the mesh vertex components.
listAttr will not return 'vtx', nor will MFnComponent.attribute(x)
Anybody know
Hey - I was wondering if anyone here has tried to set a 'nurbsCurve'
attribute using setAttr (or, really, any of the shape attribute types
- I assume the syntax will be similar between them).
Ie, the docs have this example for mel:
createNode nurbsCurve -n "myNurbsCurveShape";
setAttr myNurbsCur
Just a FYI:
# Note - the following commands must be executed all at once in order
to cause a
# crash. If you execute each command one at a time, no crash will
occur.
import maya.cmds as cmds
polyCube = cmds.polyCube()[0]
subd = cmds.polyToSubdiv(polyCube)[0]
select(subd + '.sme[*][*]')
--~--~--
Hey - I was wondering if anyone here knew of a way to make an EMPTY
kSurfaceFaceComponent MObject?
Normally, I would use MFnDoubleInexedComponent.create - but there
seems to be a bug - it's not compatible with kSurfaceFaceComponent:
import maya.OpenMaya as api
dubComp = api.MFnDoubleIndexedComp
Hey there - anyone know how to make a MUint64 & in python for maya?
Basically, I want to do:
api.MFnSubdNames.fromSelectionIndices(myInt64, 256, 0)
...but have no idea how to make 'myInt64'. The old standby
MScriptUtil doesn't have support for MInt64...
- Paul
--~--~-~--~~
Out of curiosity, anyone here attending CGCON in LA?
http://www.cgcon.net/
- Paul
--~--~-~--~~~---~--~~
http://groups.google.com/group/python_inside_maya
-~--~~~~--~~--~--~---
Check out a post here:
http://groups.google.com/group/python_inside_maya/browse_thread/thread/5ada870a705dfecf/fdf976179cf2a0c9?lnk=gst&q=__file__#fdf976179cf2a0c9
...for different ways to find out where a module lives.
- Paul
On Sep 24, 5:48 pm, seth.gibs...@gmail.com wrote:
> Could __path__
The subject says it all...
import maya.OpenMaya as om
sel = om.MSelectionList()
sel.append('persp')
sel.add('persp')
dag = om.MDagPath()
comp = om.MObject()
sel.getDagPath(0, dag, comp)
dagArray = om.MDagPathArray()
dagArray.append(dag)
dagArray.append(dag)
numElements = 0
for dag in dagArray:
27 matches
Mail list logo