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

2016-10-26 Thread Alok Gandhi
Most of what I wanted to comment is already covered by Justin and Marcus.
Here are my very very minor comments (consider them as extras):

1. self._state instead self.state (~ by convention, self.state should be
used only if `state` is public. From your code, and I presume, `state` is
not public. I usually start with ALL attributes - (methods, properties) as
private (starting with an '_') and then make them public, further down the
development as the need arises.

2.

> # Documenting states
> STATE_ROOT_SELS = "root_sels"
> STATE_USER_SELS = "user_sels"
>

are just enums and just can be alternatively written as, which are more
convenient to use

(
STATE_ROOT_SELS,
STATE_USER_SELS,) = range(2)



This way you can add huge number of states, (though not required in your
case), simply by adding another line, without having to worry about the
corresponding strings. The bonus is more protection from potential bugs
when you accidentally assign "same string val" to different attrs.

The above code can be made more procedural (although a bit convoluted), and
can be used at module level -

from collections import namedtuple

ALLOWED_STATES = [
'ROOT_SELS',
'USER_SELS',
# Feel free to add more states here
]

SELECTION_STATES = (namedtuple('SELECTION_STATES', ALLOWED_STATES)
  (*range(len(ALLOWED_STATES


Enums became a part of python standard library as of 3.4, here is the PEP
,

In the light of all of the above, the code becomes:

from collections import namedtuple

ALLOWED_STATES = [
'ROOT_SELS',
'USER_SELS',
# Feel free to add more state here
]

SELECTION_STATES = (
namedtuple('SELECTION_STATES', ALLOWED_STATES)(*range(len(ALLOWED_STATES

class HierarchyDialog(QtGui.QDialog):
def __init__(self, state, parent=None):
super(HierarchyDialog, self).__init(parent=parent)

self.setWindowTitle('Hierarchy Dialog')
self.setModal(False)

self._state = state

if self._state == SELECTION_STATE.ROOT_SELS:
# Run function_A()
pass
elif self._state == SELECTION_STATES.USER_SELS:
# Run function_B()
pass
else:
cmds.warning("Please check your selections."
 " Either select some nodes or a root node")

def run_dialog():
selection = cmds.ls(selection=True)
if not selection:
cmds.warning("Please select a Stack or some nodes")
return

state = None
if len(selection) == 1 and cmds.nodeType(selection) == 'nurbsSurface':
state = SELECTION_STATES.ROOT_SELS
elif len(selection) >= 1:
for items in selection:
if not cmds.nodeType(selection) == 'nurbsSurface' in items:
state = SELECTION_STATES.USER_SELS

dialog = HierarchyDialog(state)
dialog.show()
return dialog



On Thu, Oct 27, 2016 at 9:44 AM, Justin Israel 
wrote:

>
>
> On Thu, Oct 27, 2016 at 2:16 PM likage  wrote:
>
>>
>> 2. Is there any chance that I will need to add in an `else` statement
>> should the self.state not conform to either `self.STATE_ROOT_SELS` or
>> `self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from
>> happening in the run_dialog function, right?
>>
>>
>> Can you raise a ValueError if they don't pass a valid constant?
>>
>>
>> Hey Justin, was wondering if you could give me an example scenario as to
>> when this will occurs?
>> I asked because I tried selecting objects of other node types etc, I am
>> getting errors (need to rewrite my logic here) but only within the
>> `run_dialog` and it does not seems to pass in this `else` statement..
>>
>
> In your run_dialog() function, it looks like there is the potential for
> "state" to be an empty string, and passed to your dialog constructor. If it
> is not acceptable for your dialog to operate without a valid state value,
> then your dialog should raise a ValueError. If it can operate with an
> invalid state value, then don't raise an exception.
>
> So in your run_dialog(), what does it mean for your dialog to receive an
> empty string for state? Can the dialog still be 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/2cd81c76-93f9-4837-81b8-
>> be04c5d90bb4%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 

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

2016-10-26 Thread Justin Israel
On Thu, Oct 27, 2016 at 2:16 PM likage  wrote:

>
> 2. Is there any chance that I will need to add in an `else` statement
> should the self.state not conform to either `self.STATE_ROOT_SELS` or
> `self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from
> happening in the run_dialog function, right?
>
>
> Can you raise a ValueError if they don't pass a valid constant?
>
>
> Hey Justin, was wondering if you could give me an example scenario as to
> when this will occurs?
> I asked because I tried selecting objects of other node types etc, I am
> getting errors (need to rewrite my logic here) but only within the
> `run_dialog` and it does not seems to pass in this `else` statement..
>

In your run_dialog() function, it looks like there is the potential for
"state" to be an empty string, and passed to your dialog constructor. If it
is not acceptable for your dialog to operate without a valid state value,
then your dialog should raise a ValueError. If it can operate with an
invalid state value, then don't raise an exception.

So in your run_dialog(), what does it mean for your dialog to receive an
empty string for state? Can the dialog still be 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/2cd81c76-93f9-4837-81b8-be04c5d90bb4%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/CAPGFgA1EGuYDhMYN4LDGb%2BR3uX8D%3D3Aiom_3KUz9uv85jDBK9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread likage

>
>
>> 2. Is there any chance that I will need to add in an `else` statement 
>> should the self.state not conform to either `self.STATE_ROOT_SELS` or 
>> `self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from 
>> happening in the run_dialog function, right? 
>
>
Can you raise a ValueError if they don't pass a valid constant?  

 
Hey Justin, was wondering if you could give me an example scenario as to 
when this will occurs?
I asked because I tried selecting objects of other node types etc, I am 
getting errors (need to rewrite my logic here) but only within the 
`run_dialog` and it does not seems to pass in this `else` statement..

-- 
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/2cd81c76-93f9-4837-81b8-be04c5d90bb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread Justin Israel
On Thu, 27 Oct 2016, 1:29 PM likage  wrote:

> I re-post my message...
>
> @Marcus
> Thanks for the information! Glad to know that I am on track, to be honest,
> I was not able to find much info online, perhaps my searching skill was not
> that great in this aspect :p
>
> @Justin
> Thanks for the code. I have decided to use your format for my code.
>
> Even so, I have a few questions.
> 1. I tried writing a doc string, again I would like to have some insights
> if possible? Instead of writing it after the `init` function, I wrote it
> after the class statement, accordingly to what I have read online
>

I do the same. I document it at the class as opposed to docstrings on the
__init__


> 2. Is there any chance that I will need to add in an `else` statement
> should the self.state not conform to either `self.STATE_ROOT_SELS` or
> `self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from
> happening in the run_dialog function, right?
>

Can you raise a ValueError if they don't pass a valid constant?


> class HierarchyDialog(QtGui.QDialog):
> """
> Keywords:
> state:
> Denotes the selection case - 'root node selection' or 'user
> based selection'
> STATE_ROOT_SELS :
> States the case if the selection is Root Node
> STATE_USER_SELS :
>
> States the case if the selection is User-based
> """
>
>
>
>
> # Documenting states
>
> STATE_ROOT_SELS = "root_sels"
> STATE_USER_SELS = "user_sels"
>
>
>
>
> def __init__(self, state, parent=None):
> QtGui.QDialog.__init__(self, parent)
> ...
>
> self.state = state
>
>
> if self.state == self.STATE_ROOT_SELS:
> # Run function_A()
> elif self.state == self.STATE_USER_SELS:
> # Run function_B()
>
>
> # Do I need to include in a bogus state if any of the above 2
> conditions are not met
> else:
> cmds.warning("Please have a valid selection")
>
> --
> 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/f4a75603-ff76-4ff1-8161-0cfb5a088ebb%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/CAPGFgA32vSCPdgqj_3L%2B4hjGadW13HixEyMgnOT0G21iQjVk2w%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-26 Thread Dylan Smith
I've used Maya a fair bit, but I've only just started working with the API
and the Node side of things. Before this I've mainly used it for modelling
and UV'ing. Though I've also used Houdini a bunch so I am familiar with
Node based workflows. With your example of the 'inputGeometry' attribute,
from what I've read from the documentation (the specific page I'm referring
to is linked below) it seems like instead of using Logical Indexes 12, 13,
and 26 to access those three plugs, I could simply use Physical Indexes of
0, 1, and 2 instead. From what you're saying I'm guessing this is
incorrect, but I'm not sure why. Would you be able to expand on the
iterator explanation please? I don't quite understand it.

MPlug Reference Page;
http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__cpp_ref_class_m_plug_html

On Thu, Oct 27, 2016 at 6:31 AM, Cedric Bazillou 
wrote:

> Its a really robust and flexible mechanism which makes perfect sense in a
> nodal application...
> Array attribute ( vertical one like ouput[0], output[n] ) can potentially
> be sparse : it means no contiguous so inputGeometry[12], inputGeometry[13],
> inputGeometry[26] are perfectly valid
> let say you have an iterator in your deformer what you are interested in
> is process element and not attached to physical index you need to extract
> to access these data.
>
> How much experience do you have with maya ?
>
>
> Le mercredi 26 octobre 2016 04:42:44 UTC-4, Dylan Smith a écrit :
>>
>> Hey Everyone,
>> I was hoping someone could clear up something for me. When would we want
>> to use Logical indexes instead of Physical ones.
>> I've been reading through some documentation and the MPlug Class
>> Reference explains what they are, but not when we should use one or the
>> other.
>> From my understanding of the Maya API, I can't think of a reason to ever
>> use Logical indexes . To me it just seems like an unnecessary source of
>> potential confusion and bugs.
>> If I'm using physical indexes then I know that the second plug will
>> always be index 1. But with logical indexes it could be anything. The
>> physical option seems like the more appealing,
>> but if both options are in there then I assume there's a good reason for
>> it. What am I missing here? I've tried searching the documentation for an
>> answer but am yet to find anything.
>>
>> Thanks in advance for any help :)
>> Dylan
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/python_inside_maya/HPX99HYdGts/unsubscribe.
> To unsubscribe from this group and all its topics, 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/27b3a353-3f66-4195-8975-
> 0554c8c95d3a%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/CAFxZShr2oJVjQfENfkx88K3EkPmZJR07ew8c8R24HP0hg%3D-%2B%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread likage
I re-post my message...

@Marcus
Thanks for the information! Glad to know that I am on track, to be honest, 
I was not able to find much info online, perhaps my searching skill was not 
that great in this aspect :p

@Justin
Thanks for the code. I have decided to use your format for my code.

Even so, I have a few questions.
1. I tried writing a doc string, again I would like to have some insights 
if possible? Instead of writing it after the `init` function, I wrote it 
after the class statement, accordingly to what I have read online

2. Is there any chance that I will need to add in an `else` statement 
should the self.state not conform to either `self.STATE_ROOT_SELS` or 
`self.STATE_USER_SELS`? Otherwise, I suppose I can stopped such from 
happening in the run_dialog function, right?

class HierarchyDialog(QtGui.QDialog):
"""
Keywords:
state:
Denotes the selection case - 'root node selection' or 'user 
based selection'
STATE_ROOT_SELS :
States the case if the selection is Root Node
STATE_USER_SELS :
States the case if the selection is User-based
"""



# Documenting states
STATE_ROOT_SELS = "root_sels"
STATE_USER_SELS = "user_sels"




def __init__(self, state, parent=None):
QtGui.QDialog.__init__(self, parent)
...

self.state = state


if self.state == self.STATE_ROOT_SELS:
# Run function_A()
elif self.state == self.STATE_USER_SELS:
# Run function_B()

# Do I need to include in a bogus state if any of the above 2 
conditions are not met
else:
cmds.warning("Please have a valid selection")

-- 
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/f4a75603-ff76-4ff1-8161-0cfb5a088ebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread likage
Slight typo in the doc string, but STACK_SELECTION should be STATE_ROOT_SELS 
and USER_SELECTION should be STATE_USER_SELS

On Wednesday, October 26, 2016 at 4:36:05 PM UTC-7, likage wrote:
>
> @Marcus
> Glad to know that I am somewhat on the right track! To be honest, I could 
> not find much info online, either that or I must have been typing it 
> wrongly, unable to get a decent result
>
> @Justin
> Thanks for the code, decided to implement the way that you have mentioned.
>
> Another quick question if you guys don't mind...
> If I am going to write a doc string for this class (while using the method 
> as mentioned by Justin).. Would the following makes any sense?
>
> I suppose then there will be no need for me to write a doc string under 
> the `__init__` for the `state` parameter?
>
> class HierarchyDialog(QtGui.QDialog):
> """
> Keywords:
> state:
> Denotes the selection case - 'stack_sel' or 'user_sel'
> STACK_SELECTION :
> States the case if the selection is Stack
> USER_SELECTION :
> States the case if the selection is User-based
> """
> 
> # Documenting states
> STATE_ROOT_SELS = "root_sels"
> STATE_USER_SELS = "user_sels"
>
>
> def __init__(self, state, parent=None):
> QtGui.QDialog.__init__(self, 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/5201aaa7-fe5e-4fc0-889d-8566df0fef23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread likage
@Marcus
Glad to know that I am somewhat on the right track! To be honest, I could 
not find much info online, either that or I must have been typing it 
wrongly, unable to get a decent result

@Justin
Thanks for the code, decided to implement the way that you have mentioned.

Another quick question if you guys don't mind...
If I am going to write a doc string for this class (while using the method 
as mentioned by Justin).. Would the following makes any sense?

I suppose then there will be no need for me to write a doc string under the 
`__init__` for the `state` parameter?

class HierarchyDialog(QtGui.QDialog):
"""
Keywords:
state:
Denotes the selection case - 'stack_sel' or 'user_sel'
STACK_SELECTION :
States the case if the selection is Stack
USER_SELECTION :
States the case if the selection is User-based
"""

# Documenting states
STATE_ROOT_SELS = "root_sels"
STATE_USER_SELS = "user_sels"


def __init__(self, state, parent=None):
QtGui.QDialog.__init__(self, 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/75bfabd0-4084-42ff-9b63-5e5e01d653c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread Cedric Bazillou
Its a really robust and flexible mechanism which makes perfect sense in a 
nodal application...
Array attribute ( vertical one like ouput[0], output[n] ) can potentially 
be sparse : it means no contiguous so inputGeometry[12], inputGeometry[13], 
inputGeometry[26] are perfectly valid
let say you have an iterator in your deformer what you are interested in is 
process element and not attached to physical index you need to extract to 
access these data.

How much experience do you have with maya ?


Le mercredi 26 octobre 2016 04:42:44 UTC-4, Dylan Smith a écrit :
>
> Hey Everyone,
> I was hoping someone could clear up something for me. When would we want 
> to use Logical indexes instead of Physical ones.
> I've been reading through some documentation and the MPlug Class Reference 
> explains what they are, but not when we should use one or the other.
> From my understanding of the Maya API, I can't think of a reason to ever 
> use Logical indexes . To me it just seems like an unnecessary source of 
> potential confusion and bugs. 
> If I'm using physical indexes then I know that the second plug will always 
> be index 1. But with logical indexes it could be anything. The physical 
> option seems like the more appealing,
> but if both options are in there then I assume there's a good reason for 
> it. What am I missing here? I've tried searching the documentation for an 
> answer but am yet to find anything.
>
> Thanks in advance for any help :)
> Dylan
>

-- 
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/27b3a353-3f66-4195-8975-0554c8c95d3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread likage
I would like some opinions on the way I am using instance variables in my 
class as I am not so sure if I am doing it right.. To be honest, this is my 
first time using parameters in my class __init__..

class HierarchyDialog(QtGui.QDialog):
def __init__(self, state, parent=None):
QtGui.QDialog.__init__(self, parent)
self.setWindowTitle('Hierarchy Dialog')
self.setModal(False)

self.state = state

if self.state == "root_sels":
# Run function_A()
elif self.state == "user_sels":
# Run function_B()
else:
cmds.warning("Please check your selections. Either select some 
nodes or a root node")

...
...


def run_dialog():
state = ""
selection = cmds.ls(selection=True)
if not selection:
cmds.warning("Please select a Stack or some nodes")
return

if len(selection) == 1 and cmds.nodeType(selection) == 'nurbsSurface':
state = "root_sels"
elif len(selection) >= 1:
for items in selection:
if not cmds.nodeType(selection) == 'nurbsSurface' in items:
state = "user_sels"

dialog = HierarchyDialog(state)
dialog.show()
return dialog

In my  `run_dialog`, I am checking for selections in the scene.
There are only 2 types of selections - Selecting a nurbs surface node - 
suppose that is the top node of the hierarchy, or any of its children 
(suppose they are all meshs) within that nurbs suface node

Is checking against a string as defined in my `__init__` function the right 
way to do so?

-- 
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/afdd4e64-f331-467a-b46d-c5f46b0a9a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: pymel.internal.startup : ERROR : maya.standalone was successfully initialized, but pymel failed to import maya.cmds (or it was not populated)

2016-10-26 Thread AJ
Found this which solved it:
http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/standalone.html

thanks

On Wednesday, October 26, 2016 at 9:23:44 AM UTC-4, Marcus Ottosson wrote:
>
> To fully understand the problem, would it be possible to post a 
> reproducible?
>
> For example.
>
> $ cd c:\program files\autodesk\maya2016\bin
> $ mayapy>>> from maya import standalone>>> standalone.initialize()>>> from 
> pymel import core
> ...
>
> ​
>
> On 26 October 2016 at 13:49, AJ  
> wrote:
>
>> Hello everyone,
>>
>> I'm having the same issue and I was wondering if anyone found the 
>> solution for the import error?
>>
>> -- 
>> 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/81541c08-6d56-4753-b9d1-6ed09d500372%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *Marcus Ottosson*
> konstr...@gmail.com 
>

-- 
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/3030f96f-7da1-450e-a9ae-760a8a4ec939%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: pymel.internal.startup : ERROR : maya.standalone was successfully initialized, but pymel failed to import maya.cmds (or it was not populated)

2016-10-26 Thread Marcus Ottosson
To fully understand the problem, would it be possible to post a
reproducible?

For example.

$ cd c:\program files\autodesk\maya2016\bin
$ mayapy>>> from maya import standalone>>> standalone.initialize()>>>
from pymel import core
...

​

On 26 October 2016 at 13:49, AJ  wrote:

> Hello everyone,
>
> I'm having the same issue and I was wondering if anyone found the solution
> for the import error?
>
> --
> 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/81541c08-6d56-4753-b9d1-
> 6ed09d500372%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
konstrukt...@gmail.com

-- 
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/CAFRtmOB1nWp_wnBUMKf0OrTRPCaA6vQxEfrcbvLm_eeeQ7C1Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Re: pymel.internal.startup : ERROR : maya.standalone was successfully initialized, but pymel failed to import maya.cmds (or it was not populated)

2016-10-26 Thread AJ
Hello everyone,

I'm having the same issue and I was wondering if anyone found the solution 
for the import error?

-- 
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/81541c08-6d56-4753-b9d1-6ed09d500372%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-10-26 Thread Dylan Smith
Hey Everyone,
I was hoping someone could clear up something for me. When would we want to 
use Logical indexes instead of Physical ones.
I've been reading through some documentation and the MPlug Class Reference 
explains what they are, but not when we should use one or the other.
>From my understanding of the Maya API, I can't think of a reason to ever 
use Logical indexes . To me it just seems like an unnecessary source of 
potential confusion and bugs. 
If I'm using physical indexes then I know that the second plug will always 
be index 1. But with logical indexes it could be anything. The physical 
option seems like the more appealing,
but if both options are in there then I assume there's a good reason for 
it. What am I missing here? I've tried searching the documentation for an 
answer but am yet to find anything.

Thanks in advance for any help :)
Dylan

-- 
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/58d36eb8-2c08-4714-999e-c46ccf9d187d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.