Skip to content

Instantly share code, notes, and snippets.

View stephensmitchell's full-sized avatar
🎯
Focusing

Stephen S. Mitchell stephensmitchell

🎯
Focusing
View GitHub Profile
@stephensmitchell
stephensmitchell / index.html
Created May 1, 2022 04:14
Three.js+ImGui JavaScript
<canvas id="output" tabindex="1"></canvas>
@stephensmitchell
stephensmitchell / shell.ipynb
Created April 15, 2022 16:10 — forked from nikhilkumarsingh/shell.ipynb
Running shell commands using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stephensmitchell
stephensmitchell / recover-scene.py
Created March 20, 2022 06:12
This script imports a Cinema 4D scenefile and disables all deformers, generators and expressions. This is useful if the scene was saved at a state it is unrecoverable because of an issue while scripting (eg. saved the scene before a Python tag was executed, but now that Python tag always runs in an # infinite loop).
# Copyright (c) 2013, Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@stephensmitchell
stephensmitchell / gist:02ef135a65c7e586ae3653e81e7079db
Last active October 18, 2021 06:23 — forked from sbaer/gist:1023456
Get world points from mouse cursor position
import scriptcontext
import time
import System
import Rhino
rc, view = Rhino.Input.RhinoGet.GetView("select view")
print "position mouse where you want"
for i in [5,4,3,2,1]:
@stephensmitchell
stephensmitchell / App.svelte
Created October 6, 2021 02:16 — forked from jasonsturges/App.svelte
3D with Svelte and Three.js
<script>
import { onMount } from 'svelte';
import { createScene } from "./scene";
let el;
onMount(() => {
createScene(el)
});
</script>
@stephensmitchell
stephensmitchell / basic_ui_documented.py
Created September 19, 2021 08:42 — forked from tin2tin/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
#import the bpy module to access blender API
import bpy
#WARNING: this is written and tested for blender 2.79
#blender 2.8 and newer will likely have a different python API
#create a property group, this is REALLY needed so that operators
#AND the UI can access, display and expose it to the user to change
#in here we will have all properties(variables) that is neccessary
class CustomPropertyGroup(bpy.types.PropertyGroup):
@stephensmitchell
stephensmitchell / basic_ui_documented.py
Created September 19, 2021 08:42 — forked from AzureDVBB/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
#import the bpy module to access blender API
import bpy
#WARNING: this is written and tested for blender 2.79
#blender 2.8 and newer will likely have a different python API
#create a property group, this is REALLY needed so that operators
#AND the UI can access, display and expose it to the user to change
#in here we will have all properties(variables) that is neccessary
class CustomPropertyGroup(bpy.types.PropertyGroup):
@stephensmitchell
stephensmitchell / create-png.sh
Last active January 10, 2023 16:46 — forked from osuka/create-png.sh
Create hi-res versions of images with Inkscape and Crop them with Gimp
#!/bin/bash
howmany=`ls *.svg|wc -l`
if [ $howmany -eq 0 ] ; then
echo "Please launch this from inside a folder with svg files."
exit
fi
# In Mac OS X scripting only works when invoked with FULL PATH