Got it, thanks! Had thought that there may not be a need to perform another
`setText()
I have got another question.. sorry for the mass spam.
I tried following what you have mentioned and do the same for my other
widgets - checkbox and radiobuttons..
eg.
I have created my tool using PyQt. Things are working correctly and I am
encountering 2 issues.
1. This is more of an implementation - I am trying to capture the input
state of the widgets that User has made within the tool. Eg. User has
written something in one of the many QLineEdits, checked
Hi Justin, glad to know that using QSettings is the way to go... As I am
not getting the expected output, I must have done something wrong..
I was able to save the data, but when it comes to the loading part, no
values are loaded despite it being present in the file contents if I am
running the
Is there a way to check if the current maya session is 'new'?
I have a tool created using PyQt, in which it stores the widgets inputs
using QSettings (asked this question previously). The settings and all
works out great, however I realized that if I launched a new maya session,
followed by
Noted with thanks!
--
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
Hi all, I am trying to split maya gui commands into another file, from the
main code, like what you may do when dealing with PyQt.. Main code in a
file while the UI code in another, for the sake of better maintaining the
code.
Here is my code:
myUI.py
from maya import cmds
import myCode as my
Hi all, many thanks for getting back.
It is upon the use of QSettings that I started to notice and wanted to
implement checking conditions, as what Michael has mentioned, especially
so, if there are 2 Maya sessions opened..
Will look into implementing callbacks then.
Thanks again!
--
You
Hello,
I am currently using Sublime Text 3. Managed to get the 'python' module
working by installing in the latest 3.7.0 but I have issues getting PySide
module to work.
I chanced upon 'Pyside' under the Package Control, installed it with no
issues.
However as soon as I tried to import in as
Hi all,
I am trying to filter some controllers from current selections.
Currently this is the code I had:
exclude_list = [
"main_global_ctrl",
"main_globalOffset_ctrl",
"main_path_ctrl",
"main_start_ctrl"
]
exclude_ctrls = []
all_ctrls = cmds.ls(selection=True, long=True)
for
I managed to have find a resolution.
Instead of using `dockCloseEventTriggered`, using of `closeEvent` seems to
have resolve it.
I have to write my UI create code to include something as follows:
self.ui.closeEvent = self.closeEvent
And this seems to be picking up in both Maya 2017 and 2018. Or
Hi all,
I am having some issues with MayaQWidgetDockableMixin, in which it is a
QWidget.
When I am testing it out in Maya 2017, I used the signal
`dockCloseEventTriggered` where a function will be called to save the
relevant options I have made within my GUI by using QSettings. The
settings
Hi all, sorry that I am jumping towards this old thread.
I did get this weird issue in Maya 2018, where the
`dockCloseEventTriggered` is not called unless it is docked.
Tried using the 'dummy' method in the above post, but still, that signal is
not being called when undocked.
Wondering if
Actually I was wrong - I had thought that using `self.closeEvent` may works
in Maya 2018, but turns out it is not.
Need any insights on this. Much appreciated in advance!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
Hi Justin, sorry that I may have made my question confusing/ I was
babbling, typing away of the way I am trying to phrase my question.
Let me try again :)
1. Deriving the hierarchy from Outliner
Eg. This is the hierarchical level as seen in my Outliner
|-- base
|--|-- names
|--|--|-- cleve
Hi all,
I am trying to set text color to Red in a specified tab of QTabBar.
Tried using the command `setTabTextColor`, there is something happening but
the text color is not changing, it is still remaining as white even when I
put it at the __init__ stage.
This is my code :
Currently I have tried using the following:
def tabs_color(self):
...
...
for index in range(self.tab_bar.count()):
text = self.tab_bar.tabText(index)
color = QtCore.Qt.transparent.name if text in qmenu_items else
QtCore.Qt.red.name
#
Hi everyone, I have an issue with the use of the `toggled` signal.
I loaded and created the GUI using .ui or uic module.
Example of my tool's code:
class MyWindow(QtGui.QWidget):
def __init__(self):
...
# self.informationVisBtn, `setChecked` and `setCheckable` field is
I am trying to create a rounded QPushButton in pythonic format.
Read some solutions which are in C++ and while trying to convert them in
Python terms, it does not seems to be working.
btn = QtGui.QPushButton()
btn.setAttribute(QtCore.Qt.WA_TranslucentBackground)
btn.setStyleSheet(
Got it, thanks.
I had thought that Maya iterates it by string and hence if I queried via
the use of some strings of the namespace and it will works...
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from
Hi all,
Sorry again, that I am asking a GUI question here.
I have created a subclass of QTabBar in which I am trying to populate the
tabs via selection from a QMenu (that queries for anything that are of
"*_grp")
However I got an issue where the first added item is seemingly behind the
Hi Justin,
Just tried it, in which the first item that was populated is behind the
'add' button.
Which is why I am adding in a hboxlayout... in hope that the tabs will
appear right by the `add` button
--
You received this message because you are subscribed to the Google Groups
"Python
Instead of `class MyTabBar(QtGui.QTabBar)`, I created it as `class
MyTabBar(QtGui.QMainWindow)` and a new variable solely for `QTabBar` and it
works...
Even so, (as I am not sure) , generally, to use `QTabBar`, does it always
go along with the use of `QTabWidget`?
--
You received this
Hi Marcus, my bad on this. `hlay` actually refers to the `HBoxLayout()`
I have updated the snippet - https://pastebin.com/raw/EYcMh5hq
When trying out your method where:
class MyTabBar(QtGui.QTabBar):
def __init__(self, parent=None):
super(MyTabBar, self).__init__(parent)
lustration, but something of the following:
(Say I selected the option - 'food' from the + icon, and within 'food',
there are another 3 tabs)
| + | food |
| burgers | bread | rice |
On Friday, December 21, 2018 at 4:58:28 PM UTC-8, kiteh wrote:
>
> Instead of `class MyTabBar(QtGui.QTabBar)`, I crea
After tinkering some more with my code, using your example as a basis, I
sort of get it to work... My bad on this :)
I do have a question though.. My company is using qt designer version 4.8.5
which is pretty old, I guess?
Even so, when I was trying to get the list of widgets and its position
It seems that these layouts and the spacerItem are returning me as None
when I tried using `.widget()`
--
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,
Hi all, I have a .ui file in which I have created some widgets using
qt-designer in a specific order.
Eg.
QFrame
|- horLayout_01
|-|- buttonA
|- horLayout_02
|-|- LabelB
|-|- buttonB
|- horLayout_03
|-|- buttonC
|-|- buttonC
And later on, this particular UI is being called and use together with
Hi Justin, thank you for the example.
Perhaps I have not phrase my question properly (was being bad at putting in
words)
Using the example you have given, the reordering only happens if you click
on either buttons.. But I am trying to achieve the ui setup as the
code/tool is being called, and
Hi Jakob,
I am trying to target it to one or more tabs found within the QTabBar.
I asked about `setTabTextColor` as it was mentioned in
http://pyqt.sourceforge.net/Docs/PyQt4/qtabbar.html#setTabTextColor
Even so, how should I incorporate the `setStylesheet` for the tabs? I have
only used it
Hi all, I am having some issues with QTreeView where I populates the
information from another model.
While trying to perform the selection within the tree view, it is suppose
to be returning me the full path of the selection. However for some
reasons, there is always a 'NoneType' object/
This is my piece of actual code - https://pastebin.com/pfqDgVtX
As soon as I tried adding the following after Line 292 (after `.setModel`)
for row in range(self.tree_view.rowCount()):
data.append([])
for column in range(self.tree_view.columnCount()):
index = self.tree_view.index(row,
While I am not very adept in using PyQt yet, and this script that I have
currently have on hand, is taken from a tool (with edited functions here
and there).
I am wondering if you could advise, if it will be better for me to re-write
the whole thing?
Truth be told, as mentioned, that I took
Thanks, I will take a look!
--
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
Hi Justin,
Many thanks for getting back to me on this.
I do have some questions (kindly pardon my questions).
1. Why is there a need to use `enumerate`? It seems that the variable - `i`
is not being used anywhere.. If so, wouldn't it be better to use/ write it
as
for part in (parts):
...
In my scene, there are the following joints:
- testing:joint1_ent
- testing:joint2
- testing:joint3_ent
- testing:joint4
- testing:joint5
So I am trying to grab the 2 joints that ends with `_ent` and I used the
following code:
If I wrote my `cmds.select` as:
cmds.select('*_ent')
Got it, thanks!
--
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 discussion
Hi all, I need some advice in getting an animated walk cycle to be
converted into a treadmill-alike state such that the animation stays in one
spot.
While I am able to to get it done in the other way round - animation cycle
in one spot and have it animated in worldspace/ across a specified
Got it, thank you so much all!
I wasn't aware of the double curly brackets for such scenarios. Thanks
again!
--
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
Hi all, I am trying to do a string formatting in which it is in a
dictionary format that is to be used in mel command.
This is my mel command - `mel.eval('animLayerMerge{"BaseAnimation",
"my_layer"}')`
In my python format, I rewrote as this:
my_naming = 'my_layer'
command = '"{"BaseAnimation",
Adding on, if I tried using `mel.eval('animLayerMerge{"BaseAnimation",
"%s"}' % my_naming)`, while it seems to work, but it mutes out my_layer and
instead creates another animation layer called `Merged_Layer`
On Friday, March 8, 2019 at 11:41:29 AM UTC-8, kiteh wrote:
>
Hi all,
(once again, I am very sorry that I am posting a PyQt question instead of
purely Maya ones...)
I have a ‘nested’, a 2-tiered qmenus in which I have created a context menu
for renaming and deleting. I created a subclass for the QMenus in hopes of
making my code cleaner as I am unable
I apologize in advance for the vague title but I would like to know if
there are any ways that I can try using to check if the signals/ events in
the parent is blocking the signals/events in the child widget, or vice
verse?
class QSubAction(QtGui.QAction):
def __init__(self, text="",
Hi Justin, thanks for replying back.
You are right about the tear off in which currently not only are my options
being checkable, even when I tried to add new item within, it is not showing
the new item unless I perform a new
Having said that, I am wondering if you could share insights with me
What is the best way to check if the current panel is a viewport type?
i am trying to set the 'Image Plane' option (under Show > Image Planes) and
currently I am doing it as follows:
panel = cmds.getPanel(withFocus=True)
cmds.modelEditor(panel, edit=True, imagePlane=True)
with the assumption
tomas
>
> st 5. 6. 2019 o 1:06 kiteh > napísal(a):
>
>> What is the best way to check if the current panel is a viewport type?
>> i am trying to set the 'Image Plane' option (under Show > Image Planes)
>> and currently I am doing it as follows:
>>
>> pan
Hey Tomas, thanks for getting back.
I actually managed to get it working by using the following (too much?):
model_panels = []
focus_panel = cmds.getPanel(withFocus=True)
# Check if current panel is a modelPanel
if cmds.objectTypeUI(focus_panel) == "modelEditor":
Tried with the use of QMessageBox, and it is working fine.
Initially I had thought this would work as I am calling the confirmDialog
in frameEditied() (being first) and importRef() would be called on later..
Adding on, I tried to create the same prompt_dialog() in script editor,
wrote 2 lines
I have 2 files - main.py and utils.py.
In my utils.py, I have created a method:
def prompt_dialog(title, msg):
res = cmds.confirmDialog(
title=title,
message=msg,
button=['Yes','No'],
defaultButton='Yes',
cancelButton='No',
dismissString='No'
)
Hi all,
I am trying to do a 'skimming' or reduction method in dictionaries in which
it will returns me a set of results from a given set of condition.
However my current method is more of an additive where it will simply lists
me any items that fulfills any one of the condition.
Currently
Hi Justin, sorry for the delay in response.
It appears that I have gotten myself in this requirement that I am trying
to achieve and in the end I manage to get it with the following code:
result = []
for item in my_items:
k, v = list(item.items())[0]
if all(any(x in v.get(kc, []) for x
Hi all,
I am trying to implement a right-arrow in my QMenus and as soon as I did
that, it seems to have screw up my checkboxes?
https://media.giphy.com/media/W0cTSdMJ0f0xDq7Xx9/giphy.gif
The checkboxes you are seeing in the gif are actually QAction objects.
Wondering if anyone has experience
I have created some callbacks (using MNodeMessage) towards a node eg.
locator1.
>From this object, is it possible to check what callbacks (the ones I made)
are 'linked' to this locator?
Trying to ensure that some of the callbacks that I have created are indeed
deleted before creating new ones
Hi everyone,
I chanced across animBot, a maya plugin/ tooling where it contains several
nice features for animation related workflows.
Not here to promote the tool but there is a feature that I am interested
but could not find much information. Hoping someone here could shed some
light.
In
Hi Justin,
I was looking at the use of `threading` while waiting for replies.
I tried the following:
import threading
from maya import cmds
t = None
def run_check():
global t
t = threading.Timer(5.0, run_check)
t.start()
get_panels()
def get_panels():
for pane in
Cool, noted on that, thank you all. Will try it out.
--
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
Does Maya have some sort of callbacks or script jobs that will allows me to
run a function every 30 seconds (eg. for updating the contents in the tool)
and this callback.scriptjob will be removed upon tool closure?
--
You received this message because you are subscribed to the Google Groups
Hi all, I have some issues with the use of delegate model...
Here is my code: https://pastebin.com/yN2t20jW
In my QListWidget, I am trying to categorize stuff. In the give example,
there are 2 catergories - "All Nums" and "All Letters".
If I tried to check/ uncheck on either of the above
Hi Tim,
Thanks for the info, nonetheless! Glad to know that the scriptJob command
gets updated with new args in Maya 2019.
I have this tool written in PyQt Gui (accessed by clicking on the shelf
button icon), in which it has a checkbox within that allows/ tells user
whether the "Auto" mode
any insights on this, 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
Hi all, I am trying to write a script that checks for flipped curves within
a rig.
Initially I had one written up, though the script execution is very fast,
it is unable to process for any controllers that are either constrained or
if it is on animation layers.
However, I have re-written my
Hi all, I need some help with getting animation curves using OpenMaya.
I have 3 cases in which nodes in scene will be generated:
- Manual keyed
- By constrains
- Use of anim layers
In my code, I was able to get the first scenario working. And so I thought
it will work for the other 2
Hey Ian, sorry for the late response and thanks for getting back despite I
have removed the contents in the post.
In that script link you have provided, it is evaluating at every frame. Is
it possible to not do that?
--
You received this message because you are subscribed to the Google Groups
I think I may have made a miscommunication. Should have added in more
information.
Given in a typical scene in which I have a locator with its rotational
channels being animated in Frame 1-10.
If using the code that you have given, it does derives me the list of
rotational values in these 10
I have a locator constrained to a controller in which the constrained
channels are mainly the translate and rotate.
Initially, I tried to bake out these channels over a frame range as follows:
frames = range(1,10)
for frame in sorted(frames):
# this loops through frame range and sets
Hi all, I am trying to write a custom scriptJob that will activates when it
detects a change in an `optionVar` value.
Initially, I was using `RecentCommandChanged` as the event name, which
seemingly have work, but however, it calls everything I navigate to another
(new) tool command.
Is there
Okay, my bad, it seems that this command is only available in Maya 2019.
Unfortunately I am using an earlier version, Maya 2018 though.
any other alternatives?
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To
Hey Tim, thanks for getting back.
I am not seeing -optionVarChange within the docs of `scriptJob` command
though (I'm looking at the 2018 documentation).
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe
Is it possible to have all the maya commands within a method to be
integrated into cmds.progressBar?
I am trying to denote the process rather than just using the waitCursor
icon (as it may be deem as the application hanging)
However I am having issues in incrementing the process.
import
By the way, I always tried with "text" only where I am doing something as
follows:
import maya.mel
def progress_bar_text(text):
gMainProgressBar = maya.mel.eval('$tmp = $gMainProgressBar')
cmds.progressBar(gMainProgressBar, edit=True, status=text)
if gMainProgressBar:
Hi Justin,
Many thanks for the input.
I have one more problem, trying to change the text in the progress bar.
And so, I did something like this:
def get_progress_bar(status_text, max_value):
try:
progress_bar = mel.eval("$tmp = $gMainProgressBar")
except RuntimeError:
But even so, is
menuItem -checkBox (`optionVar -q "myToolState"`) -stp "python" -l "myTool
Mode" -c "import myTool; amyTool.toggle_mode()";
a good way for the menuItem checking to work properly?
--
You received this message because you are subscribed to the Google Groups
"Python Programming
Hi Justin, the python command actually sets the optionVar in the tool
itself.
def toggle_mode():
state = cmds.optionVar(q = 'myToolState')
# In the method of these two, it will set the optionVar value again
# cmds.optionVar(intValue = ('myToolState', state))
if state == 1:
Hi everyone,
I have a shelf button that has a popup menu when performing a right mouse
click.
These shelf button and menu are created using mel.
In the menu item of the popup menu, the menuItem within is actually a
checkbox option where it co-relates to a pyqt checkbox within a tool that
was
Hi all, I need some help with Animation-related + OpenMaya API help.
I am using OpenMaya to iterate rig controllers I have in my scene, in which
I am mainly targeting at the rotational attributes.
However I got a snag if the animation data of the controller(s) comes from
an animation layer.
Just realized that I have omitted a portion of the code, but have linked it
here for better clarity - https://pastebin.com/raw/mpxQsbVT
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and
2 Animation Layers in my scene - "BaseAnimation" and "testing:AnimLayer1"
While trying to query all the existing animation layers in the scene:
for layer in cmds.ls(type="animLayer"):
print layer
# BaseAnimation
# AnimLayer1
I was expecting "testing:AnimLayer1" as part of the result but
the results are only returning me "AnimLayer1", "BaseAnimation" or
":"
On Thursday, March 5, 2020 at 11:20:02 AM UTC-8, Justin Israel wrote:
>
>
>
> On Fri, Mar 6, 2020, 8:14 AM kiteh >
> wrote:
>
>> 2 Animation Layers in my scene
I have a number of image planes (created using Free Image Plane), of
varying sizes. By varying sizes, I mean to say that the image sources are
of different dimensions. (No changes are made towards the scale attributes)
Even so, I am trying to create a script in which it will allows me to
# Use render's
> resolution.
>
>
> Im not sure to understand what you are trying to do. Are you trying to do
> something like this : https://github.com/imageworks/spReticle
>
>
> On Thursday, January 23, 2020 at 8:30:23 PM UTC-5, kiteh wrote:
>>
>> I have a number
Hi everyone, I had this weird issue with the use of MEventMessage for
`timeChanged`
What I am trying to achieve is - When User scrubs the time slider, eg. from
F1 to F10, the `timeChanged` event that I have created, will be picked up
and returning me the current attribute of that frame.
Eg. I
80 matches
Mail list logo