擅长:python、mysql、java
<p>您应该能够使用<code>sys.path.insert</code>或<code>sys.path.append</code>向正在运行的maya动态添加python路径。您不需要做比这更复杂的事情;如果脚本在sys路径上,那么脚本应该是可导入的。在</p>
<p>因为您要做的是使用maya模块,这是一个非常常见和干净的解决方案。模块将允许您附加到通常的搜索目录,它们支持网络共享,因此您可以添加一个模块(在maya模块路径中)并将其脚本目录指向onedrive。模块也可以有它们自己的<code>userSetup.pys</code>,这对于保持代码与特定机器上运行的任何其他东西之间的干净分离非常好。在</p>
<p>关于模块<a href="https://theodox.github.io/2014/magical_modules#magical_modules" rel="nofollow noreferrer">here</a>和<a href="http://around-the-corner.typepad.com/adn/2012/07/distributing-files-on-Maya-Maya-modules.html" rel="nofollow noreferrer">here</a>的更多信息。文件是<a href="http://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=__files_GUID_130A3F57_2A5D_4E56_B066_6B86F68EEA22_htm" rel="nofollow noreferrer">here</a></p>