Skip to content

Instantly share code, notes, and snippets.

View havchr's full-sized avatar

Håvard Christensen havchr

View GitHub Profile
@havchr
havchr / simd_test_2.rs
Created August 5, 2023 22:08
simd test with rust, trying to see if I get any performance from std::simd (no luck so far on Macbook pro M2)
#![feature(portable_simd)]
use std::simd::Simd;
use std::array;
use std::time::Duration;
use instant;
use rand::prelude::*;
const lanes : usize = 16;
fn main() {
@havchr
havchr / simd_test.rs
Created August 5, 2023 12:40
I am trying to test the std::simd to measure performance , but I am new to this stuff, so I am wondering if I am doing things wrong?
#![feature(portable_simd)]
use std::simd::Simd;
use std::array;
use std::time::Duration;
use instant;
use rand::prelude::*;
const lanes : usize = 16;
fn main() {
@havchr
havchr / PivotAdjuster.cs
Last active February 4, 2025 09:08
Unity3DS editor script, context menu for adjusting pivot of a parent object that have children placed around.
using UnityEditor;
using UnityEngine;
namespace Agens
{
#if UNITY_EDITOR
public enum PivotAlignment
{
Min,Mid,Max,
}
@havchr
havchr / CollectionBrowser.cs
Created January 4, 2023 13:43
CollectionBrowser For Unity. Browse through prefabs
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using Random = UnityEngine.Random;
/*
* CollectionBrowser together with the CollectionBrowserInspector
* is a little tool for placing a set of prefabs that can be browsed through.
@havchr
havchr / megasymbo.py
Created September 23, 2020 09:57
A small script to symbolicate an iOS-crashlog by parsing a bit and using the atos command
#!/usr/bin/env python
import sys
import subprocess
print("use like this... ./megasymbo.py unsymbolicated.crash YourThing.dSYM/Contents/Resources/DWARF/YourThing YourThing > result.crash")
print("third argument is for the pattern of YourThing 0xbadf00d 0x1337")
if len(sys.argv) != 4:
print("Exiting program.. Please provide exact arguments")
quit()
thaCrash = sys.argv[1]
thaDSym = sys.argv[2]
@havchr
havchr / explodeShaderCollection.py
Last active September 23, 2020 09:53
Explodes a unity shader collection into multiple shader collections
#!/usr/bin/env python
import sys
import subprocess
import os
if len(sys.argv) < 3:
print("This snippet explodes a shader collections into multiple shader collection containing x shaders")
print("use like this... ./shaderSplitter.py AllShaders.shaderVariants ShaderPrefix 4")
@havchr
havchr / operator_textureProjectSetup.py
Last active March 9, 2020 09:17
Small tool to help set up texture projectors for quick block-outs in blender.
import bpy
import math
bl_info = {
"name": "Easy setup of UV Projection",
"blender": (2, 80, 0),
"category": "UV",
}
uvProjectorsCollectionName="UVProjectors"
@havchr
havchr / operator_whitebox_fbx_export.py
Last active February 9, 2023 03:01
A blender export plugin that exports a collection named Export with FBX_SCALE_UNITS
import bpy
#This blender plugin will export everything in a collection named Export with fbx format with FBX scale.
#You can adjust to your needs for options - usefull for making sure you have consistent
#export settings for your FBXs and an easy way to reach them. I suggest you add it to quick shortcuts as well.
#I just press q->export and enter and then I have exported a new version.
bl_info = {
"name": "Export whitebox mesh",
"blender": (2, 80, 0),
"category": "Exporter",