Re: [Maya-Python] Qt.py and .ui files

2016-09-20 Thread Marcus Ottosson
Ok, we’ve made an alpha version of this to test with.

If you’re interested in compiling Qt Designer files for use across
bindings, your help would be most appreciated. The rule is, .ui files are
first compiled with the PySide2 compiler, and then converted to Qt.py.

$ pip install Qt.py
$ pyside2-uic my_ui.ui -o my_ui.py
$ python -m Qt --convert my_ui.py# Creating "my_ui_backup.py"..#
Successfully converted "my_ui.py"

The resulting Python module should be compatible with every binding. If
it’s not, submit a bug report or pull-request and we’ll see it fixed!

In Maya 2017, the compiler executable will be located in your Maya
installation directory, alongside mayapy and maya.

Let me know how that works for you!
​

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAFeBykPjOk4UfjSP%2BJW_P-roa9qm5MHFDix_JDgW6KPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Issues with getting the root node of the hierarchy based on selection

2016-09-20 Thread Justin Israel
> I got the issue, where if I select only 1 pCube#, and it returns nothing,
> though it seems to be working if I only select 1 Root Node
> While that is one of the issue, can someone kindly guide me if I am
> writing my code correctly?
>

I could see why this might happen. The first thing you do is grab the
current selection ("sel"). So if you have a 'pCube#' selection, then that
is the item in the list. Then you call cmds.ls(sel, type='stkLevel') on
that list. Are you expecting that to somehow resolve the root node for you?
Because after you check if its the only item in the list, you hit the
"else" branch and return stkLevel_node[0]. What does that actually return?
What is in that list?


> I asked this because first I am still not that great of a scripter and I
> feel that I am forcing my way through while following those conditions
>

Well I do see that you are not returning from your function after you print
warnings. Like, if there is nothing selection, you still run the rest of
your function.

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0mdcp7LwoVHHVMUTWevw1%2BQCA3M5J%3DFue0a-KxRRoDXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Issues with getting the root node of the hierarchy based on selection

2016-09-20 Thread yann19
Hi all, I need some help with this function of mine.
Suppose I have the following hierarchy as seen in the attachment.
Assuming that everything in that attachment is of custom nodes (I used 
locators, groups etc. for easy visual, i hope)
and I am trying to grab the Root Node in which its type is 'stkLevel'.

I am trying to fulfill a few conditions:

   1. User can select either the Root Node or the pCube#
   2. If User selects nothing in the scene, it will prompts a warning
   3. If User selects more than 2 Root Node, it will prompts a warning
   4. If User selects 1 or more 'pCube#', it will return the Root Node 
   within the hierarchy
   5. Ultimately, this function must return the full path of the Root Node

def get_stkLevel():
sel = cmds.ls(selection=True, l=True)
if len(sel) == 0:
cmds.warning("Please select something")


stkLevel_node = cmds.ls(sel, type = "stkLevel")
if len(sel) > 1:
if stkLevel_node:
cmds.warning("Please select a valid stkLevel node")
else:
root_list = []
for item in sel:
root_node = item.split('|')[1]
if root_node not in root_list:
root_list.append(root_node)
return cmds.ls(root_list, l=True)[0]
else:
return stkLevel_node[0]


I got the issue, where if I select only 1 pCube#, and it returns nothing, 
though it seems to be working if I only select 1 Root Node
While that is one of the issue, can someone kindly guide me if I am writing 
my code correctly?
I asked this because first I am still not that great of a scripter and I 
feel that I am forcing my way through while following those conditions



-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/ecb59d2c-9ab4-4141-99c0-41482ae77027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] getAttr of fileTextureName on an image sequence doesn't return wildcards

2016-09-20 Thread Justin Israel
On Wed, Sep 21, 2016 at 1:11 AM Lidia Martinez 
wrote:

>
> I need to modify the path set for an image sequence on a texture file.
> First, when I try to get the path using getAttr, instead of having the
> same string in the field:
>
> path_to_files_.iff
>
> I get the first file of the sequence instead:
>
> path_to_files_0001.iff
>
> I suppose this is a bug in Maya?...
>
>
> This was set by the people working on the textures, and they didn't know
> doing it automatically would not generate a  pattern, but that .
>

How about this?

cmds.getAttr(".computedFileTextureNamePattern")
# path_to_files_.iff

http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/Nodes/file.html

*computedFileTextureNamePattern* (*cfnp*) string
TmultiSharedObject::create"" [image: output]
[image:
input]
[image:
hidden]

