Skip to content

Instantly share code, notes, and snippets.

Begin Map
Begin Level
Begin Actor Class=PlayerStart Name=PlayerStart_0 Archetype=PlayerStart'Engine.Default__PlayerStart'
Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CylinderComponent_6 Archetype=CylinderComponent'Engine.Default__PlayerStart:CollisionCylinder'
CollisionHeight=80.000000
CollisionRadius=40.000000
ReplacementPrimitive=None
LightingChannels=(bInitialized=True,Dynamic=True)
Name="CylinderComponent_6"
ObjectArchetype=CylinderComponent'Engine.Default__PlayerStart:CollisionCylinder'
<?xml version="1.0" ?>
<LEVELSETTINGS>
<ENTITIES>
<OBJECT NAME="Arrow" POSITION="0.19870662689208984,1.3024128675460815,1.4877012968063354"ROTATION="-0.02002108469605446,0.1502816528081894,-0.1329554170370102"SCALE="1.0,1.0,1.0" />
<OBJECT NAME="Arrow" POSITION="3.5257835388183594,2.5896334648132324,2.780996084213257"ROTATION="-0.14960597455501556,0.3824111521244049,-0.38389497995376587"SCALE="1.0,1.0,1.0" />
<OBJECT NAME="Arrow" POSITION="6.803386688232422,2.824307441711426,2.624886989593506"ROTATION="-0.4444291591644287,0.5566175580024719,-0.7335644364356995"SCALE="1.0,1.0,1.0" />
<OBJECT NAME="Arrow" POSITION="8.912853240966797,1.7956141233444214,1.377884864807129"ROTATION="-0.771550714969635,0.5879549384117126,-1.052547812461853"SCALE="1.0,1.0,1.0" />
<OBJECT NAME="Arrow" POSITION="9.93678092956543,0.0,0.0"ROTATION="-0.9119373559951782,0.567962110042572,-1.1761506795883179"SCALE="1.0,1.0,1.0" />
</ENTITIES>
</LEVELSETTINGS>
@RH2
RH2 / gist:9523045
Last active August 29, 2015 13:57
QUATERNION VARIATIONS
XYZ
<?xml version="1.0" ?>
<LEVELSETTINGS>
<ENTITIES>
<OBJECT NAME="Arrow" POSITION="-0.12419533729553223, 16.0, 0.4991927146911621" ROTATION="0.7082316279411316, 0.705980122089386, 0.0, 0.0" SCALE="1.0, 1.0, 1.0" />
<OBJECT NAME="Arrow" POSITION="0.6347577571868896, -8.80777645111084, 0.05618429183959961" ROTATION="0.030846940353512764, 0.030848199501633644, 0.706433892250061, -0.7064332962036133" SCALE="1.0, 1.0, 1.0" />
<OBJECT NAME="Arrow" POSITION="1.4003560543060303, -8.72734546661377, 0.056180477142333984" ROTATION="0.06163160502910614, 0.06163303554058075, 0.7044158577919006, -0.704415500164032" SCALE="1.0, 1.0, 1.0" />
<OBJECT NAME="Arrow" POSITION="2.1560323238372803, -8.58049488067627, 0.056180477142333984" ROTATION="0.09229908883571625, 0.09230057895183563, 0.7010571956634521, -0.7010565400123596" SCALE="1.0, 1.0, 1.0" />
<OBJECT NAME="Arrow" POSITION="2.896034002304077, -8.368340492248535, 0.056180477142333984" ROTATION="0.12279099971055984, 0.1227923035621643, 0.6963638067245483, -0.6
import bpy
import math
import mathutils
import copy
if not 'Reactors' in bpy.data.groups:
bpy.ops.group.create(name="dynaLines")
def my_handler(scene):
import bpy
from bpy.types import Menu
# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)
class VIEW3D_PIE_selectMode(Menu):
# label is displayed at the center of the pie menu.
bl_label = "Select Mode"
bl_idname= "mesh.selectMode"
var distanceBetweenHoles = 50; var centerCircleDiameter = 22; var dimension = 00; // width and height var materialWidth = 3; // compute hole pattern var triLeg = distanceBetweenHoles/2; var l = Math.sqrt(triLeg*triLeg*2); var b = box(dimension, materialWidth, dimension); b = b.cut(cylinder(centerCircleDiameter/2, materialWidth)); var TAU = Math.PI*2; var a45 = Math.PI/4; var a90 = Math.PI/2 for (var i=1; i<=8; i++) { var c = cylinder(1.5, materialWidth).translate( l * Math.sin(i * a90 + a45), 0, l * Math.cos(i * a90 + a45) ); b = b.cut(c) } display(b)
@RH2
RH2 / gist:ab5fdcd6f2b3860caa30
Last active August 29, 2015 14:06
point objects in group at camera, with frame handler and world noise
import bpy
def my_handler(scene):
print("Frame Change", scene.frame_current)
if hasattr(bpy.data.groups, 'A'):
for ob in bpy.data.groups['A']:
print ob.name
locA = ob.location
locB = bpy.data.objects['A'].location
@RH2
RH2 / gist:9cbce87b41495c833488
Last active June 17, 2018 04:59
rotates object to point at another object.
import bpy
import math
import mathutils
from mathutils import Vector,Euler,Matrix,Quaternion
print("RUNNING")
def my_handler(scene):
if hasattr(bpy.data.groups, 'B'):
for ob in bpy.data.groups['B'].objects:
targetObject= bpy.data.objects['Camera']
#BEGIN GPL LICENSE BLOCK
#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 2
#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
using UnityEngine;
using System.Collections;
using System;
public class storyFrame : IComparable<storyFrame> {
public string path_background;
public string path_textBackground;
public string path_character;
public string text;