- Get this course and more in Mobile Machine Learning: The Complete Masterclass. 90% off with coupon code 'YOUTUBESUBSCRIBER' at up t.
- Yes, you can use python language to program in unity. Check this out → Alternatively, you can use this Python Interpreter but its reviews are not that great. Also, you can call Python from C# using IronPython →.
- Python for Unity provides: A Python Script Editor window principally aimed at Technical Artists who want to run short scripts and easily create new. An in-process API aimed at Pipeline Technical Directors who want to call studio scripts implemented in Python from C#. An out-of-process API aimed.
The other neat part is that Unity3D can produce binaries for all major platforms. This includes Windows, Linux, MacOS, Android, iOS, and otherx. So not only does this add 3D capabilities to Python, but it also includes multi-platform support. The build process itself is simple and directed by the game engine itself.
Released:
A python library to parse and dump Unity YAML files
Project description
This project aims to provide a python3 API to load and dump Unity YAMLfiles(configurations, prefabs, scenes, serialized data, etc) in the exact sameformat the internal Unity YAML serializer does.
Using this API you will be able to easily manipulate(as python objects)Unity YAML files and save them just the same, keeping the YAML structureexactly as Unity does. This has the advantages of, first not having toconfigure PyYAML beforehand to deal with Unity YAMLs, and second as themodified file keeps the same structure and formatting that Unity does,when the YAML file is loaded by Unity it won't make formatting changesto it that will make any VCS report unexpected file changes.
Installing
Install and update using pip:
A Simple Example
Classes
unityparser.UnityDocument
Main class to load and dump files.
unityparser.UnityDocument.load_yaml(file_path)
Classmethod: Load the given YAML file_path and return a UnityDocument file
unityparser.UnityDocument.dump_yaml(file_path=None)
Dump the UnityDocument to the previously loaded file location(overwrite).If file_path argument is provided, dump the document to the specified location instead.
This method keeps line endings of the original file when it dumps.
Python For Unity Program
unityparser.UnityDocument.entries
Property: Return the list of documents found in the YAML. The objects in the list are of types Class named after the serialized Unity class(ie. MonoBehaviour, GameObject, Prefab, CustomName, etc).
unityparser.UnityDocument.entry
Property: Return the first document in the YAML, useful if there is only one. Equivalent of doing UnityDocument.entries[0]
.
unityparser.UnityDocument.get(class_name=None, attributes=None)
Method: Return a single entry uniquely matching the given filters. Must exist exactly one.
unityparser.UnityDocument.filter(class_names=None, attributes=None)
Python Interpreter For Unity
Method: Return a list of entries matching the given filters. Many or none can be matched.
unityparser.loader.UnityLoader
Unity Python Support
PyYAML's Loader class, can be used directly with PyYAML to customise loading.
unityparser.dumper.UnityDumper
PyYAML's Dumper class, can be used directly with PyYAML to customise dumping.
Considerations
Text scalars which are single or double quoted that span multiple lines are not being dumped exactly as Unity does. There's a difference in the maximum length allowed per line and the logic to wrap them.
Release historyRelease notifications | RSS feed
1.0.0
0.1.0
0.0.1.post1
0.0.1
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size unityparser-1.0.0-py3-none-any.whl (16.8 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size unityparser-1.0.0.tar.gz (14.2 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for unityparser-1.0.0-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 2a5a6b044384312819c7a7c37e6828c391bc76ae18b89461e85c3d998ba8d3ef |
MD5 | dd705bc290a21ec13de0de8047e8bd02 |
BLAKE2-256 | cc22c734f1056689165db82f51789b7bd2c86349e962a6b6cd00657a0dc596fd |
Hashes for unityparser-1.0.0.tar.gz
Unity Python Interface
Algorithm | Hash digest |
---|---|
SHA256 | 7b552fb654f0eeed3ed479203529b99d04fff71635db260103eaf3ff88aeb525 |
MD5 | 6b2de16be7d139ffb78da46a1c529d99 |
BLAKE2-256 | 78f7c7e11588405bd001351f953d30ca4922d530e62a6c177478b59d6b0dee6f |