maya-umbrella 0.6.2__py2.py3-none-any.whl → 0.8.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of maya-umbrella might be problematic. Click here for more details.

@@ -1 +1 @@
1
- __version__ = "0.6.2"
1
+ __version__ = "0.8.0"
@@ -10,6 +10,7 @@ try:
10
10
  import maya.api.OpenMaya as om
11
11
  import maya.cmds as cmds
12
12
  import maya.mel as mel
13
+ import maya.standalone as maya_standalone
13
14
  except ImportError:
14
15
  # Backward compatibility to support test in uinstalled maya.
15
16
  try:
@@ -21,8 +22,10 @@ except ImportError:
21
22
  cmds = MagicMock()
22
23
  om = MagicMock()
23
24
  mel = MagicMock()
25
+ maya_standalone = MagicMock()
24
26
 
25
27
  # Import built-in modules
28
+ from contextlib import contextmanager
26
29
  from functools import wraps
27
30
 
28
31
 
@@ -99,6 +102,7 @@ def block_prompt(func):
99
102
  Returns:
100
103
  function: The decorated function.
101
104
  """
105
+
102
106
  @wraps(func)
103
107
  def wrap(*args, **kwargs):
104
108
  # Grabs the initial value.
@@ -134,3 +138,10 @@ def save_as_file(file_name):
134
138
  """
135
139
  cmds.file(rename=file_name)
136
140
  cmds.file(s=True, f=True)
141
+
142
+
143
+ @contextmanager
144
+ def maya_standalone_context():
145
+ maya_standalone.initialize()
146
+ yield cmds
147
+ maya_standalone.uninitialize()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maya_umbrella
3
- Version: 0.6.2
3
+ Version: 0.8.0
4
4
  Summary: Check and fix maya virus.
5
5
  Home-page: https://github.com/loonghao/maya_umbrella
6
6
  License: MIT
