Re: [Maya-Python] How do I make maya 2015 font bigger by stylesheet ?

2016-10-27 Thread Fredrik Averpil
We're manipulating the MayaStrings file for Maya 2015:
https://www.youtube.com/watch?v=1lidN_bJSS0

-- 
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/CAD%3DwhWOz8rnox-O7bGkak3cNJLFwV%2Brk9HMQgbRhi9xU%3DyR-TQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Domestic Cleaning services in Bangalore

2016-10-27 Thread busybizz bizz


Domestic Cleaning services in Bangalore/ Cleaning Services in Bangalore 


*Cleaning Services in Bangalore - List of expert cleaners in Bangalore and 
cleansing businesses, businesses, price, contact addresses, smartphone 
numbers, person ratings and opinions immediately on **busybizz.com* 

http://busybizz.com/Cleaning-Services-Bangalore.php

-- 
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/c2e2928b-8384-459e-9fba-bc83685d901e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Painting Contractors in adugodi

2016-10-27 Thread busybizz bizz


Painting Contractors in adugodi 


 List of top painting services, works, companies in Bangalore and get 
painting price, companies contact addresses, phone numbers, ratings and 
evaluations right away on busybizz.com 


http://busybizz.com/Painting-Contractors-Bangalore.php

-- 
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/e7a7edb0-3440-4867-92f5-484760b69390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Help with a closure in Maya and Python.

2016-10-27 Thread Padraig Ó Cuínn
Hi everyone. 

I am trying to figure a way out of exiting a closure and executing the 
nested function within it. 
So far I have only seen on the net closures within the 1 file. let me show 
you what I mean. 

#File_1

def pressButton():
for nodes in file_2.selection():
print nodes


pressButton is nested in a function called create_window

#File_2

def selection():
pymel.core.selection(n="transforms")

selection is the function I want to call from pressButton() but is imported 
from another file.

I am looking for most efficient way to escape this closure while still 
maintaining functionality of the UI.

Thanks in advance.

-- 
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/740e93d4-3934-42b1-9b9a-1cc5fe78ae60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Using strings as a check in __init__?

2016-10-27 Thread Alok Gandhi
>
> I am not very familiar with using the underscores, in this case, public
> and private variables, as a matter of fact. If you read my code, pretty
> much everything is not of private variables.

Sure, I understand. Please note that nothing is really private in python. There
is nothing to prevent you from poking around inside and using various
internals of a class. The pythonic idea is *'we're all consenting adults
here'. *Meaning that a leading '_' implies that the author wants the
variable to be private. Nothing more, nothing less. If your variables are
to be used used outside the class, there is no need for making them
private. But do remember, whatever you expose, WILL be used by the cosumers
and they will do everything they can, to that variable. Your logic should
then be strong enough to be able to handle anything that is executed by the
consumers. This may or may not apply in your example case, but keep that in
mind, as a guiding principle, whenever you code. This way your code will be
future-proofed.

Was not aware that I can add a number of states but in your code, can I
> suppose that both ALLOWED_STATES and SELECTION_STATES are considered as
> global variables then?

In my example code, they are globals but you can move them inside the class
as well. The only reason to make them global is that other participating
classes and interface functions can use them freely. Also note that, in
python, classes can also acts as a namespace, Justin's code implements the
`state`enums using the class as a namespace. In fact, if you look at it, a
class is just like a module. The 'self' (recommened as a strong convention)
is just a way to tell the methods that you are referring to this class'
namespace in the instance. Otherwise, for all intents and purposes, a class
can be used as a namespace or module.

On Fri, Oct 28, 2016 at 1:25 AM, likage  wrote:

