[Maya-Python] PyQt - Gui contents got resized but not the window

2019-11-22 Thread likage
Hi all, I am trying to 'scale' down the gui so as to reduce the spacing between my widgets whenever the tool is called. I tried using `setFixedSize`, while it does seems to scales down to what I had wanted, but the window, see attached, stays as it is and it is not being scaled down with it.

[Maya-Python] Cropping in Free Image Plane

2019-11-12 Thread likage
I have an animated image sequence, eg. the character reference is screened towards on the right hand side. Since the left hand side of the sequence contains no reference/ it is blank, I would like to crop it out. If I am using a polygon Plane > applied with a material that contains an animated

[Maya-Python] Hotkey "popup" message

2019-10-31 Thread likage
Hi everyone, I am wondering if there is a cmds command or something, where when you hit a certain hotkeys, this "popup" message will be shown on the viewport? Eg. If you press Ctrl+M, the popup menu - "The top menu bar is now hidden. Press Ctrl+m to show it" -- You received this message

[Maya-Python] Euler curve filer is not working for objects in animation layer

2019-10-17 Thread likage
Hi everyone, I have trouble in doing euler-filtering in a pythonic if the object channels is stemming from an animation layer (where the channels are in 'greenish-blue' instead of the red. I tried the following: sel = '|man_rig|hands|right_arm|right_hand_ctrl' channels = ["translate", "rotate"]

[Maya-Python] Factoring in animation layer while doing Animation baking

2019-10-17 Thread likage
I am trying to do some animation baking on some controllers in which these controllers were constrained to locators for additional animation refining purposes. Some of the controllers are set with a keyframe in an animation layer. Eg. ctrlA translation value in the said animation layer is at

Re: [Maya-Python] Algorithm to display euler curves?

2019-09-12 Thread likage
Hey Marcus, I apologize for my poor description.. I have attached some screenshots where I am trying to use Python to determine following: [image: before_filter.jpg] Notice some of the curves are showing a 'plateau' alike curve... These are the curves I am trying to derive via python

[Maya-Python] Algorithm to display euler curves?

2019-09-11 Thread likage
I have a rig with 100+ controllers (some of them are animated etc), without opening up Graph Editor, in programming terms, how can I determine if x number of controllers need to be applied with 'Euler Curve'? Is there a way that I can check without blindly using `cmds.filterCurve` towards all

[Maya-Python] Re: Need help with QSlider collating as 1 undo

2019-08-02 Thread likage
I managed to make some leeway however I am still having issues with it. # Connections that I have set for my slider self.ui.planeSizeHorizontalSlider.sliderPressed.connect(self.slider_pressed) self.ui.planeSizeHorizontalSlider.sliderReleased.connect(self. slider_released)

[Maya-Python] Re: Need help with QSlider collating as 1 undo

2019-08-02 Thread likage
any insights, anyone? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this

[Maya-Python] Need help with QSlider collating as 1 undo

2019-07-31 Thread likage
Hi all, I need some insights on this gui signals + undo. In my tool, there is a QLineEdit and a QSlider in which both are connected/ linked to each other, where if you made changes in the QLineEdit, it will updates the QSlider, likewise if you made changes on the QSlider, it will updates the

[Maya-Python] Pythonic access of the view transform button in viewport2.0

2019-07-19 Thread likage
Hi all, I am trying to get the state of the 'viewTransform' button (as depicted here ) whenever viewport2.0 is used. I was not

[Maya-Python] Making image plane size to stick/ move together in ortho cameras when zooming

2019-07-17 Thread likage
Hi everyone, I have a question regarding the use of image plane and it being 'constrained' to ortho cameras. This is what I am trying to achieve: * In persp, go to the menu View > Import Plane > Import Image * Try doing a zoom in/out with the middle mouse button * Note that the image plane

Re: [Maya-Python] Precaching image sequences in Maya

2019-07-12 Thread likage
Hi Justin, Tried out the method you have suggested, it does works to a certain extent but not exactly what I am looking for (I apologize for the way I have phrase my question now that I re-read it) It is more of "I wanted the image sequences to play smoothly on the go".. But even so, I

[Maya-Python] Precaching image sequences in Maya

2019-07-12 Thread likage
Are there any ways to pre-cache image sequences as they are used in imagePlanes? Currently, I am using the `ffmpeg` command in which it converts a video source, eg. .mov into an image sequence. While the image may be generated in 720, there are times where my maya scene will becomes slows (I

[Maya-Python] scriptJob event for editing attributes within graphEditor

2019-07-11 Thread likage
Is there a scriptJob event that will allows me to: - detect whenever a change is made in graphEditor - and knowing which attribute it has been modified? I tried using the following: def ge_track(): print 'changes made in graph editor' test =

[Maya-Python] Placement of contextmanger usage within code

2019-07-10 Thread likage
I have created a contextmanager that tracks/registers for undo and I have some questions, mostly on what is the best way to use/ code it as I am unsure which is the best approach. In my utils.py file, I place the contextmanger class within, along with other utility functions that are used in

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-10 Thread likage
I manged to get this figured out. Thank you all for the help :) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-08 Thread likage
I tried to move the `cmds.undoInfo` into list_item_click() method where the chunk will be opened and closed upon the renaming (after the self.validate_naming) and before I perform any undo, I tried to print out the list of undo in the queue, in which it returns me as follows:

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-08 Thread likage
Hi Justin, thank you for getting back. As for the DockWidget() class method you have provided, sadly it does not seems to be working for me. Getting the same issue (signal not getting called) as soon as `self.ui.setupUi(self)` is implemented. - I tried using the following in my main.py for

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-05 Thread likage
Thought I placed my files here as I could not really figure out the undo or the graph editor selection... main.py - https://pastebin.com/aQL9Fvue refplanes.py - https://pastebin.com/zzKkFYxc utils.py - https://pastebin.com/SXidXLTH refplanes_ui.py - https://pastebin.com/qCGGqZEF Appreciate in

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-05 Thread likage
Could you kindly elaborate more on `rename wasn't wrapped in an Undo group`? I am not quite understanding here... I did not create any 'groups' (cmds.undoInfo) if you are referring to that... And unfortunately, there seems to be another issue where - when trying to select any keys in the Graph

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-05 Thread likage
Thank you Justin. Will try out your method. I have 2 questions here: 1. For the approach I have adopted - 'using scriptJob to track tool closure' , is that still applicable/advisable? 2. And one more question - For the `undo` that I have implemented, eg. perform an un-renaming process, I

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-04 Thread likage
Got it, thanks! Is there a way in which I can also use script job to detects when my custom tool is closed? I am using `MayaQWidgetDockableMixin` in which the `closeEvent` is not calling (`dockCloseEventTriggered` does gets called and executed if the tool is docked) and it is not removing the

Re: [Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-03 Thread likage
Hi, I have not. I was not aware of the above 2 you have mentioned. This may sounds very noobish of me - but how do I use them? Additionally, I could be wrong on this but while I was googling around, trying to find a way, I chanced upon Model View Controller (something that I was not aware of

[Maya-Python] (Real) Time update/ actions between Gui and Maya

2019-07-03 Thread likage
Hi everyone, I am trying to make a real-time update, eg. a renaming between maya scene and my tool. Previously I made a thread about it, but seeing that it is a bit confusing, I have decided to make a new thread and repost it with coding on what I am trying to achieve. Currently I am able to

[Maya-Python] Re: Using undo between Qt Gui and Maya

2019-07-02 Thread likage
Hi Michael, sorry for the late response on this. While I understand your first point, but for the other point - `have your GUI update when the values it is tracking in Maya change (eg when someone undoes something in Maya)`, how do I go about doing it? Is that something to be implemented in my

[Maya-Python] Re: Using undo between Qt Gui and Maya

2019-06-26 Thread likage
Adding on, my Gui was created using qt designer -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Maya-Python] Using undo between Qt Gui and Maya

2019-06-26 Thread likage
Hi everyone, I have a Gui created from using Qt where it has widgets that creates locators (populated as part of a list item in QListWidget) and interacts with some of its attributes (eg. the TranslateXYZ + Local PositionXYZ) In maya context, you will be able to perform n times of undo. But my

[Maya-Python] visibility attribute is using stepped tangent when I code it to use linear

2019-06-24 Thread likage
Hi everyone, I am trying to set some keyframes on the attributes pythonically but noticed that only the "visibility" attribute is touched upon, both the `inTagentType` and `outTagentType` are not factored into account. Eg. in my code, I have sent them to be keyframed with linear tangents, but

[Maya-Python] Multiple actions in 1 QAction

2019-06-20 Thread likage
Hi everyone, I created a tool using Qt Designer, where it has 3 QLineEdits that is catered for translateX, translateY and translateZ. For each QLineEdit, I have created a context menu that allows me to set a keyframe for one of the above attribute depending on User's choice. So instead of

[Maya-Python] Checking what controllers uses pre/post infinity

2019-05-24 Thread likage
What is the best way that I can check if (a) controllers are using pre/post (cycle) infinity? Currently I am using the following: # Get the first frame used in all controllers first_frame = cmds.findKeyframe(controller_selections, which="first") # Get the last frame used in all controllers

[Maya-Python] Maya bugs/ issues page

2019-03-28 Thread likage
Hi all, I may be missing something when I went over to the Autodesk forum, but I am wondering if there is a page that enables me to see what bugs/issues has been reported? Something similar to Jira? It was some years ago that I saw a similar page, not sure if the said page still exists or if

Re: [Maya-Python] Trying to run a linux command in Maya

2019-03-04 Thread likage
Got it, many thanks for the replies :D -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com.

Re: [Maya-Python] Trying to run a linux command in Maya

2019-03-04 Thread likage
Hi Justin, I have managed to get it to work by using the absolute path but with those commands saved in another .py file within the list of python paths that MAYA is reading from.. As such, my python file is as follows: import subprocess def main(): process =

[Maya-Python] Trying to run a linux command in Maya

2019-03-01 Thread likage
Hi everyone, I am trying to launch a terminal command (I am using Linux) in Maya. In the terminal, if I typed in `meld`, it launches an editor. If I try to incorporate the following in Maya context, by using the following: subprocess.call(['meld'], shell=True) or `shell=False`, or remove the

[Maya-Python] Re: Maya preferences question

2019-01-28 Thread likage
Adding on, I asked this, because, initially there is already a .conf file of this tool that I was working on, and while I made some changes towards the tool (eg. the window size), even in a new Maya session, the .conf file does not seems to be overwriting with the new window size unless I

[Maya-Python] Maya preferences question

2019-01-28 Thread likage
Hi all, I have a question about Maya preferences Does saving of Maya Preferences (File > Save Preferences) may in any ways interfere : - with .conf files? - one of the 'best' method to resolve maya crashes (removing of the prefs folder)? About the latter point, there are times that I

Re: [Maya-Python] New items are not added into QMenu

2019-01-15 Thread likage
Thanks for the information, Justin. After re-arranging the `self.separator` I managed to get the newly created items to be slotted into the specified position of mine. While this seems to be working, as I tried to implement in the same makings into my actual tool, I keep getting `RuntimeError:

Re: [Maya-Python] New items are not added into QMenu

2019-01-15 Thread likage
Hi, thanks for getting back to me. It seems that the newly added items are added to the end (bottom) of the QMenu instead of in-between the 'Add new item' and the 'Default Item'.. Also as mentioned in my first post, is it possible to create different QMenus for different tabs? Eg. I create

[Maya-Python] New items are not added into QMenu

2019-01-14 Thread likage
Hi everyone, I have a tool which utilizes QTabWidget and the tabs are populated with a list of keys from within a dictionary. Each of the QMenu are equipped with 3 default options, with one of the option called `Add new item` where when User uses that option, a prompt dialog will popped up and

Re: [Maya-Python] clicked signals around a QLabel

2018-12-18 Thread likage
Hi Justin, jumping back onto this thread... So, I managed to get a QPushButton, converted into a QGraphicsProxyWidget, and have it implemented into a horizontal QGraphicsLinearLayout together with the title. But, currently I have an issue where this horizontal layout though is being added

Re: [Maya-Python] clicked signals around a QLabel

2018-12-07 Thread likage
I am slightly confused now... I apologize in advance, not an excuse but this is my first time dealing with QGraphicsXXX and have it integrated with the 'normal' widgets.. In the BaseWidget script - filled_round_rect(), it appears that the icon creation is made there and so I added this part in:

Re: [Maya-Python] clicked signals around a QLabel

2018-12-06 Thread likage
Hi Justin, Thank you for getting back. I had thought using the above example may help me out but turns out not. :( And so, I have decided to paste the code here in hopes of some guidance/ insights if any... BaseWidget GraphicsWidget

[Maya-Python] clicked signals around a QLabel

2018-12-06 Thread likage
Hi all, I am trying to create a 'clicked' signal where it will only be triggered if User clicks anywhere within the icon. In the following code: class TestWin(QtGui.QWidget): def __init__(self, parent=None): super(TestWin, self).__init__(parent) self.init_ui() def

Re: [Maya-Python] How to undock tool when using MayaQWidgetDockableMixin

2018-11-22 Thread likage
Hi all, many thanks for getting me back on this. I am implementing some new functions in this tools that was previously written by someone, and I would not want to break any of its code if possible as this tool comprises of several scripts. Even so, is there a way that I can get by with using

[Maya-Python] How to undock tool when using MayaQWidgetDockableMixin

2018-11-22 Thread likage
Hi all, I am using `MayaQWidgetDockableMixin` and for some reasons when using Maya 2018, some of the signals are not working when the tool is closed. While I have managed to find a way to resolve this which is by sending the tool to be docked upon first execution. By doing so, whether I closed

[Maya-Python] Undocking panel using Python

2018-11-21 Thread likage
If there is a panel that I have make it docked, what is the pythonic command that I can used to undock it? I can find the said panel by using workspaceControl command to check if it does exists but I am unable to find the command that allows undocking.. -- You received this message because

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
Got it, thank you. I did not read the post correctly and thought it was a case of just dict type instead of defaultdict. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
I have 2 questions, should have done more testing on my end.. 1. I am trying to understand the use of `.append'. I know that it adds things to list, but when I was looking thru the documentation page - https://docs.python.org/2/library/collections.html, even in the example, it is mostly

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
I was not aware that you could use `append = test_dict["Input Issue"].append` as you have demonstrated in Example #2. Learnt something new today :D -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from

Re: [Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
Hi Justin, thanks for the reply. I use msg{A,B,C} because if any one of the condition passed, the msg will get appended with the next in-line error. Eg. If only frame range fails, my `test_dict` will return as follows: {'Frame Range Issue': [None, 'Value of Start/Min Frame

[Maya-Python] Method to collates all errors for Conditions Checking

2018-10-23 Thread likage
Hi all, I am trying to see what is the best way that I can collate results into a QMessageBox. This is my code: test_dict = defaultdict(list) # Old : msg = "" msgA = msgB = msgC = None # Inputs if all((input_01, input_02)) == False: msgA = "One or both of the Input fields is/ are empty!"

[Maya-Python] Sub menus in shelf button

2018-10-10 Thread likage
Hello, I need some help with Mel in which I am trying to attach a sub-menu onto a shelf button. If the shelf button is toggled by left-mouse click (also the default), a menu will be shown. And if it is toggled with a right-mouse click, a different menu will be shown. This is my code:

Re: [Maya-Python] Creating a QTreeView hierarchy from a given list of strings

2018-09-11 Thread likage
Hi Justin, thank you for getting back. I added your code into my get_contents() function. It seems that only an item is being stored? Tried doing a `print it.text()`, it is only returning me `camera` as the result instead of the full path.. As such, only that item is being appended with icon..

Re: [Maya-Python] Creating a QTreeView hierarchy from a given list of strings

2018-09-10 Thread likage
Got it, many thanks for it, Justin! I have another question, the following is the working code: class MyModel(QtGui.QStandardItemModel): def __init__(self, parent=None): super(MyModel, self).__init__(parent) self.get_contents() self.assets_column = 0 def

[Maya-Python] Creating a QTreeView hierarchy from a given list of strings

2018-09-07 Thread likage
Hi all, Given a list of strings, I am trying to populate the items in a tree view. Here is my code: class MyModel(QtGui.QStandardItemModel): def __init__(self, parent=None): super(MyModel, self).__init__(parent) self.get_contents() def get_contents(self):

[Maya-Python] Creating a Tree hierarchy using PyQt

2018-09-07 Thread likage
Hi all, I have a list of node's full dag path as follows: |Base|character|Mike|body |Base|character|John |Base|camera I am trying to populate them in a Tree View hierarchy using PyQt based on the above queried paths so that the tree view will be something as follow: |-- Base |--|-- character

Re: [Maya-Python] OptionVar is not saving/ loading correctly

2018-08-14 Thread likage
Hi Justin, many thanks for the reply, that seems to have do the trick. Wondering if you could also share any insights into `# RuntimeError: Object 'chk_box' not found. #` whenever I tried to relaunch/ rerun the code? -- You received this message because you are subscribed to the Google Groups

[Maya-Python] OptionVar is not saving/ loading correctly

2018-08-14 Thread likage
I am using `optionVar` to store inputs made within the maya ui commands. And these storing will only be effected if the tool gui is closed (the cross 'x' button within the window) and I am having issues with that... I am having some issues with the loading and saving when using `optionVar`. In

Re: [Maya-Python] Get the action command of the previous custom tool used

2018-08-13 Thread likage
Hi Marcus, Many thanks for getting back! I will give it a try. For my case and your solution, is making my tool the plugin the only way to go? Additionally, regarding your code, where does "initializePlugin" and "uninitializePlugin" are called? Is it a default function that is handled by

[Maya-Python] Get the action command of the previous custom tool used

2018-08-10 Thread likage
I have run a custom tool in a maya scene. Say, if I am going to perform `z` (undo) via the keyboard, I would want to set the evaluation mode to be 'off' if the previous action is/ belongs to my custom tool. I tried using `cmds.scriptJob(listJobs=True)`, while the entire contents are somewhat

[Maya-Python] How to check if objects have more than 1 keyframe in the time slider

2018-08-07 Thread likage
What is the best way to check and see if an object (or multiple objects) have more than 1 animated keyframes as denoted by the red ticks in the time slider... I tried using "cmds.keyframe(sl=False, q=True, tc=True)", however that returns me the amount of attributes that are keyframed etc. My

Re: [Maya-Python] Re: popupMenu command works in Python but not in Mel

2018-07-26 Thread likage
Adding in a bit more information. My objective initially is to have a shelfButton to have 2 different selection menus. 1. If User clicks on the shelf button, it will shows menuA... 2. If User clicks on the shelf button while pressing "ALT" key, it will shows menuB... My initial code, where it

Re: [Maya-Python] Re: popupMenu command works in Python but not in Mel

2018-07-26 Thread likage
> On 26 Jul 2018, at 21:22, Robert White > > wrote: > > I believe the problem you're running into here, is that the popupMenu > -postMenuCommand expects the command to be in mel, because you're > triggering it from mel. > > > On Thursday, July 26, 2018 at 3:01:24 PM UTC-5

[Maya-Python] Re: popupMenu command works in Python but not in Mel

2018-07-26 Thread likage
; triggering it from mel. > > > On Thursday, July 26, 2018 at 3:01:24 PM UTC-5, likage wrote: >> >> I was trying to convert a popupMenu command from Python to Mel.. >> >> When using Python: >> cmds.popupMenu( button=1, postMenuCommand="im

[Maya-Python] popupMenu command works in Python but not in Mel

2018-07-26 Thread likage
I was trying to convert a popupMenu command from Python to Mel.. When using Python: cmds.popupMenu( button=1, postMenuCommand="import lod_select; lod_menu = lod_select.make_dropdown(); lod_select.show_menu(lod_menu)") However, when I tried converting the above command into MEL, I get an error:

[Maya-Python] Window UI is not displaying correctly if using checkbox to display/ hide additional ui(s)

2018-07-18 Thread likage
I have this UI using maya commands in which I am having problem with one of the checkbox. Here is the code: WINID = "mineUI" def ui(): # Make sure that the UI isn"t already active if cmds.window(WINID, exists=True): cmds.deleteUI(WINID) cmds.window(WINID, title="My window

[Maya-Python] Creating marking menus in Python

2018-07-05 Thread likage
I am trying to create a custom set of marking menu in a pythonic manner and have it booted up during setup. Afaik, marking menu(s) are generally creating using MEL. Wondering if anyone here has managed to do so? Could you kindly advise? I am using Maya 2017. -- You received this message

Re: [Maya-Python] Forcing Script Editor custom changes in Maya 2017

2018-05-28 Thread likage
another thread, applying > a python event filter to a high traffic widget like the main window or > application can have performance impacts. So you may need to do it in C++ > if the parent is main window. > > On Tue, May 29, 2018, 5:21 AM likage > > wrote: > >>

[Maya-Python] Forcing Script Editor custom changes in Maya 2017

2018-05-28 Thread likage
Hi all, I am trying to "fix" the spacing/ fonts in the Script Editor of Maya 2017 version as I am used to the format and style of Maya 2016 versions and before. After some searching, I created the script for the change as well as created a userSetup.py that will load and executes the script

[Maya-Python] Get objects that are not uv

2017-07-20 Thread likage
Hi all, I have this model in which some of the geometries within are not uv-ed. As in, you select the geometry >> open up uv editor >> it is blank. And so it is causing some problems with a script I am doing. Are there any ways in which I can use python to check for such geos with the blank

[Maya-Python] Check and grab the latest value of a certain condition using dictionary

2017-07-10 Thread likage
I have created a dictionary in which it stores the information as follows: dict = {'model_v001': 'In Progress', 'model_v002': 'In Use', 'model_v003': 'In Progress', 'model_v004': 'In Progress', 'model_v005': 'Approved', 'model_v006': 'Pending'} I am trying to achieve that, from the

[Maya-Python] Image is not appearing in menuItem

2017-06-21 Thread likage
I have created a shelf icon using `shelfbutton` and I am adding a drop down menu which is created using the `popupMenu` and `menuItem`. Good news is that, everything is working as I expected it to be. This is not a biggie but when I tried to incorporate the command `image (-i)` flag for

[Maya-Python] Creating a curve-based wireframe

2017-05-31 Thread likage
I am trying to 'extract and convert' all the edges of the polygon (based on selection) into curves, then parent the curves as one. This is like a curve-based wireframe model. While Maya has a functionality that allows all edges to be converted into curves, but the functionality - "Polygon

[Maya-Python] Re: Catch the end of viewport 2.0 processing process

2017-05-31 Thread likage
> > The cmds equivalent of MEventMessage is > > cmds.scriptJob(event='idle', fn) > > I haven't used it for a very long time but I think the fn might need to be > a string representing MEL code. > > Or you might be better off with evalDeferred: > > cmds.evalDeferrred('print "a"') >

[Maya-Python] Re: Catch the end of viewport 2.0 processing process

2017-05-30 Thread likage
I should have posted my code, here goes: def set_vp2_settings(): cmds.setAttr('hardwareRenderingGlobals.vertexAnimationCache', 2) cmds.setAttr('hardwareRenderingGlobals.hwInstancing', 1) cmds.setAttr('hardwareRenderingGlobals.threadDGEvaluation', 1)

[Maya-Python] Catch the end of viewport 2.0 processing process

2017-05-30 Thread likage
I am trying to get the end if processing time taken when switching to viewport2.0. In my code, I start off by doing custom settings in renderer then switching to viewport 2.0 However when switch, it took a while for Maya to process, like 3 to 5 seconds before I see the message 'viewport 2.0

[Maya-Python] ImportError when running terminal command in maya standalone

2017-05-15 Thread likage
Hi everyone, I am trying to run a terminal command while using maya.standalone and run into some problems. There is this terminal command in which if I run `someCommand my_file.txt`, it works correctly, as I expecting it to be. When I tried to incorporate it into my script:

Re: [Maya-Python] Use AbcExport plugin externally to convert obj to abc

2017-05-15 Thread likage
I keep getting the following error: ERROR, imageIsFile, can't read `/user_data/custom_scripts/'. Is a directory File read in 0.024 seconds. Error: Failed to open IFF file for reading : /user_data/.tmp//maya108600x7fff97d2ea00.iff Despite loading in the obj plugin, the error ensues.. Not sure

Re: [Maya-Python] Use AbcExport plugin externally to convert obj to abc

2017-05-15 Thread likage
Hi everyone, sorry for the delay in reply. Yes I am pretty much unaware of mayapy, first time hearing this. Trying to search for some tutorials online that may guide me through this. But if you have any links, please do share it with me :) Currently I am not sure what is the ideal way to

[Maya-Python] Use AbcExport plugin externally to convert obj to abc

2017-05-05 Thread likage
Hi all, I am trying to convert objects (.obj) into alembics (.abc) While I am able to perform this by importing my objs into a maya scene and export it as alembic, is there a way in which I can run it externally out of Maya session? Such that I can try running it as a command line or somewhat,

[Maya-Python] Re: Finding and selecting fliiped (red-colored) UVs

2017-05-05 Thread likage
Alright, I have misunderstand. Yes I think I will stick to the cmds command as it is faster and easier to maintain like you have mentioned. Appreciate for the information on the API and PyMel etc. :) Cheers! -- You received this message because you are subscribed to the Google Groups

[Maya-Python] Re: Finding and selecting fliiped (red-colored) UVs

2017-05-02 Thread likage
> > Using maya.cmds you'd probably want to execute the MEL commands that do > the same actions Andres detailed. I'm not sure how to do that but if you > turn on "Echo All Commands" in the Script Editor and do some digging in the > MEL scripts that ship with Maya, you might be able to figure it

[Maya-Python] Re: Finding and selecting fliiped (red-colored) UVs

2017-05-01 Thread likage
Hi Andres, thanks for getting back. The settings you have given works like a charm! Was not aware of such a setting as I only knows of selecting the faces and flipping them manually. Though I have yet to check all the UVs in general if they are working correctly/ have changed anything in its

[Maya-Python] Finding and selecting fliiped (red-colored) UVs

2017-05-01 Thread likage
Hi all, I have several models in my scene that contains flipped uvs (those colored in red when opening in UV editor) and each mesh contains a mixture of red and blue ones (blue are the correct uvs) While I can manually select each/ all of these red colored uvs and flip them inidvually per

[Maya-Python] Re: Older cmiVFX training videos released free (3 tutorials)

2017-03-23 Thread likage
Nice, thanks for sharing your lessons and knowledge, Justin! I'm sure students/ newcomers alike to coding will appreciate it! :) -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop

[Maya-Python] Create item on mesh via mouse cursor position

2017-03-15 Thread likage
I am trying to do something as follows: - Within the viewport - Mouse cursor hover onto a pPlane for example (at any position) - Prior to the mouse cursor/ position, as user clicks on their mouse, it will create a locator right at the mouse cursor position that user has specified

[Maya-Python] Re: Command flag in symbolButton keeps erroring for me

2017-03-14 Thread likage
Interesting... Thanks for the information, guys! Never thought that with a simple example that I have used, it can failed almost immediately. >From the flags, though it mentions of `script` I had assumed that it will worked with a normal method too.. -- You received this message because you

Re: [Maya-Python] Command flag in symbolButton keeps erroring for me

2017-03-14 Thread likage
> > Try wrapping it in a lambda? > self.btn_add = cmds.symbolButton( width=60, height=20, annotation='Add > object(s)', image='add.xpm', command=lambda *x: self.add_btn_callback( > "item_list") ) > Okay, so it works. And my question is why? -- You received this message because you are

Re: [Maya-Python] Command flag in symbolButton keeps erroring for me

2017-03-14 Thread likage
While it works for the example, I tried applying the same concept into my actual code, I am getting the errors.. self.btn_add = cmds.symbolButton( width=60, height=20, annotation='Add object(s)', image='add.xpm', command=self.add_btn_callback("item_list") ) def add_btn_callback(self, "list"):

[Maya-Python] Command flag in symbolButton keeps erroring for me

2017-03-13 Thread likage
I am trying out using maya symbolcheckbox and I run into a few issue. In my actual code, I have a 'add', 'remove' and 'clear' button and so if any of these 3 buttons are clicked onto, it will called its own functions. In my code, it was written something as follow: self.btn_add =

Re: [Maya-Python] Re: conforming lines to 80 characters limits

2017-02-27 Thread likage
I have another question - what about the function line? Eg. Class Something(object): def __init__(self, rotate=((0, 0), (0, 0), (0, 0)), scale=((1, 1), (1, 1), ( 1, 1)), u_jitter=(0,0), v_jitter=(0,0)): The character limit stops at the last open bracket of the scale parameter : `..., scale=((1,

[Maya-Python] Re: conforming lines to 80 characters limits

2017-02-26 Thread likage
Noted, thank you all! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this

[Maya-Python] conforming lines to 80 characters limits

2017-02-26 Thread likage
Hi all, I am trying to conform my code to fit into length width of 80 characters, pep8 style Suppose if I have a code like this: class something(): def __init__(self): ... self.uiSetupNormalSmooth = cmds.radioButton(label='Geometry normal',

[Maya-Python] Check if object exists in world before using parent command

2017-02-23 Thread likage
This is my outliner, eg. '|hie1|cube1' and 'cube2' If I select cube1 and did: cmds.parent("|hie1|cube1", world=True) This will unparent my cube1 out of hie1 and into 'world' level? Sorry, can't think of a better term. But if I did the same thing to cube2: cmds.parent("cube2", world=True) I

Re: [Maya-Python] Count, filter out duplicates in keys while doing the same for values

2017-02-23 Thread likage
into a nicely named local variable :-) > > Justin > > ​ > > On Fri, Feb 17, 2017 at 1:50 PM likage <dissid...@gmail.com > > wrote: > >> This time round, I tried using tuple like you have mentioned. see,s to be >> working well but I got an issue, where if

Re: [Maya-Python] Count, filter out duplicates in keys while doing the same for values

2017-02-16 Thread likage
This time round, I tried using tuple like you have mentioned. see,s to be working well but I got an issue, where if there is an existing user, it will collate and summed up the overall data size under 1 user... In the pastebin, I am expecting item_C to be `kilo [3 (1]` but it seems to add up

Re: [Maya-Python] Count, filter out duplicates in keys while doing the same for values

2017-02-14 Thread likage
Thank you Justin for your help. My bad, it does seems I have omitted out a portion of where/how gen_dict comes about but in any case, it comes from an iterator. And since I am only getting 2 parameters - namely the object name and the user name affiliated with it, I made it into a dictionary,

[Maya-Python] Count, filter out duplicates in keys while doing the same for values

2017-02-14 Thread likage
I have this dictionary. gen_dict = { "item_C_v001" : "jack", "item_C_v002" : "kris", "item_A_v003" : "john", "item_B_v006" : "peter", "item_A_v005" : "john", "item_A_v004" : "dave" } while I am able to filter out the version makings and the users to: Item Name | No. of Vers. |

Re: [Maya-Python] Animation keyframe exporting

2016-12-20 Thread likage
Thanks, it works! I have a few questions.. 1. `all_data[sel] = {}`, why can't I wrote it as `all_data[sel] = None`? I tried and I got an error that states ''NoneType' object does not support item assignment' I asked this because since I have no values to append in the first place, wouldn't

  1   2   3   >