pymel

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

Python - Change the textField after browsing - MAYA

ぃ、小莉子 提交于 2020-01-03 05:47:35
问题 I've got the most annoying problem with my GUI Exporter in Maya. I've made the textField etc. work, but I can't change the value of the textField after it's created, which is what I need to do. What I want to do for example is, let's say the filepath is none from the beginning. The textField has now printed out: "None" in it, but after you press browse and select a directory, I want it to change None to the directory path etc. That's the only problem I currently have and the error code

How to use python (maya) multithreading

早过忘川 提交于 2019-12-19 04:22:56
问题 I've been looking at examples from other people but I can't seem to get it to work properly. It'll either use a single core, or basically freeze up maya if given too much to process, but I never seem to get more than one core working at once. So for example, this is kind of what I'd like it to do, on a very basic level. Mainly just let each loop run simultaneously on a different processor with the different values (in this case, the two values would use two processors) mylist = [50, 100, 23]

How to use python (maya) multithreading

江枫思渺然 提交于 2019-12-19 04:22:14
问题 I've been looking at examples from other people but I can't seem to get it to work properly. It'll either use a single core, or basically freeze up maya if given too much to process, but I never seem to get more than one core working at once. So for example, this is kind of what I'd like it to do, on a very basic level. Mainly just let each loop run simultaneously on a different processor with the different values (in this case, the two values would use two processors) mylist = [50, 100, 23]

Maya Python: cmds.button( ) with UI passing variables and calling a function?

丶灬走出姿态 提交于 2019-12-18 11:19:34
问题 First of all, this seems to be a great place to learn more about programming. I've written a maya python script, where both functions work, I'm having trouble getting the UI button to call the superExtrude() function, though. The first function does the geometric mesh manipulations and the second one should produce the UI for the user inputs: import maya.cmds as cmds def superExtrude(extrScale, extrDist): """Loops through a list of selected meshes and extrudes all of the mesh faces to produce

Maya Python: cmds.button( ) with UI passing variables and calling a function?

坚强是说给别人听的谎言 提交于 2019-12-18 11:19:07
问题 First of all, this seems to be a great place to learn more about programming. I've written a maya python script, where both functions work, I'm having trouble getting the UI button to call the superExtrude() function, though. The first function does the geometric mesh manipulations and the second one should produce the UI for the user inputs: import maya.cmds as cmds def superExtrude(extrScale, extrDist): """Loops through a list of selected meshes and extrudes all of the mesh faces to produce

Convert pyQt UI to python

回眸只為那壹抹淺笑 提交于 2019-12-17 08:16:26
问题 Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file? I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great! 回答1: You can use pyuic4 command on shell: pyuic4 input.ui -o output.py 回答2: If you are using windows, the PyQt4 folder is not in the path by default, you have to go to it before trying to run it: c:\Python27\Lib\site-packages\PyQt4\something> pyuic4.exe full/path

Maya Python modules complete documentation?

泄露秘密 提交于 2019-12-12 03:07:03
问题 I've started using Python to script Maya for a school projet but i'm facing a problem with the documentation : I can't find anywhere a complete documentation of all the modules classes and function of the Maya API. I've already foun the Python-style documentation for PyMEL module, but where is the reste of it ? E.g, the maya.cmds module ? Thanks. 回答1: Open the maya help inside of Maya (the F1 key in windows) or go to the online documentation (that link goes to the maya 2015 docs, your copy of

Replace text in textField with object name - Pymel

霸气de小男生 提交于 2019-12-10 11:48:52
问题 I've realized that there were similar questions located here: textfield query and prefix replacing and here: Python - Change the textField after browsing - MAYA However, these do not address the issue if you have two definitions and need the text in the textField to be queried (actually CHANGE the text in the textField). I know from experience that doing what I have below in MelScript actually works, but for the sake of Python, and learning how to do it in Python, it seems to not work. Am I