Skip to content

Instantly share code, notes, and snippets.

View teessider's full-sized avatar

Andrew Bell teessider

View GitHub Profile
@teessider
teessider / max_2015_pyside_window_eg.py
Last active February 25, 2019 16:52
Example 3ds Max 2015 PySide Window which is a child of another PySide Window. NOTE: OtherModule is where the Parent window class would be (of course this could be a PySide Window). The show() method at the end can be removed and connected to another script.
import ctypes
from PySide import QtGui
from PySide import QtCore
import MaxPlus
import OtherModule
GWL_HWNDPARENT = -8
## STANDALONE Window (normal Python)
# From Base Class
if __name__ == '__main__':
import sys
try:
application = QtGui.QApplication(sys.argv)
pyside_window = PySideWindow() # Example PySide Window - This needs to be in as a variable! It initialises then ;)
pyside_window.show()
sys.exit(application.exec_())
except SystemExit:
@teessider
teessider / pyScript_window.ms
Last active January 15, 2019 13:42
For 3ds Max 2015 - A small window which takes a python command or location of a python file and executes it when enter is pressed. A small alternative to using the MAXScript Listener only.
try(DestroyDialog pythonScriptWindow)catch()
fn py_exec txt_ui =
(
try
(
if (doesFileExist txt_ui) then
--This accepts normal Windows file paths! No need for escape characters like in MAXScript
py_cmd = python.ExecuteFile(txt_ui) clearUndoBuffer:false
else
@teessider
teessider / UnityAttributeExample.cs
Last active November 29, 2015 20:28
Unity C# Attributes Example. Attach this to a gameobject in your hierarchy to see what the built-in Unity attributes do
using UnityEngine;
using System.Collections;
public class AttributeExample : MonoBehaviour
{
// The Header attribute takes a string as the header makes it bold.
[Header("Variables")]
public int exampleInteger = 3;
public float exampleFloat = 3.5f;
public string exampleString = "I'm a string!";
@teessider
teessider / tsab_myMatBatchRender.ms
Last active August 29, 2015 14:27
MAXScript - Example Material Batch Render. This script runs through and renders the assets with different materials that you specify also uses the object and material names for the filename.
/*
tsab_myMatBatchRender.ms
Example Material Batch Render Script in 3ds Max 2014
For my blog post on using MAXScript for automation in 3ds Max:
http://www.andybellart.co.uk/blog/tech/maxscript/a-maxscript-persective-the-power-of-automation#more-286
Developed by Andrew "teessider" Bell
Copyright 2015
@teessider
teessider / CreatePrefabEditor.cs
Last active August 29, 2015 14:27
Unity API Example in C# - PrefabUtility.CreateEmptyPrefab & PrefabUtility.ReplacePrefab. You will need to put this in Assets/Editor (make it if it doesn't already exist) as this is a Editor script.
using UnityEngine;
using UnityEditor;
public class CreatePrefabEditor
{
/* Example from Unity API Documentation for:
* PrefabUtility.CreateEmptyPrefab (Looks like a duplicate example) &
* PrefabUtiltiy.ReplacePrefab
* Converted from UnityScript to C#
*