This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cstdint> | |
extern "C" { | |
#include "png.h" | |
} | |
struct Colour { | |
std::uint8_t red; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf8 -*- | |
import struct | |
from sys import argv | |
try: | |
import bpy | |
from bpy.types import Operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SLADE: https://github.com/sirjuddington/SLADE | |
-- License: WTFPL | |
local editor = App.mapEditor() | |
local sideTexParts = { "textureBottom", "textureMiddle", "textureTop" } | |
local texsToReplace = { | |
["FNEW1"] = "METAL", | |
["N_MTSP3I"] = "AQSUPP01", | |
["N_MTSP3J"] = "AQRUST10", | |
["N_MTSP3F"] = "-", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mathutils import Matrix | |
def obori_to_vecs(ob): | |
return euler_to_vecs(ob.rotation_euler) | |
def euler_to_vecs(eu, fix=Matrix([[-1,0,0],[0,0,1],[0,1,0]])): | |
mtx_euler = eu.to_matrix() | |
mtx_fixed = mtx_euler * fix | |
# mtx_fixed = mtx_euler @ fix # Blender 2.8 and newer | |
# print("mtx_euler", mtx_euler, "mtx_fixed", mtx_fixed, sep="\n\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from itertools import zip_longest | |
import bpy | |
# Copied from https://docs.python.org/3/library/itertools.html#itertools-recipes | |
# Used for grouping triangle vertex indices | |
def grouper(iterable, n, *, incomplete='fill', fillvalue=None): | |
"Collect data into non-overlapping fixed-length chunks or blocks" | |
# grouper('ABCDEFG', 3, fillvalue='x') --> ABC DEF Gxx | |
# grouper('ABCDEFG', 3, incomplete='strict') --> ABC DEF ValueError |