using the above example,
strArryAttr[0].set('heyThere')

#   File "<maya console>", line 1, in <module>
#   File "<string>", line 2, in __getitem__
#   File "C:\Program Files\Autodesk\Maya2011\Python\lib\site-packages
\pymel-1.0.0-py2.6.egg\pymel\internal\factories.py", line 1963, in
wrappedApiFunc
#     result = method( mfn, *final_do_args )
#   File "D:\buildforge\Maya_2011_Win64_Build\build\wrk\optim\runTime
\Python\Lib\site-packages\maya\OpenMaya.py", line 7048, in
elementByLogicalIndex
# RuntimeError: (kFailure): Object does not exist #


the same thing works if the attr was a string multi, but not a string
array.

one of the main reasons i wanted to use the stringArray was that i
really like the convenience of the automatic data typing of
setDynamicAttr!:
along with the 'force' behavior  and setting all the indicies at once:

pynode.setDynamicAttr('newData',['yo','hey'])

but i cannot seem to do the same thing and have the attr turn out to
be a multi instead of a string array.

how might i get the convenience of:
pynode.setDynamicAttr('newData',['yo','hey'])

yet have the attr turn out to be a string multi?


On Mar 14, 6:44 pm, Chad Dombrova <[email protected]> wrote:
> try this:
>
> strArryAttr[1].set('stranger')
>
> On Mon, Mar 14, 2011 at 6:42 PM, mtherrell <[email protected]> wrote:
> > yes, but i only want to set a single index.
> > setting the whole thing kind of defeats my purpose.
>
> > i realize that
> > strArryAttr.get()[1]
>
> > ..has nothing to do with pymel itself, that its just python at work..
> > but how do i set only a single index of a stringArray using .set()?
>
> > thanks
>
> > -mt
>
> > On Mar 14, 3:52 pm, Michiel Duvekot <[email protected]> wrote:
> > > strArryAttr.set(['hello','stranger'])
>
> > > --
> > > Michiel
>
> > --
> >http://groups.google.com/group/python_inside_maya
>
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to