This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
# Get all non smooth edges, and cut their UVs | |
hard_edges = [e for e in pm.selected()[0].e if not e.isSmooth()] | |
pm.polyMapCut(hard_edges) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (C) Andreas Rånman | |
// | |
// File: selectHardEdgesCmd.cpp | |
// | |
// MEL Command: selectHardEdges | |
// | |
// Author: Maya Plug-in Wizard 2.0 | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def xformMirror(transforms=[], across='YZ', behaviour=True): | |
""" Mirrors transform across hyperplane. | |
transforms -- list of Transform or string. | |
across -- plane which to mirror across. | |
behaviour -- bool | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
[ExecuteInEditMode] | |
public class SDFSphere : MonoBehaviour { | |
private void Update() | |
{ | |
// Set a global value that we can use in our shader. | |
Shader.SetGlobalVector("_sdfSphere_position", this.transform.position); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class Replacer : EditorWindow | |
{ | |
[MenuItem("Window/Replacer")] | |
public static void ShowWindow() | |
{ | |
EditorWindow.GetWindow<Replacer>("Replace GameObject"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/VertexWind" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness("Smoothness", Range(0,1)) = 0.5 | |
_Metallic("Metallic", Range(0,1)) = 0.0 | |
_Normal("Normal Map", 2D) = "bump" {} | |
_CutOff("Alpha Cutoff", Range(0, 1)) = 0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation of effect described at: https://willweissman.wordpress.com/tutorials/shaders/unity-shaderlab-object-outlines/ | |
Shader "Custom/DrawSimple" { | |
SubShader{ | |
ZWrite Off | |
ZTest Always | |
Lighting Off | |
Pass { | |
CGPROGRAM | |
#pragma vertex VShader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to create symbolic links for vimfiles, allowing user download dotfiles | |
to any location. | |
$ python ~/Downloads/foo/makelinks.py | |
Symlink Created for: '/home/user/GitHub/foo/vim/.vim' -> '/home/user/.vim' | |
Symlink Created for: '/home/user/GitHub/foo/vim/.vimrc' -> '/home/user/.vimrc' | |
Symlink Created for: '/home/user/GitHub/foo/vim/.gvimrc' -> '/home/user/.gvimrc' | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pm | |
def faceNormal(): | |
""" """ | |
# Store old selection, | |
selection = pm.selected() | |
# Convert selection to faces, | |
pm.mel.ConvertSelectionToFaces() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Quick script to allow hotkeying a toggle for converting selection, to imitate the default | |
command of CTRL + F9/F10/F11. | |
""" | |
import pymel.core as pm | |
class eSelection(object): |