Nevermind - missed the replace on the setLocked(True) in your example.
So only the first code snippett failed.

Again this worked:

from pymel import *
s = polySphere()[0]
s.tx.__apimplug__().setLocked(True)
attrs = s.listAttr(locked=True)
for attr in attrs:
        attr.__apimplug__().setLocked(False)


On Mar 3, 12:16 pm, Ian Jones <shrt...@gmail.com> wrote:
> Sorry for the incomplete example.
>
> However both code snippets you gave me raise the same error (output
> below). I noticed this did not throw an error in 2009 - so I would
> expect it to be 8.5 SP1 bug.
>
> Ian
>
> from pymel import *
> s = polySphere()[0]
> s.tx.setLocked(True)
> attrs = s.listAttr(locked=True)
> for attr in attrs:
>         attr.setLocked(False)
> # Error: argument number 1: Unmatched paren in format
> # Traceback (most recent call last):
> #   File "<maya console>", line 3, in ?
> #   File "<string>", line 2, in setLocked
> #   File "D:\Toolkit\trunk\sww\plat-indep\maya\all\scripts\pymel\core
> \factories.py", line 2615, in wrappedApiFunc
> #     result = method( mfn, *newargs )
> #   File "C:\engserv\rbuild\164\build\wrk\optim\runTime\Python\Lib
> \site-packages\maya\OpenMaya.py", line 7921, in setLocked
> # SystemError: argument number 1: Unmatched paren in format #
>
> s = polySphere()[0]
> s.tx.setLocked(True)
> attrs = s.listAttr(locked=True)
> for attr in attrs:
>         attr.__apimplug__().setLocked(False)
> # Error: argument number 1: Unmatched paren in format
> # Traceback (most recent call last):
> #   File "<maya console>", line 2, in ?
> #   File "<string>", line 2, in setLocked
> #   File "D:\Toolkit\trunk\sww\plat-indep\maya\all\scripts\pymel\core
> \factories.py", line 2615, in wrappedApiFunc
> #     result = method( mfn, *newargs )
> #   File "C:\engserv\rbuild\164\build\wrk\optim\runTime\Python\Lib
> \site-packages\maya\OpenMaya.py", line 7921, in setLocked
> # SystemError: argument number 1: Unmatched paren in format #
>
> On Mar 3, 10:40 am, chadrik <chad...@gmail.com> wrote:
>
> > Hey Ian,
>
> > > Found one issue with RC4 (8.5SP1 x86):
>
> > > from pymel import *
>
> > > dup = PyNode('my_skinned_mesh')
> > > attrs = dup.listAttr(locked=True)
> > > for attr in attrs:
> > >    attr.setLocked(False)
>
> > > results in:
>
> > > # Error: argument number 1: Unmatched paren in format
> > > # Traceback (most recent call last):
> > > #   File "<maya console>", line 3, in ?
> > > #   File "<string>", line 2, in setLocked
> > > #   File "C:/Documents and Settings/ijones/My Documents/maya/8.5/
> > > scripts/pymel\core\factories.py", line 2615, in wrappedApiFunc
> > > #   File "C:\engserv\rbuild\164\build\wrk\optim\runTime\Python\Lib
> > > \site-packages\maya\OpenMaya.py", line 7921, in setLocked
> > > # SystemError: argument number 1: Unmatched paren in format #
>
> > can you provide a full script that reproduces the problem?
>
> > i ran this on 2008ext2 without problems, can you test it on your  
> > machine?:
>
> > s = polySphere()[0]
> > s.tx.setLocked(True)
> > attrs = s.listAttr(locked=True)
> > for attr in attrs:
> >         attr.setLocked(False)
>
> > it's possible that the bug is in maya.OpenMaya.  to test this you can  
> > modify your code like so:
>
> > attrs = dup.listAttr(locked=True)
> > for attr in attrs:
> >         attr.__apimplug__().setLocked(False)
>
> > that will get you the api mplug for the attribute, with no pymel  
> > wrapper around it.
>
> > > and since you asked:
>
> > > The new treatment of non-existent objects took me a bit of time to get
> > > used to/port my code. No big deal, and I don't mind the new behavior
> > > at all - it makes sense to me. The bigger problem is that I have to
> > > have all the tools ported and somewhat tested before I can release the
> > > new version of pymel/tools to the studio. I would have much rather had
> > > the feature be depreciated for one release to allow me more time to
> > > transition smoothly. Luckily we have a nice break now to do it
> > > otherwise I would probably would have waited till summer to do so.
>
> > i'll look into the possibility of allowing greater backward  
> > compatibility in this regard as frustrating early adopters is a big  
> > concern to me.  in this version we've introduced a configuration file  
> > for customizing pymel, so we might be able to have a "0.7  
> > compatibility mode".  i would leave it off by default, but describe it  
> > in the docs while also underscoring that it may be removed in future  
> > versions.
>
> > thanks for the feedback, it's very much appreciated.
>
> > -chad
>
>
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to