I found the problem from your first question. The second problem is slightly 
more confusing but maybe my notes will help. I tried to comment up as much as 
possible with my edits using # EDIT #

http://pastebin.com/WVxfW1FG

For the first problem, I found where it was (line 74 of your original code):
    cmds.setAttr('ikFk_status.notes', new_ikfk_note_list, type ='string')
This line was passing a list to your attribute as a string. Maya was happily 
allowing a list->string conversion to take place, corrupting your data. I 
changed it to first join it to a string again:
    note_string = ','.join(new_ikfk_note_list)
    cmds.setAttr(self.GROUP_NAME, note_string, type ='string')

For the second problem, it seems like you already had the proper attributes to 
reference on your class, and that cmds.getAttr was not appropriate. But I was 
concerned that you were calling your noFlip_leg() method twice, and then 
running your useNotesTest() which then only considers the most recent leg? Is 
that right? You are not saving these curves as you go. Each run replaces the 
previous info.

-- justin



On Nov 28, 2012, at 9:38 PM, Berg Jones wrote:

> Thanks for looking at it. I replaced the stripPath method but it didnt fix 
> the problem. I simplified it down as much as I could and have it here. I hope 
> it makes sense. 
> 
> http://pastebin.com/vmRS70AR
> 
> 
> The stringToString array in my first comment was a typo caused by the 
> autocomplete.
> 
> 
> 
> 
> 
> 
> On Wednesday, November 28, 2012 6:29:51 PM UTC-5, Justin Israel wrote:
> 1) No need to think about a regex solution. Somewhere in your code (I don't 
> see it in this example), you are storing a string representation of a list, 
> inside your other list. I have a feeling it might be your self.stripPath() 
> method. Could you show that?
> 
> Also, for adding one list to another, you can do it even faster by using 
> `extend`:
> new_ikfk_note_list.extend(self.okfk_stored_notes)
> 
> 2) stringToStringArray is a mel method. You shouldn't need that in python.
> You are correct about needing getattr to resolve an attribute from a string:
> 
> item.leg_ctl = getattr(self, 'leg_ctrl')
> 
> But I don't see you actually storing them as attributes. They are being 
> stored in a list, right?
> 
> If you post more of the complete code on pastebin or elsewhere, and point out 
> the lines, I can take a better look.
> 
> -- justin
> 
> 
> 
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to