Skip to content

Instantly share code, notes, and snippets.

View donovankeith's full-sized avatar

Donovan Keith donovankeith

View GitHub Profile
@donovankeith
donovankeith / WeldCubePoints.py
Created November 9, 2016 19:36
Welds the points of a cube so that it looks like a tent.
"""Weld Cube Points
Welds cube points together.
Usage Instructions:
1. Create some cubes.
2. Make them editable
3. Run this script.
"""
import c4d
@donovankeith
donovankeith / ShaderBrowser.pyp
Created June 15, 2016 23:29
Example of TreeViews in Cinema 4D from Tree Views Made Easy Pt I & II
"""ShaderBrowser
Based on: https://developers.maxon.net/?p=439"""
# ====== IMPORTS ====== #
import c4d
# ====== GLOBALS ====== #
@donovankeith
donovankeith / ArduinoSerialIO.cs
Last active October 19, 2017 23:29
Unity Arduino Input/Output
/* Arduino Serial I/O
* Allows you to send simple commands to an arduino and to receive data back.
*
* Source based on: https://www.alanzucconi.com/2015/10/07/how-to-integrate-arduino-with-unity/
*
* ## Setup
* 1. Edit > Player Settings
* 2. .NET Compatibility Level = `.NET 2.0`
*/
@donovankeith
donovankeith / PrimitiveMover.cs
Created April 5, 2017 22:56
Simple Example of Enums and Switch Statements
// PrimitiveMove.cs
// Creates a simple primitive in Unity and moves it in a user-selected driection.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrimitiveMover : MonoBehaviour {
public enum Shape {Box, Ball, Pill};
@donovankeith
donovankeith / Fade.cs
Created March 1, 2017 08:23
Fades light intensity Up/Down when you press the Up/Down arrow keys.
// Fade.cs
// Fades light intensity Up/Down when you press the Up/Down arrow keys.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fade : MonoBehaviour {
// User Inputs
@donovankeith
donovankeith / MousePaint.cs
Created February 9, 2017 01:58
MousePant: A simple unity script for cloning objects as you click/drag.
// MousePaint.cs
// Paints objects when you click and drag.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MousePaint : MonoBehaviour {
public GameObject stamp;
@donovankeith
donovankeith / RGBLight.cs
Created February 8, 2017 23:28
Unity Script: Changes light to Red/Green/Blue when user press `R`, `G`, or `B` keys.
// RGBLight.cs
// Changes light to Red/Green/Blue when user press `R`, `G`, or `B` keys.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RGBLight : MonoBehaviour {
Light light;
@donovankeith
donovankeith / setnewselection.py
Created January 11, 2017 01:22
CV-Set New Selection Cinema 4D Script
"""Name-US: CV-Set New Selection
Description-US: Deslects all tags and runs the Set Selection command.
Installation:
-------------
1. Save this to a file called "setnewselection.py" in your C4D Scripts Folder
2. Restart Cinema 4D
"""Treeview Dialog
UltraSimple Treeview Example. Displays a list of Greek letters you can select and delete.
MIT License
Copyright (c) 2016 Donovan Keith
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