A better Autodesk Maya antivirus tool detects and removes malicious.
Project description
A better Autodesk Maya antivirus tool that detects and removes malicious code.
This tool is designed to provide a robust solution for identifying and resolving any potential viruses within Autodesk Maya. It ensures a secure and seamless user experience by proactively scanning for threats and effectively neutralizing them.
It can be provided as an API for seamless integration into your existing pipeline.
Installation
pip installation
maya_umbrella is distributed as a standard pipy package, so we can install it via pip install.
your/maya-root/mayapy -m pip install maya-umbrella
One-click installation
Download the corresponding version of the zip package in the release, unzip it and double-click install.bat to install it.
Update version
your/maya-root/mayapy -m pip install maya-umbrella --upgrade
Uninstall
your/maya-root/mayapy -m pip uninstall maya-umbrella
Development Environment Setup
Set up the development environment using a virtual environment, and it is recommended to use Python 3.8 or higher versions.
Install development dependencies via pip
pip install -r requirements-dev.txt
Development Debugging
Testing in Maya
With nox -s maya -- <maya version>, start Maya.
Nox will dynamically register a nox session based on your local installation of Maya,
e.g. if you have maya-2018 installed locally, then you can start Maya with a test environment.
nox -s maya -- 2018
Note: there are two - between maya and the version number.
After starting Maya, executing the following code in the script editor will dynamically open the ma file from <repo>/tests/virus/ to test it.
import manual_test_in_maya
manual_test_in_maya.start()
It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding Maya
nox -s maya -- 2018 --test
Note: Command line crash may occur in versions below maya-2022 (PY2).
Adding New Vaccines
Create a new py in <repo>/maya_umbrella/vaccines/. Since many viruses don't have a specific name, we'll use vaccine<id>.py.
Inherit from maya_umbrella.vaccine import AbstractVaccine and call the class Vaccine, and then write the virus collection logic.
Code Check
We can use the encapsulated nox command to perform a code check.
nox -s lint
Format code
nox -s lint-fix
Generate Installation Package
Execute the following command to create a zip under /.zip, with --version the version number of the current tool.
Note: between make-zip and --version there are two -.
nox -s make-zip -- --version 0.5.0
Environment Variables
We can use the following environment variables to modify some of the settings of maya_umbrella, so that companies with pipelines can better integrate them.
Modify the log saving directory of maya umbrella, the default is the windows temp directory.
MAYA_UMBRELLA_LOG_ROOT
Change the name of the log file for maya umbrella, default is maya_umbrella.
MAYA_UMBRELLA_LOG_NAME
Set the log level, the default is info, can be debug can see more log information.
MAYA_UMBRELLA_LOG_LEVEL
Change the name of the backup folder for antivirus files, default is _virus.
For example:
Your file path is c:/your/path/file.ma.
Then the backup file path is c:/your/path/_virus/file.ma.
MAYA_UMBRELLA_BACKUP_FOLDER_NAME
The default display language, including logging printouts, etc. is set by default according to your current maya interface language, but of course we can also set it via the following environment variables.
MAYA_UMBRELLA_LANG
Ignore saving to the backup folder, please note that if you are not clear about the consequences of this please do not modify it easily, the default batch antivirus will automatically back up the source file to the current file's backup folder after the batch antivirus.
MAYA_UMBRELLA_IGNORE_BACKUP
If ignored please set to
SET MAYA_UMBRELLA_IGNORE_BACKUP=true
For the portable version of Maya,
you can specify the Maya path by adding the MAYA_LOCATION environment variable.
SET MAYA_LOCATION=d:/your/path/maya_version/
You can also specify a directory from the command line.
nox -s maya -- 2018 --install-root /your/local/maya/root
Hooks Control
Disable all hooks. When set to true, no hooks will be executed.
MAYA_UMBRELLA_DISABLE_ALL_HOOKS
If you want to disable all hooks:
SET MAYA_UMBRELLA_DISABLE_ALL_HOOKS=true
Disable specific hooks by name. Use a comma-separated list of hook names (without .py extension).
Available hooks:
delete_turtle- Remove Turtle plugin and related nodesdelete_unknown_plugin_node- Remove unknown plugin nodesfix_model_panel- Fix model panel issuesfix_no_scene_name- Fix scenes without namesfix_on_model_change_3dc- Fix 3D Coat model change callback
MAYA_UMBRELLA_DISABLE_HOOKS
For example, to disable the delete_turtle and delete_unknown_plugin_node hooks:
SET MAYA_UMBRELLA_DISABLE_HOOKS=delete_turtle,delete_unknown_plugin_node
API
Get virus files that have not been repaired in the current scenario.
from maya_umbrella import MayaVirusDefender
api = MayaVirusDefender()
print(api.get_unfixed_references())
Batch repair of files, via regular expressions.
from maya_umbrella import MayaVirusScanner
api = MayaVirusScanner()
print(api.scan_files_from_pattern("your/path/*.m[ab]"))
Examples
If you want to quickly go through maya standalone and batch clean up maya files.
You can either download or git clone the current main branch.
Set up your development environment according to the guidelines above,
and Use the nox command to start the maya standalone environment,
the version of maya is based on your current local installation of maya.
For example, if you have 2018 installed locally, Then nox -s maya -- 2018 --standalone.
The following syntax starts a maya-2020 environment to dynamically check for viruses from the c:/test folder.
nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Hal 💻 🚇 ⚠️ |
hotwinter0 ⚠️ 💻 |
lingyunfx ⚠️ |
yjjjj ⚠️ 💻 |
Unclechen ⚠️ |
andyvfx 💻 |
cundesi 💻 |
Wenfeng Zhang ⚠️ 💻 |
rickdave 🐛 |
This project follows the all-contributors specification. Contributions of any kind are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maya_umbrella-0.18.0.tar.gz.
File metadata
- Download URL: maya_umbrella-0.18.0.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7691c922436b3ed78bb52370f50d8dcdae3329ef791c08eeb2cf62b6abd9934f
|
|
| MD5 |
2e56dcb79c34ac47b048f5ddb10c112c
|
|
| BLAKE2b-256 |
ba6f45f7c995950e9956b85622b09f2d2bc984b66d47d0975732b87ea8c6f5b2
|
Provenance
The following attestation bundles were made for maya_umbrella-0.18.0.tar.gz:
Publisher:
python-publish.yml on loonghao/maya_umbrella
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maya_umbrella-0.18.0.tar.gz -
Subject digest:
7691c922436b3ed78bb52370f50d8dcdae3329ef791c08eeb2cf62b6abd9934f - Sigstore transparency entry: 905499271
- Sigstore integration time:
-
Permalink:
loonghao/maya_umbrella@1894660d24ee65326858032d18a2a713a6a32ede -
Branch / Tag:
refs/tags/v0.18.0 - Owner: https://github.com/loonghao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1894660d24ee65326858032d18a2a713a6a32ede -
Trigger Event:
push
-
Statement type:
File details
Details for the file maya_umbrella-0.18.0-py2.py3-none-any.whl.
File metadata
- Download URL: maya_umbrella-0.18.0-py2.py3-none-any.whl
- Upload date:
- Size: 45.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c37a40e1de4fa85f39ec622af66d04c840c5b6531beb56ca33c7fb48859ee93
|
|
| MD5 |
9f3a1b68e6d349ff28e9d40b271cddb2
|
|
| BLAKE2b-256 |
b3448557ea328408d654eb6ff9ed545226bee9b64bfc71dde6c0691b095be51a
|
Provenance
The following attestation bundles were made for maya_umbrella-0.18.0-py2.py3-none-any.whl:
Publisher:
python-publish.yml on loonghao/maya_umbrella
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maya_umbrella-0.18.0-py2.py3-none-any.whl -
Subject digest:
4c37a40e1de4fa85f39ec622af66d04c840c5b6531beb56ca33c7fb48859ee93 - Sigstore transparency entry: 905499361
- Sigstore integration time:
-
Permalink:
loonghao/maya_umbrella@1894660d24ee65326858032d18a2a713a6a32ede -
Branch / Tag:
refs/tags/v0.18.0 - Owner: https://github.com/loonghao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1894660d24ee65326858032d18a2a713a6a32ede -
Trigger Event:
push
-
Statement type: