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
""" | |
Count the number of scriptCtx in scene, checking only default named ones. | |
""" | |
import pymel.core as pm | |
def countScriptCtx(): | |
count = 0 | |
mel_command = 'scriptCtx -ex "scriptCtx{}"' |
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
#!/usr/bin/python3 | |
import hashlib, sys | |
""" | |
Command line tool to get checksums in python. | |
Supply filepath for file to process, and which hash | |
method to use. | |
""" |
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
""" | |
Test to see that the official p4 api can be executed multithreadded | |
""" | |
# Get time so we can cause a delay, and uniform to set it to a random float, | |
from time import sleep | |
from random import uniform |
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
import modo | |
# Anonymous function to wrap the lx query | |
is_visible = lambda item: bool(lx.eval('layer.setVisibility {} ?'.format(item.id))) | |
def get_visible_meshes(): | |
meshes = modo.Scene().items(itype='mesh') # Get all mesh items in scene | |
return [mesh for mesh in meshes if is_visible(mesh)] |
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
# python | |
""" | |
Modo script to print all fire and forget scripts for the given kit to log. | |
Example:: | |
@list_kit_scripts.py my_kit |
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
""" | |
Small example for running a QWorker that sets a list | |
on completion. | |
""" | |
import time | |
import random | |
import sys |
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
""" | |
Custom Heads up display, displaying the area current selection covers in UV space. | |
found this `gist <https://gist.github.com/SEVEZ/d86bf0a4a497794a94df8f125846ca4f>`_ from SEVEZ really useful. | |
""" | |
__author__ = "Andreas Ranman" | |
import maya.cmds as cmds |
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
use std::env; // Get the standard library module for the process environment, so we can access arguments passed etc... | |
use std::fs; // Module for filesystem, so rust is aware of file objects | |
// The equation specified in the description for getting the fuel required to lift a given mass | |
fn required_fuel(mass: i32) -> i32 { | |
return mass / 3 - 2; | |
} | |
fn main(){ |
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
use std::env; | |
use std::fs; | |
fn run(mut program: Vec<i32>) -> i32 { | |
for i in (0..program.len()).step_by(4) { | |
let operation = program[i]; // Operation to use, add/mult/break | |
let a = program[i+1] as usize;// Index to get first value from | |
let b = program[i+2] as usize;// Second value | |
let r = program[i+3] as usize;// Index to store result in | |
// println!("{} {} {} {}", program[i], program[i+1], program[i+2], program[i+3]); |