Skip to content

Instantly share code, notes, and snippets.

View Dragorn421's full-sized avatar

Dragorn421 Dragorn421

  • France
View GitHub Profile
<!DOCTYPE html>
<html><head>
<title>PositionTest</title>
<script type="text/javascript" src="js.js"></script>
<style>
table, tbody, tr, th, td {
border: 1px solid black;
border-collapse: collapse;
}
@SuppressWarnings("unchecked")
public static <T extends JsonElement> T merge(final T obj1, final T obj2)
{
if(obj1 == null)
return clone(obj2);
if(obj2 == null)
return clone(obj1);
if(obj1 instanceof JsonObject)
{
final Map<String, JsonElement> merged = new HashMap<>();
DISCLAIMER: I OWN NONE OF THIS CODE
PlayerConnection#a(PacketPlayInFlying) (actually called for any player movement it seems)
calls
EntityPlayer#l()
calls
EntityHuman#t_()
calls
EntityLiving#t_()
calls
@Dragorn421
Dragorn421 / blackbg.ahk
Created February 20, 2020 15:19
Black background for windows
; AutoHotKey script - https://www.autohotkey.com/
; add black background to *focused* window
; press and hold B then press + on numpad : add borders
; B and - on numpad : remove borders
SetupBackground()
{
global
BACKGROUND_PARTS := 2
guiIds := []
@Dragorn421
Dragorn421 / change_objects_internal_order.py
Last active April 7, 2020 11:10
Blender script for changing the internal order of objects
# WARNING: this may make blender forget some stuff,
# it at least forgets the hide/shown status of every object
# this is useful when export order is an issue
# MODIFY THIS
# move element at index 3 by -2, so it ends up at index 1
# move element at index 7 by 3, so it ends up at index 10
moves = [[3,-2],[7,3]]
@Dragorn421
Dragorn421 / model_show.c
Created April 5, 2020 21:28
Custom actor for OoT64 for animation showcase purposes
#include <z64ovl/oot/debug.h>
#include <z64ovl/z64ovl_helpers.h>
#define OBJ_ID 0x4
#define ACT_ID 0x1
#define PAD 0x0
#define MODEL 0x0600CDE0
@Dragorn421
Dragorn421 / Changelog.md
Last active April 14, 2020 10:55
Edited script to import all animations at once from an OoT64 object

Changes compared to the script from Nokaubure shipped with SharpOcarina

Import Options

  • Added option to use shadeless materials (don't use environment colors in-game) (default False)
  • Added original object scale option, blender objects will be at inverted scale (default 100, use 48 for maps?)
  • Made Texture Clamp and Texture Mirror options True by default
  • Removed option for animation to import

Features

  • Made all animations import at once, each action named animXX_FF where XX is some number and FF the number of frames
@Dragorn421
Dragorn421 / blend4web_normal_editor_standalone.py
Last active April 14, 2022 13:10
Normal editor from Blend4Web, working standalone https://www.blend4web.com
# Copyright (C) 2014-2017 Triumph LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Dragorn421
Dragorn421 / oot_dump_polytypes.py
Created August 18, 2020 12:39
Python script for dumping polytypes from objects (using a CloudModding table) and scenes (using 0x03 commands)
"""
usage: python3 oot_dump_polytypes.py
prerequisites:
zzrtl/oot_names.tsv
have run oot_dump.rtl (with zzrtl) in zzrtl/
output: polytypes_dump.tsv
"""
@Dragorn421
Dragorn421 / mips_to_c_wrapper_wholefile.py
Created August 24, 2020 15:27
Lame mips_to_c wrapper for mips_to_c-ing a whole file
#!/usr/bin/env python3
import sys
import argparse
from pathlib import Path
import subprocess
import re
# input arguments
parser = argparse.ArgumentParser(description='Lame mips_to_c wrapper.')
parser.add_argument('c_file', help='C file')