> @Justin
> Truth be told, initially I wrote it as:
> if self.state == self.STATE_ROOT_SELS:
> # Run function_A()
> if self.state == self.STATE_USER_SELS:
> # Run function_B()
> There was no `else` and then before posting my thread, I rewrote it to
> using `if...elif...` but am unsure whether if I should add in `else` as
> while reading online, I was given the impression it should be
> `if...elif...else` and hence else is needed?
>
> Additionally, seeing that I have pretty much put the 'checks' handling in
> the `run_dialog`, assuming that it fulfills the following...
> 1. if the root node is selected
> 2. the child selection are all of nodeType 'mesh' only
> 3. returns an error/warning if all other node types
>
> @Alok
> Any comments are welcome! I am still learning :D
> I am not very familiar with using the underscores, in this case, public
> and private variables, as a matter of fact. If you read my code, pretty
> much everything is not of private variables..
>
> Was not aware that I can add a number of states but in your code, can I
> suppose that both ALLOWED_STATES and SELECTION_STATES are considered as
> global variables then?
>
> @Marcus
> To your questions, yes, there are some conventions that I will need to
> follow but they are somewhat similar to the google docstring but I can
> hardly find much information for my case in my company's code. Been
> following the Google docstring conventions for my use, it has been useful :)
>
>
> --
> 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/ba9fb2bd-c5c3-4770-9269-
> f4c9d8b34a78%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/CAPaTLMSxe53aYfpPJJXYkMTuKgY13H7DMSyskO4DKq9BzcsmkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] How do I make maya 2015 font bigger by stylesheet ?

2016-10-27 Thread Justin Israel
Ah sorry. I misread and was actually looking at the ChannelBox and not the
Outliner, like you asked.
I don't know how effect the Outliner off hand. it is free to ignore QFont
and stylesheet settings, and draw however it wants in its own
implementation.

Justin


On Fri, Oct 28, 2016 at 1:41 PM oglop  wrote:

> yes I have tried that, it does not affect outliner font either. And it
> does not change font size on the top edge of viewport while CSS method
> works for that.
>
> --
> 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/f9042b95-d35f-4b7c-a358-6423c01aca9e%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/CAPGFgA2%2B%3Dh6EFkEYwyHTJtWNNq5tVxVC4D_r4fOP1Fr0fPMLqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] How do I make maya 2015 font bigger by stylesheet ?

2016-10-27 Thread oglop
yes I have tried that, it does not affect outliner font either. And it does not 
change font size on the top edge of viewport while CSS method works for that.

-- 
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/f9042b95-d35f-4b7c-a358-6423c01aca9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] How do I make maya 2015 font bigger by stylesheet ?

2016-10-27 Thread Justin Israel
Stylesheets may not be the most reliable way. Have you tried just playing
with the Application font?

font = QtGui.qApp.font()
font.setPixelSize(16)
QtGui.qApp.setFont(font)

​

Justin


On Fri, Oct 28, 2016 at 10:06 AM oglop  wrote:

> It seems I can use this to make most ui font bigger, but not for outliner.
>
> from PyQt4 import QtGui
> app = QtGui.QApplication.instance()
>
> styleSheet = '''
>
> * {
>   font: 16px;
> }
> '''
>
> app.setStyleSheet(styleSheet)
>
> I tried to get qt object of outlinerPanel1Window and called setFont() on
> it, but it doesn't work.
>
> --
> 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/88365859-a6e6-479c-84d1-987d56db78bd%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/CAPGFgA2UEdBJvU6yOTMXbhpuPkSMCJy0fnDTPexoFXDhPGrdfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: When to use Logical Indicies over Physical Indicies

2016-10-27 Thread Cedric Bazillou
#So i did a quick test and i post a incorrect answer previously:

import maya.cmds
import maya.OpenMaya 

targetNode = maya.cmds.createNode('transform')
maya.cmds.addAttr(targetNode, ln='input', m=True, v=True)

for index in [12, 13, 16, 23]:
maya.cmds.setAttr('{0}.input[{1}]'.format(targetNode, index), index)

selList = maya.OpenMaya.MSelectionList()
maya.OpenMaya.MGlobal.getSelectionListByName(targetNode,  selList)
depNode = maya.OpenMaya.MObject()
selList.getDependNode(0, depNode) 