*Computed File Texture NamePattern *is the name of an image file with
certain parts replaced with token identifiers based on the configuration of
the file node. This value is automatically computed by Maya and never
stored.

That would make sense why it wasn't being returned by the normal
"fileTextureName" attribute, since its computed and used dynamically.



>
>
> So, after modifying that path, I need to generate the right path ending
> again, replacing that number for  or .
>
>
> If I change to , Arnold (which is the plugin that will eventually uses
> it), doesn't get the texture that used to work. Weird, because if you
> change it by hand on Maya, it works.
>
> If I set  , Arnold returns "unknown token " error.
>
>
> This is not an Arnold problem. The thing is that changing that using code
> breaks the path somehow.
>
>
>
> Any ideas?
>
> Thanks
>
>
> --
> Lidia
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8wmCchawE-VQyXU%2BkdDw%2BTgtBZkWatzqxOciKD2ZxiFRg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0Mhex7Qxe%3D_U1_xyW-JG9oFCDojrj4JGMrFyvOMN8R0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Better way to select a object by it's verts?

2016-09-20 Thread Marcus Ottosson
Don't mention it, glad it worked!​

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD9y70FdwNsiv25PMg8Dwq0rBhi3j-BcXOF4u6LcePLBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: succesfully adding to PYTHONPATH using Maya.env

2016-09-20 Thread Robert White
Usually the path separator is ; not ,

Not sure if that is the potential problem here or not.
I've stopped using the Maya.env file, and instead do any environment 
variable setup in a maya module definition file.
Some links:
http://docs.autodesk.com/MAYAUL/2013/ENU/Maya-API-Documentation/index.html?url=files/GUID-9E096E39-AD0D-4E40-9B2A-9127A2CAD54B.htm,topicNumber=d30e30995
http://around-the-corner.typepad.com/adn/2012/07/distributing-files-on-maya-maya-modules.html
http://techartsurvival.blogspot.com/2014/01/mayas-mildy-magical-modules.html

On Tuesday, September 20, 2016 at 3:22:00 PM UTC-5, smann wrote:
>
> Has  anyone been able to get the maya.env to add to an existing PYTHONPATH 
> ? 
>
> adding the MAYA_SCRIPT_PATH  is as easy as 
>
> MAYA_SCRIPT_PATH = %MAYA_SCRIPT_PATH%, c:/myWwnDir
>
> but doing the same with PYTHONPATH doesn't appear to be working. 
>
> PYTHONPATH = %PYTHONPATH% , c/myOwnDir/
>
> ( does not add to the PythonPath) 
>
>  I can certainly go and write some os.path.append  statements. but If 
> possible I'd like to be to keep it in the MAYA.env and easily distributed.
>
> thanks
>
> -=s
>
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/3719af33-044f-49d0-8120-574466b3566d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Better way to select a object by it's verts?

2016-09-20 Thread Marcus Ottosson
Hm, that should work. Here’s an example that works for me in Maya 2016.

cmds.file(new=True, force=True)
cmds.polyCube()
cmds.select("pCube1.vtx[0]")
dag_object = cmds.ls(sl=True, objectsOnly=True)
cmds.select(dag_object)

​

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC8-w9M91HQDbvBnLnE_uRw52nXBS6MbMBmiCRZ9%2BBWNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Better way to select a object by it's verts?

2016-09-20 Thread Marcus Ottosson
Have a look at passing objectsOnly=True to the ls() function.

> On 20 Sep 2016, at 21:14, I73  wrote:
> 
>   selectedObject = cmds.ls( selection=True)
>   dagObject = selectedObject[0].split('.')[0]
>   cmds.select(dagObject)
> 
> Currently I am able to return the dag object by using a split method, is 
> there a cleaner way of doing this?
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/b36e49be-3d5b-4969-8175-c6468b3acd18%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/0BA1BC98-E165-42B1-832D-C637D77CECE4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] succesfully adding to PYTHONPATH using Maya.env

2016-09-20 Thread stephenkmann
Has  anyone been able to get the maya.env to add to an existing PYTHONPATH
?

adding the MAYA_SCRIPT_PATH  is as easy as

MAYA_SCRIPT_PATH = %MAYA_SCRIPT_PATH%, c:/myWwnDir

but doing the same with PYTHONPATH doesn't appear to be working.

PYTHONPATH = %PYTHONPATH% , c/myOwnDir/

