Skip to main content

A library to parse .SMD files (uncompiled 3D asset files for the Source engine).

Project description

GPLv3 license PyPI pyversions Platforms PyPI version fury.io GitHub Workflow Status (with event) Test coverage

ValveSMD

ValveSMD is a Python library designed to parse and edit .SMD files, which stores 3D mesh data to be compiled for use in Valve's Source engine.

Full documentation: https://pysourcesdk.github.io/ValveSMD/

Installation

PyPI

ValveSMD is available on the Python Package Index. This makes installing it with pip as easy as:

pip3 install valvesmd

Git

If you want the latest code or even feel like contributing, the code is available on GitHub.

You can easily clone the code with git:

git clone git@github.com:pySourceSDK/ValveSMD.git

and install it with:

python3 setup.py install

Usage

Here's a few example usage of ValveSMD

Parsing

Parsing can be done by creating an instance of Smd with a path.

>>> from valvesmd import Smd
>>> smd = Smd('C:/modelsrc/tf/props_mining/rock005.smd')

Utility functions

A few functions are provided to perform basic transformations.

>>> from valvesmd import *
>>> SmdScale(smd, 2) # 2x scale
>>> SmdMirror(smd, 'x') # Mirroring on 'x', 'y' or 'z' axis
>>> SmdMatReplace(smd, 'wood', 'metal') # replace a material name (without $cdmaterial and extension)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valvesmd-1.0.2.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

valvesmd-1.0.2-py3-none-any.whl (19.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page