float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
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 System.Collections; | |
| using System.IO; | |
| using UnityEngine.Rendering.Universal; | |
| /* | |
| Usage: | |
| 1. Attach this script to your chosen camera's game object. | |
| 2. Set that camera's Clear Flags field to Solid Color. | |
| 3. Use the inspector to set frameRate and framesToCapture |
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 System.Collections; | |
| using System.IO; | |
| /* | |
| Usage: | |
| 1. Attach this script to your chosen camera's game object. | |
| 2. Set that camera's Clear Flags field to Solid Color. | |
| 3. Use the inspector to set frameRate and framesToCapture |
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 math | |
| import maya.api.OpenMaya as om | |
| from pymel.core import * | |
| from pymel.core.datatypes import * | |
| def createBoundingCircle(meshfn): | |
| """Parameter: meshfn - MFnMesh | |
| Represent a face by a center and radius, i.e. | |
| center = [center1u, center1v, center2u, center2v, ... ] | |
| radius = [radius1, radius2, ... ] |
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
| # coding: utf-8 | |
| u""" | |
| Maya 2017 workspaceControl の問題回避のサンプル。 | |
| workspaceControl と workspaceControlState のゴミが残らないようにする。 | |
| retain=False の場合でも何故か state のゴミが残ってしまうが、 | |
| scriptJob で workspaceControl の削除を監視して state も同時に削除するようにする。 | |
| retain=True の場合は、UI が閉じたとしても state は残って良いはずなので監視はしない。 |
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 maya.cmds as mc | |
| def _null(*args): | |
| pass | |
| class _shelf(): | |
| '''A simple class to build shelves in maya. Since the build method is empty, | |
| it should be extended by the derived class to build the necessary shelf elements. |