Skip to content

Instantly share code, notes, and snippets.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
bl_info = {
"name": "FreeCAD Importer",
"category": "Import-Export",
"author": "Yorik van Havre",
"version": (4, 0, 0),
"blender": (2, 80, 0),
"location": "File > Import > FreeCAD",
"description": "Imports a .FCStd file from FreeCAD",
"warning": "You need a version of FreeCAD compiled with the same Python version as Blender. Only Part- and Mesh-based objects are supported at the moment",
}
@rocksonchan
rocksonchan / asc2ply.cpp
Created February 9, 2019 03:01 — forked from keijiro/asc2ply.cpp
A small utility that converts .asc point cloud file into binary-LE .ply file.
#include <deque>
#include <fstream>
#include <iostream>
#include <memory>
namespace
{
struct Point
{
float x, y, z;
@rocksonchan
rocksonchan / ies2cycles.py
Created June 22, 2018 07:11 — forked from AngryLoki/ies2cycles.py
IES to Cycles addon for new nodetree system! It only works for trunk builds of blender 2.66 and later versions!!! Thread on blenderartists.org: http://blenderartists.org/forum/showthread.php?276063 Old outdated version (no rig) for official 2.66 release (old nodetrees): https://gist.github.com/Lockal/5313485
# ##### 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
@rocksonchan
rocksonchan / gist:feee092a7717475cdf4732ca45187329
Created June 17, 2018 04:59 — forked from RH2/gist:9cbce87b41495c833488
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']
import bpy
import bmesh
def print_details(num_edges, edge_length):
print("number of edges: {0}".format(num_edges))
print("combined length: {0:6f}".format(edge_length))
def get_combined_length(object_reference):