( does not add to the PythonPath)

 I can certainly go and write some os.path.append  statements. but If
possible I'd like to be to keep it in the MAYA.env and easily distributed.

thanks

-=s

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAASZO1f%3DRj86GSw8B-vHUt--XR2XktF%2BjrsEupxDjG0rzVj%3Djg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] mayapy playblast

2016-09-20 Thread Fredrik Averpil
synColor

Oh the memories …of segfault.

Anyway, this is something I’ve wanted to know for a while; is it possible
to switch to “legacy” from commandline somehow, prior to launching Maya or
maya.standalone? (sorry for possibly derailing the thread)
​

On Mon, Sep 19, 2016 at 7:42 AM Geordie Martinez 
wrote:

> Yes you CAN subprocess without viewport 2.0. I've been having the problem
> as well at work.
>
> you have to swap your preferences back to Legacy. then when
> ```maya.standalone.initialize()``` runs it won't search for synchronized
> color settings. which is where this devil is originating from.
>
> Legacy viewport in prefs prevents the subprocess from hanging. explanation
> below.
>
> the way I found this was deleting my prefs then noticing the subprocess
> worked fine. I eventually narrowed it down to the synColor folder in the
> prefs as well as synColor config.xml in my prefs folder. googled it and
> found out this started in Maya 2016. and that this bug is supposed to be
> fixed in the latest patches. but... I think it's back.
>
> basically, on a lark, I turned my prefs back to legacy and made sure that
> was the last maya I closed.
> then ran all of my subprocesses and lo and behold, it worked.
> the issue is that if you have more than one subprocess/session of maya
>  attempting to read/modify/write any of the synchronized color files for
> Viewport 2.0 it somehow freezes the subprocesses.
> I think it's a filesystem thing with file open/read/close conflicts. this
> is just a guess.
>
>
>
>
>
>
> On Sun, Sep 18, 2016 at 3:21 AM, Marcus Ottosson 
> wrote:
>
>> Next piece of the puzzle, no errors this time, and a successfully created
>> Quicktime file.
>>
>> $ yum install mesa-libGL-devel
>> $ export LIBQUICKTIME_PLUGIN_DIR=/usr/autodesk/maya/lib
>> $ mayapy -c "from maya import standalone, cmds; \
>>standalone.initialize(); \
>>cmds.playblast(filename='/root/workspace/myplayblast')"# VP2 Warning : 
>> Graphics hardware has been detected to have insufficient memory (0 MB).# 
>> Please check your video card and driver to ensure that a minimum amount of 
>> memory exists (512 MB).# The environment variable MAYA_OGS_GPU_MEMORY_LIMIT 
>> can be used to explicitly set the GPU memory limit.# VP2 Warning : 
>> Insufficient shader level capabilities. Vertex (3 vs 4), Geometry (0 vs 0) 
>> Pixel (3 vs 4)# VP2 Warning : Graphics hardware feature level insufficient 
>> to support renderer (2 vs 4)
>>
>> The file is, however, 700 bytes and contains no images. :(
>>
>> My guess is it successfully creates the file and is just about to fetch
>> images from the viewport (which one?) and silently fails.
>>
>> $ hexdump -C myplayblast.mov  00 00 00 20 66 74 79 70  71 74 20 20 
>> 20 05 03 00  |... ftypqt   ...|0010  71 74 20 20 00 00 00 00  00 00 00 
>> 00 00 00 00 00  |qt  |0020  00 00 00 01 6d 64 61 74  00 00 
>> 00 00 00 00 00 10  |mdat|0030  00 00 02 a4 6d 6f 6f 76  00 
>> 00 00 6c 6d 76 68 64  |moov...lmvhd|0040  00 00 00 00 d4 04 17 19  
>> d4 04 17 19 00 00 00 18  ||0050  00 00 00 00 00 01 00 00 
>>  01 00 00 00 00 00 00 00  ||0060  00 00 00 00 00 01 00 
>> 00  00 00 00 00 00 00 00 00  ||
>> *0080  00 00 00 00 40 00 00 00  00 00 00 00 00 00 00 00  
>> |@...|0090  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
>>  ||00a0  00 00 00 02 00 00 02 28  74 72 61 6b 00 00 00 
>> 5c  |...(trak...\|00b0  74 6b 68 64 00 00 00 0f  d4 04 17 19 d4 04 
>> 17 19  |tkhd|00c0  00 00 00 01 00 00 00 00  00 00 00 00 00 
>> 00 00 00  ||00d0  00 00 00 00 00 00 00 00  00 00 00 00 
>> 00 01 00 00  ||
>> *00f0  00 00 00 00 00 00 00 00  00 00 00 00 40 00 00 00  
>> |@...|0100  01 40 00 00 00 f0 00 00  00 00 00 24 65 64 74 73 
>>  |.@.$edts|0110  00 00 00 1c 65 6c 73 74  00 00 00 00 00 00 00 
>> 01  |elst|0120  00 00 00 00 00 00 00 00  00 01 00 00 00 00 
>> 01 a0  ||0130  6d 64 69 61 00 00 00 20  6d 64 68 64 00 
>> 00 00 00  |mdia... mdhd|0140  d4 04 17 19 d4 04 17 19  00 00 00 18 
>> 00 00 00 00  ||0150  00 00 00 64 00 00 00 41  68 64 6c 
>> 72 00 00 00 00  |...d...Ahdlr|0160  6d 68 6c 72 76 69 64 65  00 00 
>> 00 00 00 00 00 00  |mhlrvide|0170  00 00 00 00 20 4c 69 62  71 
>> 75 69 63 6b 74 69 6d  | Libquicktim|0180  65 20 56 69 64 65 6f 20  
>> 4d 65 64 69 61 20 48 61  |e Video Media Ha|0190  6e 64 6c 65 72 00 00 01 
>>  37 6d 69 6e 66 00 00 00  |ndler...7minf...|01a0  14 76 6d 68 64 00 00 
>> 00  01 00 40 80 00 80 00 80  |.vmhd.@.|01b0  00 00 00 00 39 68 
>> 64 6c  72 00 00 00 00 64 68 6c  |9hdlrdhl|01c0  72 61 6c 69 73 
>> 00 00 00  00 00 00 00 00 00 00 00  |ralis...|01d0  00 18 4c 69 
>> 6e 75 78 

[Maya-Python] Re: getAttr of fileTextureName on an image sequence doesn't return wildcards

2016-09-20 Thread Lidia Martinez
Just as a follow up. Maya does this on the background when you activate
image sequences:


import maya.app.general.fileTexturePathResolver
maya.app.general.fileTexturePathResolver.getFilePatternString('C:/texture.0001.iff',
True, 0)
# Result: 'C:/texture..iff'

But it doesn't tell you what it does, because if you set that using setAttr
, it will fail in Arnold. But if you let maya do it, it will work. Maya is
doing something else after getting that, but echoing all commands will
return nothing after that call.

So after that, maya is doing some magic I don't know about...




--
Lidia

2016-09-20 15:10 GMT+02:00 Lidia Martinez :

>
> I need to modify the path set for an image sequence on a texture file.
> First, when I try to get the path using getAttr, instead of having the
> same string in the field:
>
> path_to_files_.iff
>
> I get the first file of the sequence instead:
>
> path_to_files_0001.iff
>
> I suppose this is a bug in Maya?...
>
>
> This was set by the people working on the textures, and they didn't know
> doing it automatically would not generate a  pattern, but that .
>
>
> So, after modifying that path, I need to generate the right path ending
> again, replacing that number for  or .
>
>
> If I change to , Arnold (which is the plugin that will eventually uses
> it), doesn't get the texture that used to work. Weird, because if you
> change it by hand on Maya, it works.
>
> If I set  , Arnold returns "unknown token " error.
>
>
> This is not an Arnold problem. The thing is that changing that using code
> breaks the path somehow.
>
>
>
> Any ideas?
>
> Thanks
>
>
> --
> Lidia
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8wiAYuBD_C7iUM_gBWYQ0-RWEcDL2VLMyALywn2V9b3NQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: How to change the text color of an item in a QListWidget?

2016-09-20 Thread Juan Tigreros
Thanks Justin!!! This was the missing piece. :) I truly appreciate the 
help. 

On Tuesday, September 20, 2016 at 10:54:50 AM UTC+2, Juan Tigreros wrote:
>
> Hi everyone! 
>
> Perhaps this is a simple question but I can seemed to succeed at googling 
> it. Maybe someone here can help?
>
> I would like to change the text color of a text or background color if the 
> item in a qlistwidget? I am double clicking on an item and will like to 
> change the color of it, then change it back once i double clicked in 
> another item in the list. Any ideas?
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2f0b8b87-7e30-4018-82e2-851bc8c55630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Maya API MEvent

2016-09-20 Thread Rémi Deletrain
Hi everyone,

It's possible to get MEvent of panel ?
I try to get mouse clic out of MpxContext / draggerContext / Qt.

Maya have this MEvent for move, rotate camera, select, etc etc  But 
it's impossible to get this event ?! ...

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/a98e7142-d757-415b-8060-1f8ac911bd0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: How to change the text color of an item in a QListWidget?

2016-09-20 Thread Alok Gandhi
Take a loot at the pyside docs here:
https://srinikom.github.io/pyside-docs/contents.html

You can also use `PySide.QtGui.QWidget.setStyleSheet(styleSheet)` to update
the colors.


For capturing double click, another approach would be apply an even filter:

def clickable(widget):
"""Re implementation Double Click Event on a widget"""
class MouseDoubleClickFilter(QtCore.QObject):
doubleClicked = QtCore.pyqtSignal()

def eventFilter(self, obj, event):
if obj == widget:
if event.type() == QtCore.QEvent.MouseButtonDblClick:
self.doubleClicked.emit()
return True

return False

filter = MouseDoubleClickFilter(widget)
widget.installEventFilter(filter)

return filter.doubleClicked



And then connect this signal:

# Connect the double click signal
clickable(qlistwidget).connect(handleDoubleClick)
def handleDoubleClick():
# Implement your color update logic here
pass



On Tue, Sep 20, 2016 at 5:48 PM, Juan Tigreros  wrote:

> Thanks for the quick response Justin.
>
> First, I should mention that I am fairly new to this. With that said, here
> is what im trying to do.
> def doubleClickedItem(self):
> """for when an item is double clicked """
>
> theListWidget = self.sender()
> currentItem = theListWidget.currentItem()
> currentItemText = currentItem.text()
> currentItem.setBackground(QtGui.QColor('red'))
>
>
> So, the idea is that I capture the sender item and changed its color to
> red after is doublecliked. But all the documentation I can find is in c++
> and have not come across python examples. I am sure its prob very easy to
> port those examples to python, however, i am still learning and currently
> stumped by this.
>
> On Tuesday, September 20, 2016 at 10:54:50 AM UTC+2, Juan Tigreros wrote:
>>
>> Hi everyone!
>>
>> Perhaps this is a simple question but I can seemed to succeed at googling
>> it. Maybe someone here can help?
>>
>> I would like to change the text color of a text or background color if
>> the item in a qlistwidget? I am double clicking on an item and will like to
>> change the color of it, then change it back once i double clicked in
>> another item in the list. Any ideas?
>>
> --
> 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 on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/78f19fba-ce1b-4697-b768-
> e9d686c78b40%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



--

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMSbTKJqWpRjf24%3DHCsatoBwXhfe-2guE1eDgH5%2BNmuQFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: How to change the text color of an item in a QListWidget?

2016-09-20 Thread Juan Tigreros
Thanks for the quick response Justin.

First, I should mention that I am fairly new to this. With that said, here 
is what im trying to do. 
def doubleClickedItem(self):
"""for when an item is double clicked """
 
theListWidget = self.sender()
currentItem = theListWidget.currentItem()
currentItemText = currentItem.text()
currentItem.setBackground(QtGui.QColor('red'))


So, the idea is that I capture the sender item and changed its color to red 
after is doublecliked. But all the documentation I can find is in c++ and 
have not come across python examples. I am sure its prob very easy to port 
those examples to python, however, i am still learning and currently 
stumped by this. 

On Tuesday, September 20, 2016 at 10:54:50 AM UTC+2, Juan Tigreros wrote:
>
> Hi everyone! 
>
> Perhaps this is a simple question but I can seemed to succeed at googling 
> it. Maybe someone here can help?
>
> I would like to change the text color of a text or background color if the 
> item in a qlistwidget? I am double clicking on an item and will like to 
> change the color of it, then change it back once i double clicked in 
> another item in the list. Any ideas?
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/78f19fba-ce1b-4697-b768-e9d686c78b40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] How to change the text color of an item in a QListWidget?

2016-09-20 Thread Juan Tigreros
Hi everyone! 

Perhaps this is a simple question but I can seemed to succeed at googling 
it. Maybe someone here can help?

I would like to change the text color of a text or background color if the 
item in a qlistwidget? I am double clicking on an item and will like to 
change the color of it, then change it back once i double clicked in 
another item in the list. Any ideas?

-- 
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 on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/3f1cd8c0-0f1f-471a-80e8-49205b0dbe36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.