Skip to content

Instantly share code, notes, and snippets.

View donovankeith's full-sized avatar

Donovan Keith donovankeith

View GitHub Profile
@donovankeith
donovankeith / SelectPhongEdgesExpression.pyp
Created October 21, 2016 20:22
Code for a Cinema 4D Python Expression Tag that automatically selects edges based on the angle between adjoining faces.
"""Select Phong Edges Expression
Selects any edges w/ broken phong shading.
Last Modified: 2016-10-21
v0.0.1
By Donovan Keith for MAXON USA
Usage Instructions
@donovankeith
donovankeith / ToggleLight.cs
Created February 8, 2017 23:31
C# Unity Script: Toggles a light on/off when user presses the `L` key.
// ToggleLight.cs
// Turns the light component of this object on/off when the user presses and releases the `L` key.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ToggleLight : MonoBehaviour {
Light light;
@donovankeith
donovankeith / ArduinoOSC.ino
Last active January 9, 2023 23:35
Simple test project for driving RGB led with OSC messages.
/*
Send and receive OSC messages between NodeMCU and another OSC speaking device.
Send Case: Press a physical button (connected to NodeMCU) and get informed about it on your smartphone screen
Receive Case: Switch an LED (connected to NodeMCU) on or off via Smartphone
Written by Jackson Campbell <jcampbell@calarts.edu>
Modified by Donovan Keith <dkeith@calarts.edu>
for [Augmenting Realities](https://sites.google.com/view/augmentingrealities/home)
@donovankeith
donovankeith / print-media-assets-in-category.py
Last active November 6, 2022 23:16
Prints a list of Media Assets in the Cinema 4D Assets Browser to the Console
"""Name-en-US: Print Media in Category
Description-en-US: Prints a list of all media assets belonging to a category ID to the console.
References:
https://plugincafe.maxon.net/topic/14214/get-asset-from-asset-browser-python/4
## License
MIT No Attribution
# Example of using the Cinema 4D Tree View GUI in Python.
# Originally written by Niklas Rosenstein
# Modifications by Donovan Keith
import c4d
import os
import weakref
# Be sure to use a unique ID obtained from http://www.plugincafe.com/.
PLUGIN_ID = 9912399
@donovankeith
donovankeith / PositionInspector.cs
Created February 3, 2022 18:08
Unity Script for Inspecting Position of an Object and Printing to GUI
// PositionInspector.cs
// Prints the position of `targetObject` to the `text` field
// of a Text Mesh Pro text object.
//
// ## Usage
//
// 1. Create a Text Mesh Pro Text Game Object (or select one if it already exists).
// 2. Add this script.
// 3. Link the object whose position you want to inspect in the "targetObject" field.
// 4. Press Play
@donovankeith
donovankeith / ScrubAnimation.cs
Created September 28, 2017 08:48
A Unity Script for Scrubbing Animations
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ScrubAnimation : MonoBehaviour {
private Animator anim;
public string animClipName;
float normalizedTime = 0f;
@donovankeith
donovankeith / IOTButtonForIFTT.ino
Last active October 30, 2020 22:33
Arduino IoT Button with the LoLin Node MCU v3
/**
* IOTButtonForIFTT.ino
* Connects to Wifi, Retrieves a URL, Blinks LED on if Successful
* Be sure to adjust the User Inputs below.
*
* 2017/11/16 Modified by
* Donovan Keith <donovanskeith@gmail.com>
*
* Based On:
* BasicHttpClient.ino by
@donovankeith
donovankeith / ObjectBrowser.pyp
Created June 17, 2016 18:55
A Cinema 4D Python TreeView example that supports Shift Clicking and Up/Down Arrows.
"""ObjectBrowser
Based on: https://developers.maxon.net/?p=439"""
# ====== IMPORTS ====== #
import c4d
# ====== GLOBALS ====== #
@donovankeith
donovankeith / README.md
Last active September 3, 2018 22:03
Variable Framerate .mov to 30 fps mp4 Converter Batch Script Generator

FFmpeg Convert to non-variable 30 FPS MP4

NOTE: For the most recent version of this Script, please go to this GitHub Gist

This Python Script searches for all video files matching a specific pattern in the same directory (sub-directories not included) and then generates a Windows Batch Script (UseOnce.cmd) you can then execute to convert those matching video files into Non-Variable 30fps MP4s.

Background

At Cineversity.com we often find ourselves converting large numbers of poorly formed .mov files to 30 FPS non-variable .mp4 files