Skip to content

Instantly share code, notes, and snippets.

@Roumenov
Roumenov / anim_curve_anchor.py
Created November 18, 2019 06:27
blocking out thoughts for a useful animation curve utility
start_time = 0
end_time = 10
keyed_channels = get_keyed_channels()
for curve in keyed_channels:
#what is the best method to select the target keys?
#select keys in range(start_time,end_time)
@Roumenov
Roumenov / constraints.py
Created February 5, 2020 10:55
messing around with storing constraint values to rebuild later
target = pm.ls(sl=1)[0]
constraint = set(pm.listConnections(source = True, type = 'constraint')).pop()
print(constraint.Target)
sources = list(set(constraint.listConnections(source = True, type = 'transform')))
sources.remove(target)
source_weight = {}
for item in sources:
@Roumenov
Roumenov / file_renamer.py
Last active March 1, 2020 13:48
primitive procedure to rename a bunch of files that broke with naming convention
import shutil, os
current_directory = os.getcwd()
filename = 'output.txt'
for file in os.listdir(current_directory):
active = file.replace('_idle', '_act')
print(active)
if '_idle' in file and not os.path.isfile(active):
output = file.replace('_idle','_act')
@Roumenov
Roumenov / maya_add_menu.py
Last active March 5, 2020 09:12
simple proc for making a custom menu in maya
import maya.cmds as mc
main_window = pm.language.melGlobals['gMainWindow']
menus = mc.window(main_window, query=True, menuArray=True)
if menu_name in menus:
mc.deleteUI(menu_name, menu=True)
mc.menu(menu_name,
parent=main_window,
label="Foo",
tearOff=True)
@Roumenov
Roumenov / correct_anim_offset.py
Created March 5, 2020 09:28
simple proc to offset keys
import pymel.core as pm
targets = ['Corsac_R_brow_CTL_04', 'Corsac_R_brow_CTL_03', 'Corsac_R_brow_CTL_02', 'Corsac_R_brow_CTL_01']
controls = pm.ls(targets, recursive = True)
for item in controls:
pm.selectKey(item, attribute = 'rotateZ', replace = True)
pm.keyframe(edit = True, relative = True, valueChange = -180.0)
@Roumenov
Roumenov / eye_attr_setup.py
Created September 29, 2020 04:40
messing around with creating attributes to drive shader params
eye_ramp = pm.ls('geo:R_eye_ramp')[0]
eye_joints = pm.ls(sl=1)
eye_control = pm.ls(sl=1)[0]
#checked items fill list of attrs
#'blink'
eye_parts = ('pupil', 'iris') #'offset'
eye_attrs = ('radius', 'shape', 'angle', 'stretch')
#pm.addAttr(longName = 'iris', type = 'float')
@Roumenov
Roumenov / maya_reference_cleanup.py
Last active October 4, 2020 03:12
procedure to clean up messy references
import pymel.core as pm
import vo_maya.core.vo_export as voe
reload(voe)
pm.ogs(pause=True)
controls = [u'Roxanne_rWristFKC', u'Roxanne_rUpperLegCurveC', u'Roxanne_rUpperLegCurve3C', u'Roxanne_rUpperLegCurve2C', u'Roxanne_rUpperLegCurve1C', u'Roxanne_rUpperArmCurve3C', u'Roxanne_rUpperArmCurve2C', u'Roxanne_rUpperArmCurve1C', u'Roxanne_rLowerLegCurveC', u'Roxanne_rLowerLegCurve3C', u'Roxanne_rLowerLegCurve2C', u'Roxanne_rLowerLegCurve1C', u'Roxanne_rLowerArmCurve3C', u'Roxanne_rLowerArmCurve2C', u'Roxanne_rLowerArmCurve1C', u'Roxanne_rKneeFKC', u'Roxanne_rKneeCurveC', u'Roxanne_rElbowFKC', u'Roxanne_rBallFKC', u'Roxanne_rAnkleFKC', u'Roxanne_lWristIKC', u'Roxanne_lUpperLegCurveC', u'Roxanne_lUpperLegCurve3C', u'Roxanne_lUpperLegCurve2C', u'Roxanne_lUpperLegCurve1C', u'Roxanne_lUpperArmCurve3C', u'Roxanne_lUpperArmCurve2C', u'Roxanne_lUpperArmCurve1C', u'Roxanne_lLowerLegCurveC', u'Roxanne_lLowerLegCurve3C', u'Roxanne_lLowerLegCurve2C', u'Roxanne_lLowerLegCurve1C', u'Roxanne_lLowerArmCurve3C', u'Roxanne_lLow
@Roumenov
Roumenov / ref_cleanup.py
Created July 5, 2021 21:07
because the replace_target_reference() function wasn't well thought out
import pymel.core as pm
import vo_maya.core.vo_export as voe
reload(voe)
#replace namespace
voe.replace_target_namespace("mesh", "r")
voe.replace_target_namespace("rig", "r")
voe.replace_target_namespace("char", "r")
@Roumenov
Roumenov / pymel_constraints_history.py
Created January 5, 2022 20:58
maya constraints and navigating history/connections
import pymel.core as pm
object1 = pm.spaceLocator(relative = 1, position = (0,1,0))
object2 = pm.spaceLocator(relative = 1, position = (1,0,0))
constraint = pm.parentConstraint(object1,object2, maintainOffset = True)
#so, this first one returns nothing from my object
pm.listHistory(allConnections = True, type = 'constraint')
object2.listHistory(allConnections = True, type = 'constraint')
#idk if the params are wrong or what, but it doesn't get me shit
@Roumenov
Roumenov / hitchhikers-guide-to-machine-learning.md
Created February 9, 2022 00:24 — forked from daksis/hitchhikers-guide-to-machine-learning.md
Hitchhikers Guide to Machine Learning Resources

Hitchhikers Guide to Machine Learning Resources

Reference Sources

  1. Project Rhea — online learning community where students teach other students. The tutorials here vary in detail and quality. Generally they are more that a definition at mathworld, less than a step by step. Good for getting the highlights on an unfamiliar topic
  2. Wolfram Mathworld — Like wikipedia, but only for Math. Go here when you have no idea what an "Isotopic Kernel is or why you would care. Mathworld will give you 80+ entries that are linked.
  3. Wikipedia Math Portal — the place to find everything math related on Wikipedia.

Math References