Skip to content

Instantly share code, notes, and snippets.

View alankent's full-sized avatar

Alan Kent alankent

View GitHub Profile
// JavaScript code for Adobe Illustrator ExtendScript
// Get a handle to the current document
var doc = app.activeDocument;
// Start building up the USDA file
var usda = """#usda 1.0
(
defaultPrim = "World"
endTimeCode = 100
@alankent
alankent / digit.usda
Created May 9, 2024 06:26
Sample USDA file for Omniverse to display the current time
#usda 1.0
(
customLayerData = {
dictionary cameraSettings = {
dictionary Front = {
double3 position = (0, 0, 50000)
double radius = 500
}
dictionary Perspective = {
double3 position = (2.608882581066693, 76.82853537187964, 358.0637042180103)
@alankent
alankent / extension.py
Created May 10, 2023 05:20
Main script from an extension to fix USD import of GLB characters in NVIDIA Omniverse (it is not fully working)
# Made using: https://youtu.be/eGxV_PGNpOg
# Lessons learned
# - work out your package name first (it affects directory structure)
# - DeletePrims references Sdf which is not imported for you
import omni.ext
import omni.ui as ui
import omni.kit.commands
from pxr import Usd, Sdf, Gf
@alankent
alankent / MoveAnimatedCharacterMenuItem.cs
Created February 16, 2023 20:55
Simple Unity script to capture an object position delta movement so you can easily apply it by exiting Timeline preview mode
using System.Linq;
using UnityEditor;
using UnityEditor.Timeline;
using UnityEditor.Timeline.Actions;
using UnityEngine;
using UnityEngine.Timeline;
// Adding a new menu item to the move/rotate etc commands would be cooler!
// https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/GUI/Tools/BuiltinTools.cs
using System.Linq;
using UnityEditor;
using UnityEditor.Timeline;
using UnityEditor.Timeline.Actions;
using UnityEngine;
using UnityEngine.Timeline;
// Adding a new menu item to the move/rotate etc commands would be cooler!
// https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/GUI/Tools/BuiltinTools.cs
using UnityEngine;
using UnityEditor.Timeline;
using UnityEngine.Sequences.Timeline;
using UnityEngine.Timeline;
namespace UnityEditor.Sequences.Timeline
{
[CustomTimelineEditor(typeof(ProgressClip))]
public class ProgressClipEditor : ClipEditor
{
using UnityEngine;
using UnityEditor;
using UnityEngine.Timeline;
using UnityEngine.Playables;
using System.Collections.Generic;
using UnityEditor.Timeline;
using uOSC;
using UnityEngine.Events;
using EVMC4U;
using VRM;
using UnityEngine;
using UnityEditor;
using UnityEngine.Timeline;
using UnityEngine.Playables;
using System.Collections.Generic;
using UnityEditor.Timeline;
public class MyAssemblyWindow : EditorWindow
{
[MenuItem("Window/Alan Tools/Assembly")]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AlansBlendShapeClipVowels : MonoBehaviour
{
[Range(0f, 1f)] public float A;
[Range(0f, 1f)] public float E;
[Range(0f, 1f)] public float I;
[Range(0f, 1f)] public float O;
using System.Collections;
using System.Collections.Generic;
using UniGLTF;
using UnityEngine;
using VRM;
// This component goes on VRoid character root for animating where the eyes look at.
// The eyes can look between different targets or at specified left/right/up/down position.
// The idea is this scripts controls the position of a separate target object that must be created in the scene that the VRM look at scripts then specify as their look at target.
// That is, this does not modify what the eyes look at directly, but rather moves a target object that that eyes must look at.