This file contains 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
/** | |
* put this class in a folder named 'editor' | |
* (somewhere in Assets folder) | |
*/ | |
class ImportSettings extends AssetPostprocessor { | |
function OnPreprocessModel() { | |
var importer:ModelImporter = assetImporter as ModelImporter; | |
var name = importer.assetPath.ToLower(); |
This file contains 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
// this will check whether t, or one of its ancestors, | |
// have non uniform scale. | |
function hasNonUniformAncestor(t:Transform){ | |
while(t){ | |
if(isNonUniformScale(t.localScale))return true; | |
t = t.parent; | |
This file contains 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 TEA DE SOUZA 2014. Free to use and | |
# modify, do not remove this notice. | |
# ============================================================= | |
# | |
# Export a copy of the current file to the OUTPUT folder. | |
# Only the specified LAYERS are exported. | |
# The current file will be saved before exporting. | |
# | |
# ============================================================= |
This file contains 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
bl_info = { | |
"name": "Move X Axis", | |
"category": "Object", | |
} | |
import bpy | |
class ObjectMoveX(bpy.types.Operator): | |
"""My Object Moving Script""" # blender will use this as a tooltip for menu items and buttons. |
This file contains 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
def outputDir(): | |
p = os.path.dirname(bpy.data.filepath) | |
p = os.path.join(p,"export_config.txt") | |
p = open(p,'r').read() | |
return p; |
This file contains 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
function OnPointerClick(event:UnityEngine.EventSystems.PointerEventData){ | |
Debug.Log("pointer clicked: "+gameObject); | |
Debug.Log("Position: "+event.worldPosition); | |
} |
This file contains 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; | |
public class Orientation : MonoBehaviour { | |
Vector3 pitchYawRoll{ | |
get{ | |
return new Vector3(pitch,yaw,roll); | |
} | |
set{ |
This file contains 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
# IMPORTANT: make sure no animation is assigned | |
# to the rig before you run this script, | |
# otherwise linked animation data will be corrupted. | |
import bpy | |
# ---------------------------------- | |
# Mixamo left/right bone names start with 'Left'/'Right' | |
# Instead we apply Blender's standard .L/.R suffix | |
# and get rid of long suffix |
This file contains 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
#include <iostream> | |
#define SAFE_LOG_FIRST_N(arg,n) \ | |
do{ \ | |
static int LOG_OCCURRENCES = 0; \ | |
if (LOG_OCCURRENCES <= n) ++LOG_OCCURRENCES; \ | |
if (LOG_OCCURRENCES <= n) std::cout<<arg; \ | |
} while(0) | |
#define LOG_FIRST_N(arg,n) \ |
This file contains 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; | |
public class PUNNetworkController : MonoBehaviour { | |
void Start(){ PhotonNetwork.ConnectUsingSettings("v4.2"); } | |
void OnJoinLobby(){ StartGame (); } | |
void OnConnectedToMaster(){ StartGame (); } | |
void StartGame(){ PhotonNetwork.JoinRandomRoom(); } | |
void OnPhotonRandomJoinFailed(){ PhotonNetwork.CreateRoom("MyMatch"); } | |
void OnPhotonCreateGameFailed(){ Debug.LogError ("Create game failed"); } |
OlderNewer