Min_time = aybackOptions(query=True, minTime=True) Slider = wrapInstance(long(ptr), QtWidgets.QWidget) WidgetStr = mel.eval('$gPlayBackSlider=$gPlayBackSlider') from maya import melįrom PySide2 import QtCore, QtGui, QtWidgetsĭef select_time_slider_range(start, end): In code I'm temporarily changing the time slider range to maximize the screen space for the frames I want to click on. Using Qt Mouse press, move and release events to mimic the mouse behavior on the time slider widget to have it select. Here's the biggest hacky workaround there is. Posting it here too for completeness sake: I posted a hacky workaround there as an answer. This seems to be the same question as this question. It is the highlighted range I'm trying to set programmatically. I was thinking that there may be a way to modify the Qt widget, but I'm lost on this one. However, setting the highlighted range programmatically of the time slider seems nearly impossible. TimeSliderWidget = wrapInstance(long(ptr), QWidget) WidgetStr = mel.eval( 'string $tempString = $gPlayBackSlider' ) Likewise the Qt widget can be accessed with from maya import mel TimeRange = cmds.timeControl(aTimeSlider, q=True, rangeArray=True) mayaCode - A Visual Studio Code extension with support for coding for Maya.It is easy to get the highligted range in the time slider using: import maya.cmds as cmdsĪTimeSlider = mel.eval('$tmpVar=$gPlayBackSlider').Python - Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, Data Science (with Jupyter), PySpark and more.add the debug python file button on the right click menu.MayaDoc repo is how I extract the data from the Maya online document I try to extract more information from the Maya online document to build a better completion file. The origin completion code already get the running module for intellisense.īut some module lack of the detail information for the specific function or class. The origin completion python code came from the Maya developer center devkitĭevkit path : devkitBase\devkit\other\pymel\extras\completion\py When you activate the extension, it will add the completion path to the setting.json attributeīy the way, I recommend you enable Jedi for performance issue temporarily.Ĭurrent Python Language Server is pretty slow when you try to pop up the autocompletion list.Įven so, Jedi also may not the perfect solution, you could check this issue. Intellisense feature is completely base on the vscode python extension autocompletion feature. if all the step had been done, congratulation ,you could use breakpoint to debug your python file in Maya.if the python ptvsd debug module didn't initialize,it will import the module automatically and show the message for you.right click the menu item Debug Current Python File to Maya, if you didn't activate the command Port in Maya,it will tell you the mel command to activate it.Integrate the python debugger that allow you set the breakpoint to test the code in Maya Display more module information and link the document directly.Add Python Intellisense for maya python module.VS Code Extension for Autodesk Maya Python Intellisense and Debugging
0 Comments
Leave a Reply. |