@@ -43,7 +43,7 @@ Description-Content-Type: text/markdown
43
43
  [![maya-2018](https://img.shields.io/badge/maya-2018-green)](https://img.shields.io/badge/maya-2018-green)
44
44
 
45
45
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
46
- [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
46
+ [![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
47
47
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
48
48
 
49
49
  This tool is designed to provide a robust solution for identifying and resolving any potential viruses within Autodesk
@@ -141,7 +141,7 @@ MAYA_UMBRELLA_LOG_LEVEL
141
141
  修改杀毒后文件的备份文件夹名称, 默认是`_virus`
142
142
  比如:
143
143
  你文件路径是 `c:/your/path/file.ma`
144
- 那么备份文件路径是 `c:/your/path/_maya_umbrella/file.ma`
144
+ 那么备份文件路径是 `c:/your/path/_virus/file.ma`
145
145
  ```shell
146
146
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
147
147
  ```
@@ -154,6 +154,12 @@ MAYA_UMBRELLA_LANG
154
154
  ```shell
155
155
  MAYA_UMBRELLA_IGNORE_BACKUP
156
156
  ```
157
+
158
+ 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
159
+ ```shell
160
+ SET MAYA_LOCATION=d:/your/path/maya_version/
161
+ ```
162
+
157
163
  如果忽略请设置为
158
164
  ```shell
159
165
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
@@ -169,7 +175,7 @@ api = MayaVirusDefender()
169
175
  print(api.get_unfixed_references())
170
176
  ```
171
177
 
172
- 批量修复文件
178
+ 批量修复文件, 通过正则表达式
173
179
  ```python
174
180
  from maya_umbrella import MayaVirusScanner
175
181
 
@@ -178,6 +184,16 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
178
184
 
179
185
  ```
180
186
 
187
+ # 案例
188
+ 如果你想要快速通过maya standalone去批量清理maya文件,可以`下载`或者`git clone`当前`main`分支的工程,
189
+ 根据上面指引设置好开发环境
190
+ 通过`nox`命令去启动maya standalone环境,maya版本根据你当前本地安装的maya为准,比如你本地安装了`2018`,
191
+ 那么就是 `nox -s maya-2018-s`
192
+ 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
193
+ ```shell
194
+ nox -s maya-2020-s -- c:/test/*.m[ab]
195
+ ```
196
+
181
197
  ## Contributors ✨
182
198
 
183
199
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -196,6 +212,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
196
212
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/CGRnDStudio"><img src="https://avatars.githubusercontent.com/u/8320794?v=4?s=100" width="100px;" alt="andyvfx"/><br /><sub><b>andyvfx</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/commits?author=CGRnDStudio" title="Code">💻</a></td>
197
213
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/cundesi"><img src="https://avatars.githubusercontent.com/u/15829469?v=4?s=100" width="100px;" alt="cundesi"/><br /><sub><b>cundesi</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/commits?author=cundesi" title="Code">💻</a></td>
198
214
  </tr>
215
+ <tr>
216
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Wenfeng-Zhang"><img src="https://avatars.githubusercontent.com/u/54899080?v=4?s=100" width="100px;" alt="Wenfeng Zhang"/><br /><sub><b>Wenfeng Zhang</b></sub></a><br /><a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Tests">⚠️</a> <a href="https://github.com/loonghao/maya_umbrella/commits?author=Wenfeng-Zhang" title="Code">💻</a></td>
217
+ </tr>
199
218
  </tbody>
200
219
  </table>
201
220
 
@@ -1,5 +1,5 @@
1
1
  maya_umbrella/__init__.py,sha256=uHgbJ-AL3NOfDNB55_7a4_c-OAuP4X8eQ_Yi1udaA0I,401
2
- maya_umbrella/__version__.py,sha256=jFlbxEJFS0G44LE-yXXVSwXACA1J_NyYDk5E20_2zpc,22
2
+ maya_umbrella/__version__.py,sha256=iPlYCcIzuzW7T2HKDkmYlMkRI51dBLfNRxPPiWrfw9U,22
3
3
  maya_umbrella/cleaner.py,sha256=5EC3w4qRkIsr9AIZneEV8ljhxaOw385Gj2C2KTrzyJg,5044
4
4
  maya_umbrella/collector.py,sha256=rAFmvY8Isdle89ezn2-H36hSJd77iBvPBLRPzruCycA,13111
5
5
  maya_umbrella/constants.py,sha256=2sl0dL0U82mwu-Msda9B8-USxr89Wu2yu6SYiuaaJZk,539
@@ -14,7 +14,7 @@ maya_umbrella/i18n.py,sha256=NCC6isPdchv3yRBS2F4Cguu1bVyi0VoMMcI4YOIxBtU,2683
14
14
  maya_umbrella/locales/en_US.json,sha256=LW2gPgO2YJIYR5UfcIBuxW_DS7rf4gkjeVuADqs1V5s,962
15
15
  maya_umbrella/locales/zh_CN.json,sha256=UsuRN2yaxxc9LE-7NQkbMqrkjXjNhNegS0QRkQLSTiE,1006
16
16
  maya_umbrella/log.py,sha256=IJweFEBTThL6_mW86jAAPKyWNvI79CrMifs5vO3t6ks,1338
17
- maya_umbrella/maya_funs.py,sha256=WDvREjzLfEsPND0RU-2ErbWgsU6MsILqVBW219p8sZo,3394
17
+ maya_umbrella/maya_funs.py,sha256=4Wty8e722V-stYofPGHGHKCIURP5Gp-qTOsodqXJ4MA,3645
18
18
  maya_umbrella/scanner.py,sha256=Souu4iFrYPJVV34actQf69Po6hHhGDv_7cRuKtGoygc,3921
19
19
  maya_umbrella/signatures.py,sha256=RkEXChch7tdqA9Yq6YQ8AMnK2ra6ih0dfnpeZy5FkYs,354
20
20
  maya_umbrella/vaccine.py,sha256=aBW6pdT4tD4OMBPZ-d3E4_n16Rylz-2gb7JWzMZVPK0,1022
@@ -22,7 +22,7 @@ maya_umbrella/vaccines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
22
22
  maya_umbrella/vaccines/vaccine1.py,sha256=WLo1uJElTLSjVCf5CBtRNU4HKs63my5mkHiGqTfnNEE,489
23
23
  maya_umbrella/vaccines/vaccine2.py,sha256=yvHpnrQ6Jts9_zCy8WRJcbxz0CVSRAPkn2vF552atQs,2123
24
24
  maya_umbrella/vaccines/vaccine3.py,sha256=d89Ocj1AmsZt9YJjggjDJqAWXcckGLMl-6u8jXeAPjg,3493
25
- maya_umbrella-0.6.2.dist-info/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
26
- maya_umbrella-0.6.2.dist-info/METADATA,sha256=V6AkULsn8ON_lVjzw8my2awAfrN3UBLae9kIkT_1p04,9851
27
- maya_umbrella-0.6.2.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
28
- maya_umbrella-0.6.2.dist-info/RECORD,,
25
+ maya_umbrella-0.8.0.dist-info/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
26
+ maya_umbrella-0.8.0.dist-info/METADATA,sha256=8uNh9uBd18o6IVmFSqXvJRV8bRIPuCQTb8IaC9q_TnM,10996
27
+ maya_umbrella-0.8.0.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
28
+ maya_umbrella-0.8.0.dist-info/RECORD,,