Skip to content

Instantly share code, notes, and snippets.

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