depUtils = maya.OpenMaya.MFnDependencyNode(depNode)
inputPlug = depUtils.findPlug('input')

print inputPlug.name()
indices = maya.OpenMaya.MIntArray()
inputPlug.getExistingArrayAttributeIndices(indices)
print indices
print inputPlug.numElements()

indexToRead = 0
print inputPlug.elementByPhysicalIndex(indexToRead).name()

#---
"""
*elementByPhysicalIndex(indexToRead) == indices[indexToRead]*

elementByPhysicalIndex refers to relative index in your array
elementByLogicalIndex will mostly point out to the connection *slot *of the 
attribute ( the element hosting the data )

what is dangerous if you use elementByLogicalIndex is that maya will create 
an input/output element at this connection index if its empty(its the 
standard behavior by the way).
in your datablock it migh be better to avoid using MPlug ( you can do 
everything cleanly with attribute).
"""

-- 
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/f143efee-cf80-4cb4-acd1-97ad44656d1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] How do I make maya 2015 font bigger by stylesheet ?

2016-10-27 Thread oglop
It seems I can use this to make most ui font bigger, but not for outliner.

from PyQt4 import QtGui
app = QtGui.QApplication.instance()

styleSheet = '''

* {
  font: 16px;
}
'''

app.setStyleSheet(styleSheet)

I tried to get qt object of outlinerPanel1Window and called setFont() on it, 
but it doesn't work. 

-- 
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/88365859-a6e6-479c-84d1-987d56db78bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: When to use Logical Indicies over Physical Indicies

2016-10-27 Thread Cedric Bazillou
I dont have maya at work but from what you wrote i think you understood it 
the reverse way your physical index are 12, 13, 26.
Maya when it will process the datablock work on them in a sorted order so 
the logical index 0 will refer to physical index 12  (1 -> 13) and so on.

>
>>
>

-- 
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/978997fc-117a-47ad-b405-d63d65e04af0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Using strings as a check in __init__?

2016-10-27 Thread likage
@Justin
Truth be told, initially I wrote it as:
if self.state == self.STATE_ROOT_SELS:
# Run function_A()
if self.state == self.STATE_USER_SELS:
# Run function_B()
There was no `else` and then before posting my thread, I rewrote it to 
using `if...elif...` but am unsure whether if I should add in `else` as 
while reading online, I was given the impression it should be 
`if...elif...else` and hence else is needed?

Additionally, seeing that I have pretty much put the 'checks' handling in 
the `run_dialog`, assuming that it fulfills the following...
1. if the root node is selected
2. the child selection are all of nodeType 'mesh' only
3. returns an error/warning if all other node types

@Alok
Any comments are welcome! I am still learning :D
I am not very familiar with using the underscores, in this case, public and 
private variables, as a matter of fact. If you read my code, pretty much 
everything is not of private variables..

Was not aware that I can add a number of states but in your code, can I 
suppose that both ALLOWED_STATES and SELECTION_STATES are considered as 
global variables then?

@Marcus
To your questions, yes, there are some conventions that I will need to 
follow but they are somewhat similar to the google docstring but I can 
hardly find much information for my case in my company's code. Been 
following the Google docstring conventions for my use, it has been useful :)


-- 
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/ba9fb2bd-c5c3-4770-9269-f4c9d8b34a78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Using strings as a check in __init__?

2016-10-27 Thread Alok Gandhi
Sorry about the slight typo in the last code I posted, should be

super(HierarchyDialog, self).__init__(parent=parent)


-- 
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/725f81f2-1c32-4909-9892-aba56e17cbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: Python screenshot

2016-10-27 Thread jonn
http://www.cgdzg.com/maya-screenshot/

在 2016年10月6日星期四 UTC+8下午5:00:54,3da...@gmail.com写道:
>
> Hi
>Anyone knows any existing library or quick method to do a screenshot 
> using python. I should be able to select a region to be screen grabbed. Am 
> looking for an option on windows.
>
> thanks
>
> Arjun
>

-- 
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/ae404397-bece-4220-b6a1-368699b12a10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.