擅长:python、mysql、java
<p>这是一个嵌套值的问题,当您的值位于def下时,它不会存储在全局范围中。你知道吗</p>
<pre><code>counter = 0
def crease(ignore):
value = counter+1
maya.cmds.polyCrease(v=i)
return value
counter = crease(0)
</code></pre>
<p>如果要跟踪计数器,可以创建全局:
<a href="https://stackoverflow.com/questions/10506973/can-not-increment-global-variable-from-function-in-python">Can not increment global variable from function in python</a></p>
<p>格言:
<a href="https://stackoverflow.com/questions/16797683/python-modify-a-dictionary-inside-a-method">python modify a dictionary inside a method</a></p>
<p>甚至是上课。你知道吗</p>