Thanks Justin for your time. 
Good to know about globals can cause issue.... 
Anyways I tried not to use those, but I keep getting errors....I'll try to 
understand better how to do, maybe I'll create also a global class.
THanks again

F

Il giorno mercoledì 10 maggio 2023 alle 10:36:29 UTC+1 Justin Israel ha 
scritto:

>
>
> On Wed, 10 May 2023, 8:40 pm SquashnStretch net, <squashn...@gmail.com> 
> wrote:
>
>> great, let me know if you can take a look at it.
>
>
>
> I only took a quick look. It seems like you don't even need globals 
> (unless I missed something). If you get rid of the extra printing code, 
> what is left is the first two button callbacks that app and they get their 
> own selection list each time. 
> Mutable globals as state are a good way to end up with bugs. It is better 
> to try and pass data between functions as args. Or to use a class so that 
> each instance can store state. But maybe just getting rid of globals in the 
> first place is enough here. There is even one of those functions where the 
> selection list isn't declared global so it's a local list in that scope. 
> There may be actual bugs in the Maya commands code but I didn't look 
> closely enough. 
>
>
>
>> Thanks in advance
>> Filippo
>>
>>
>>
>> Il giorno mercoledì 10 maggio 2023 alle 08:22:57 UTC+1 Justin Israel ha 
>> scritto:
>>
>>>
>>>
>>> On Tue, 9 May 2023, 9:45 am SquashnStretch net, <squashn...@gmail.com> 
>>> wrote:
>>>
>>>> oh damn, sorry....
>>>> can you retry please ?
>>>>
>>>
>>> Oops forgot to reply. Yes it's accessible now. 
>>>
>>>
>>>> thanks
>>>> F
>>>>
>>>> Il giorno lun 8 mag 2023 alle ore 22:35 Justin Israel <
>>>> justin...@gmail.com> ha scritto:
>>>>
>>>>>
>>>>>
>>>>> On Tue, May 9, 2023 at 8:56 AM SquashnStretch net <
>>>>> squashn...@gmail.com> wrote:
>>>>>
>>>>>> In my previous post, I asked for help understanding how to connect 
>>>>>> different nodes from different elements all at once. I managed to work 
>>>>>> around the problem by connecting the attributes one by one, which seemed 
>>>>>> to 
>>>>>> work.
>>>>>>
>>>>>> Now, I have another, easier problem for experienced Python users. Let 
>>>>>> me try to explain.
>>>>>>
>>>>>> I am trying to write a code that adds a new space attribute to the 
>>>>>> arm of a rig, connecting to the Head, Hips, and Body if they don't have 
>>>>>> this option. If I add one space option to the right arm at a time, the 
>>>>>> script works well. However, if I add a space to the other arm and then 
>>>>>> go 
>>>>>> back to the first arm to add another space, the script fails.
>>>>>>
>>>>>> I think it may be a matter of some global variable, but even when I 
>>>>>> try to update it, I end up breaking the script. If you have the time, I 
>>>>>> would appreciate it if you could take a look at my code. If you want to 
>>>>>> test it, you can probably use any Maya rig.
>>>>>>
>>>>>> Thanks in advance
>>>>>> Filippo
>>>>>>
>>>>>> https://pastebin.com/embed_js/GaudeMpR
>>>>>>
>>>>>
>>>>> This pastebin is reporting that it's either private or pending 
>>>>> moderation. Make sure you set the pastebin to public.
>>>>>  
>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to python_inside_m...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/python_inside_maya/c92c073f-47d5-4d5a-93c6-06171bf81c5cn%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/c92c073f-47d5-4d5a-93c6-06171bf81c5cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to python_inside_m...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0vVjVM74WL1Cgi9gxNFm4YSyYugcS-G0rNhcBWn%3DtEtQ%40mail.gmail.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0vVjVM74WL1Cgi9gxNFm4YSyYugcS-G0rNhcBWn%3DtEtQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to python_inside_m...@googlegroups.com.
>>>>
>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/python_inside_maya/CAE8PYnDc3S7%2BMzdzNYg9wo_Tgk0SvUaFxGN2ATN%3DTThrYbQ_Lg%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAE8PYnDc3S7%2BMzdzNYg9wo_Tgk0SvUaFxGN2ATN%3DTThrYbQ_Lg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to python_inside_m...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/03f28d7f-e87e-4573-8cbd-e33dfaa44b1an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/03f28d7f-e87e-4573-8cbd-e33dfaa44b1an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/d19a7408-97a0-4211-be5c-2757e3154d6bn%40googlegroups.com.

Reply via email to