Skip to content

Instantly share code, notes, and snippets.

View pmolodo's full-sized avatar

Paul Molodowitch pmolodo

  • NVIDIA
  • Los Angeles, CA
View GitHub Profile
@pmolodo
pmolodo / install_stgit.sh
Last active June 6, 2024 18:26
Installing stgit / stg / stackedgit from source (because ubuntu package is way out of date - 0.19)
#!/bin/bash
set -e
set -u
# install rust
if ! which cargo >/dev/null 2>&1 ; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
@pmolodo
pmolodo / testReparsePoint.ps1
Created March 14, 2024 19:03
Test presence of ReparsePoint file attribute on junctions, and children of junctions
Set-StrictMode -Version 1.0
$THIS_FILE = [System.IO.FileInfo]$MyInvocation.MyCommand.Path
$THIS_DIR = $THIS_FILE.Directory
Write-Host $THIS_DIR
$TEST_ROOT = "${THIS_DIR}\test_root"
@pmolodo
pmolodo / git_ancestry_path_with_multiple_negations.bash
Created December 11, 2020 22:23
git --ancestry-path behavior with multiple negations
#!/bin/bash
set -e
mkdir ancestry_path_test
cd ancestry_path_test
git init
git checkout -b root
echo "R1" > root_file
@pmolodo
pmolodo / CMakeLists.txt
Last active January 18, 2020 01:10
Test of separate_arguments
cmake_minimum_required(VERSION 3.12.0)
enable_testing()
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(IS_WINDOWS TRUE)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(IS_LINUX TRUE)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(IS_MACOSX TRUE)
@pmolodo
pmolodo / separate_arguments_test.cmake
Created December 9, 2019 19:52
separate_arguments_test.cmake
set(mylist
"first item"
"second-item"
)
message("mylist: ${mylist}")
# mylist: first item;second-item
separate_arguments(mylist_sep WINDOWS_COMMAND "${mylist}")
message("mylist_sep: ${mylist_sep}")
# mylist_sep: first;item\;second-item
@pmolodo
pmolodo / cmake_quoting_test.cmake
Last active February 2, 2020 02:45
cmake_quoting_test
#! /usr/bin/env cmake -P
cmake_minimum_required(VERSION 2.8)
# This results in this output:
# -- ========================
# -- empty_var: ""
# -- -------
# -- Unquoted parsing: print_args()
# -- ARGC: 0
# -- -------
@pmolodo
pmolodo / merge_al.bash
Last active September 24, 2024 18:45
Scripts for helping with merging issues for Maya-USD and "old" Pixar and Animal Logic Repos
# change to git root dir
cd "$(git rev-parse --show-toplevel)"
# Some commit reference points:
# 19a1e755c258c9ac0d7495fa0add62508ff377a1 - plugins/AL_USDMaya (initial import of pixar from submodule)
# 825ca13dd77af84872a063f146dee1799e8be25c - plugins/AL_USDMaya (some removals)
# 141bab7eba1d380868e822a51f8c8f85e1c0b66f - plugins/AL_USDMaya (identical contents as above)
# e5e10a28d0ba0535e83675399a5d15314fb79ec9 - plugin/al (renamed dir)
@pmolodo
pmolodo / testPolyComponentIdChanged.py
Created May 16, 2019 01:02
Removing a addPolyComponentIdChangedCallback can cause a crash (Maya 2019)
#execfile('/Volumes/home/paulm/Desktop/testPolyComponentIdChanged.py')
import maya.cmds as cmds
import maya.api.OpenMaya as om
cmds.file(f=1, new=1)
cubeTrans = cmds.polyCube()[0]
cubeShape = cmds.listRelatives(cubeTrans)[0]
sel = om.MSelectionList()
sel.add(cubeShape)
@pmolodo
pmolodo / UVCubeMap.cs
Last active February 20, 2019 16:22
Example of how to map different parts on one texture onto a cube in Unity - thanks alucardj
// For thread / original UnityScript version, see
// https://answers.unity.com/questions/306959/uv-mapping.html
using UnityEngine;
public class UVCubeMap : MonoBehaviour
{
// using an image that is an 8x8 grid
// each image is 0.125 in width and 0.125 in height of the full image
@pmolodo
pmolodo / MAnimCurveChange_bug.py
Created December 21, 2018 01:00
Maya bug report: MAnimCurveChange for an MFnAnimCurve.setTime does not work after undoing/redoing an addKeys
# test AnimCurve.setTime undo/redo - api only
import maya.OpenMaya as om
import maya.OpenMayaAnim as oma
import maya.cmds as cmds
cmds.file(new=1, f=1)
curve = cmds.createNode('animCurveTL')