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 | |
# -*- coding: utf-8 -*- | |
import modo | |
def create(): | |
""" Modo TD SDK example of creating a cube item, | |
Not recommended but one can run this as a fire-and-forget like.. |
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 lx | |
class PreferenceValue(object): | |
""" Context manager for setting temporary pref.value(s) during a context. | |
:param preferences: preferences to use for the context. | |
:type preferences: dict | |
Example:: |
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
""" | |
Example of how to dynamically change a Form List Command. | |
We will implement a button that emits a notifier, which our form list | |
command will listen for when notified, it will refresh. | |
""" | |
import random |
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; | |
use std::ops; | |
use std::collections::HashSet; | |
use std::collections::HashMap; | |
#[derive(Clone, Copy, Hash, Eq, PartialEq, Debug)] | |
struct Point(i32, i32); | |
impl Point { |
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]); |
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
""" | |
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
""" | |
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
""" | |
Functions for editing the texel density | |
https://80.lv/articles/textel-density-tutorial/ | |
""" | |
import math | |
import maya.cmds as mc |
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 |