Skip to content

Instantly share code, notes, and snippets.

@Roumenov
Roumenov / mash_volume.py
Created January 2, 2023 22:47
messing with MASH, stumbling through some major confusion
import MASH.editor; MASH.editor.updateMASHEditor()
import MASH.api as mapi
import pymel.core as pm
# there's no reason to use pm, force of habit
# best to use cmds for implementation
name = pm.ls(sl=1)[0].name()
MASH.deleteMashNode.deleteMashNode('MASH1')
network_mash = mapi.Network()
@Roumenov
Roumenov / maya_layer-vis.py
Created August 20, 2022 09:23
iterate visibility layers and turn them off(seems to make a difference for performance when running batch ops on scenes). Haven't profiled so who knows, but things that crashed now don't. Practical heuristic 🙃
import pymel.core as pm
layers = pm.ls(type="displayLayer")
for item in layers:
if 'defaultLayer' in item.name():
pass
else:
current_viz = item.getAttr("visibility")
print(item, current_viz)
@Roumenov
Roumenov / maya_read-write-xml.py
Created August 20, 2022 08:14
just trying to get the xml files for skinweights
import pymel.core as pm
import vo_maya.core.vo_export as voe
reload(voe)
def weights_to_xml(object, xmlpath):
xmlfilename = object.name().split(':')[1] + ".xml"
pm.deformerWeights(xmlfilename, path = xmlpath, ex = 1, deformer = object.listHistory(type = 'skinCluster')[0])
def xml_to_weights(filename, xmlpath):
meshname = filename.split('.')[0]
@Roumenov
Roumenov / genchar_export-thing-0000.py
Created August 20, 2022 08:10
some steps i need to put into the export functions because i keep repeating them but the manual cleanup hasn't been solved for yet
#assumes target objects are selected, but really they should be found from network nodes
root = pm.group(name = 'GenChar')
voe.import_references()
pm.select(root, r=1)
pm.mel.eval('searchReplaceNames "Fkel_" "Skel_" "hierarchy";')
pm.mel.eval('isolateSelect -state 1 modelPanel4;')
#double check which pane
@Roumenov
Roumenov / ResetMayaUVWindow.mel
Created August 9, 2022 16:48
that command i always forget for resetting window position in maya
window -e -tlc 1 1 polyTexturePlacementPanel1Window;
@Roumenov
Roumenov / test.ipynb
Created February 9, 2022 00:25 — forked from DraconianLore/test.ipynb
jupyter-test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Roumenov
Roumenov / github-py.ipynb
Last active February 9, 2022 00:25 — forked from gnestor/github-py.ipynb
A notebook for generating a Jupyter Notebook release changelog and credits
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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

@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 / 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")