mel

How can I clear the Maya Script Editor programatically?

戏子无情 提交于 2021-02-07 20:35:45
问题 While creating and debugging scripts, I generate lots of feedback for myself, but if I don't clear the Script Editor, I can get confused about which attempt the feedback I'm looking at came from. Is there a way (preferably with PyMEL, but MEL is ok) to clear the Script Editor History? 回答1: Try: cmds.scriptEditorInfo(ch=True) Or (PyMEL version): import pymel.core as pm pm.scriptEditorInfo(clearHistory=True) You should also take a look at python's built-in logging module. It allows you to

How can I clear the Maya Script Editor programatically?

家住魔仙堡 提交于 2021-02-07 20:32:37
问题 While creating and debugging scripts, I generate lots of feedback for myself, but if I don't clear the Script Editor, I can get confused about which attempt the feedback I'm looking at came from. Is there a way (preferably with PyMEL, but MEL is ok) to clear the Script Editor History? 回答1: Try: cmds.scriptEditorInfo(ch=True) Or (PyMEL version): import pymel.core as pm pm.scriptEditorInfo(clearHistory=True) You should also take a look at python's built-in logging module. It allows you to

Why 128 mel bands are used in mel spectrograms?

六月ゝ 毕业季﹏ 提交于 2020-06-29 06:42:19
问题 I am using the mel spectrogram function which can be found here:Mel Spectrogram Librosa I use it as follows: signal = librosa.feature.melspectrogram(y=waveform, sr=sample_rate, n_fft=512, n_mels=128) Why is 128 mel bands use? I understand that the mel filterbank is used to simulate the "filterbank" in human ears, that's why it discriminates higher frequencies. I am designing and implementing a Speech-to-Text with Deep Learning and when I used n_mels=64, it didn't work at all, it only works

Link procedure to each button command maya

折月煮酒 提交于 2019-12-25 12:03:30
问题 I made this script that creates two material with different color values.How can I attach this procedure so that when I click color 1 button it creates material color 1 and color 2 when I click second button.If there is a much better way to achieve this is python.Please let me know global string $list_of_names[]; global float $matColor[]; $list_of_names = {"color1","color2"}; $matColor = { 1.0,0.355,0.5,0.545,0.5,1.0}; global proc create() { global string $list_of_names[]; global float

Link procedure to each button command maya

一世执手 提交于 2019-12-25 12:03:28
问题 I made this script that creates two material with different color values.How can I attach this procedure so that when I click color 1 button it creates material color 1 and color 2 when I click second button.If there is a much better way to achieve this is python.Please let me know global string $list_of_names[]; global float $matColor[]; $list_of_names = {"color1","color2"}; $matColor = { 1.0,0.355,0.5,0.545,0.5,1.0}; global proc create() { global string $list_of_names[]; global float

Maya Mel Script - How to get bottom point of model?

喜夏-厌秋 提交于 2019-12-13 03:13:09
问题 How to get bottom point of model via Mel script? If I can get the Y-coordinate of the bottom point, I can get the point of the bottom, but I can't figure out how to get it. 回答1: Looping through all vertices can be slow, especially with a dense mesh. What can be done instead is to use the object's bounding box: float $bb[] = `getAttr pCube1.boundingBoxMin`; print($bb[1]); // Lowest position in Y Another benefit of this is that you aren't relying on vertices, so it doesn't have to be a

How to check if instance exists if variable not existing?

妖精的绣舞 提交于 2019-12-13 00:29:16
问题 I have a button which imports a module with a class. The class (varClass) creates a window. If i click the button once again, i try this: if var: var.toggleUI() else : var = varClass() But var doesn' exist the first time you create the window after opening Maya. How can i get this working? 回答1: You could catch the NameError exception: try: var.toggleUI() except NameError: var = varClass() If you needed call toggleUI the first time too, just try the name itself: try: var except NameError: var

Freeze scale transform on a parent object with animated child (MAYA MEL/Python script)

两盒软妹~` 提交于 2019-12-12 20:38:09
问题 I have hierarchy of objects with animation on translation and rotation, the scale xyz are equal and static but not 1. When I freeze scale on a parent mesh it's children's animation goes wild. Is there any way to prevent this from happening? I have found a workaround, but it's not perfect yet. Let's say we have simple setup like this: parentObject=>childObject I put childObject in a group "childObjectGroup" parent childObjectGroup to the world and zero out it's transforms excluding scale. Bake

How do I parent new, user-created buttons inside the Graph Editor window?

China☆狼群 提交于 2019-12-12 09:27:16
问题 I'd like to add some new buttons to the Maya Graph editor -- particularly on top of the Channel list with all the attributes in the left of the window. However I'd rather not muck around with the Maya Startup scripts for the Graph Editor itself. Is there a way to "parent" the new buttons I want inside every new Graph Editor window using a separate script? Ideally this could be all Python. 回答1: TL;DR; if cmds.window("GE_ui_window", exists=True): #If the window exists cmds.deleteUI("GE_ui