Re: [Maya-Python] Re: Maya .ma used to launch a virus!

2020-09-24 Thread Geordie Martinez


the security tool is out of date and didn’t work.
I just ran this and it culled the nodes: 

import maya.cmds as cmds
unknownNodes=cmds.ls(type = "unknown")
unknownNodes+=cmds.ls(type = "unknownDag")
unknownNodes+=cmds.ls(type = "script")for item in unknownNodes:
if cmds.objExists(item):
print item
cmds.lockNode(item, lock=False)
cmds.delete(item)

On Thursday, September 24, 2020 at 5:57:01 AM UTC-7 vince touache wrote:

> as a temporary solution, I guess you can still uncheck the "execute script 
> jobs" when you open an untrustworthy file
>
> Le mercredi 23 septembre 2020 à 19:20:12 UTC-4, justin...@gmail.com a 
> écrit :
>
>> On Thu, Sep 24, 2020 at 10:58 AM Geordie Martinez  
>> wrote:
>>
>>> Whew! But also, holy crap. Maya files could easily turn into attack 
>>> vectors.
>>> This bit of code was repeated in the file about 940+ times.   
>>>
>>
>> Probably why this exists now:
>>
>> https://knowledge.autodesk.com/support/maya/troubleshooting/caas/simplecontent/content/maya-security-tool-faq.html
>>  
>>
>>>
>>>
>>> On Wednesday, September 23, 2020 at 3:45:21 PM UTC-7 justin...@gmail.com 
>>> wrote:
>>>
>>>> On Thu, Sep 24, 2020 at 10:38 AM Geordie Martinez  
>>>> wrote:
>>>>
>>>>> Looks like there is something on TechArtists. 
>>>>>
>>>>>
>>>>> http://discourse.techart.online/t/another-maya-malware-in-the-wild/12970
>>>>
>>>>
>>>> You beat me to posting that link. Seems like the actual code itself is 
>>>> not malicious, as it was intended by some other company to try and detect 
>>>> actual virus behaviour. But the whole idea of script jobs running at file 
>>>> import is super dangerous. You would really need to trust the source of 
>>>> your scene files or rely on the file security scanning to detect threads.
>>>>  
>>>>
>>>>>
>>>>>
>>>>> On Wednesday, September 23, 2020 at 3:34:30 PM UTC-7 Geordie Martinez 
>>>>> wrote:
>>>>>
>>>>>> Chad Vernon, why do you teach people to do these things? :)
>>>>>>
>>>>>>
>>>>>> On Wednesday, September 23, 2020 at 3:32:39 PM UTC-7 Geordie Martinez 
>>>>>> wrote:
>>>>>>
>>>>>>> Hey all, 
>>>>>>>
>>>>>>> I have been haxored. 
>>>>>>>
>>>>>>> I recently opened a file from our studio in china and this malicious 
>>>>>>> code (screencap only attached) was in there. it modified my 
>>>>>>> userSetup.py so 
>>>>>>> when I launched the next maya session it ran all this code.  I have no 
>>>>>>> idea 
>>>>>>> what this is. 
>>>>>>>
>>>>>>> Has anyone seen this crap before? 
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>> 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_m...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/python_inside_maya/774e865f-88d1-4b16-8690-0c7bd8ce380en%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/774e865f-88d1-4b16-8690-0c7bd8ce380en%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> 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_m...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/python_inside_maya/f2542116-c986-4465-9fcf-831a67d1f3d3n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/python_inside_maya/f2542116-c986-4465-9fcf-831a67d1f3d3n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
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/8e25c43e-ada9-4331-8097-abd969b047c8n%40googlegroups.com.


Re: [Maya-Python] Re: Maya .ma used to launch a virus!

2020-09-23 Thread Geordie Martinez
Whew! But also, holy crap. Maya files could easily turn into attack vectors.
This bit of code was repeated in the file about 940+ times.   


On Wednesday, September 23, 2020 at 3:45:21 PM UTC-7 justin...@gmail.com 
wrote:

> On Thu, Sep 24, 2020 at 10:38 AM Geordie Martinez  
> wrote:
>
>> Looks like there is something on TechArtists. 
>>
>> http://discourse.techart.online/t/another-maya-malware-in-the-wild/12970
>
>
> You beat me to posting that link. Seems like the actual code itself is not 
> malicious, as it was intended by some other company to try and detect 
> actual virus behaviour. But the whole idea of script jobs running at file 
> import is super dangerous. You would really need to trust the source of 
> your scene files or rely on the file security scanning to detect threads.
>  
>
>>
>>
>> On Wednesday, September 23, 2020 at 3:34:30 PM UTC-7 Geordie Martinez 
>> wrote:
>>
>>> Chad Vernon, why do you teach people to do these things? :)
>>>
>>>
>>> On Wednesday, September 23, 2020 at 3:32:39 PM UTC-7 Geordie Martinez 
>>> wrote:
>>>
>>>> Hey all, 
>>>>
>>>> I have been haxored. 
>>>>
>>>> I recently opened a file from our studio in china and this malicious 
>>>> code (screencap only attached) was in there. it modified my userSetup.py 
>>>> so 
>>>> when I launched the next maya session it ran all this code.  I have no 
>>>> idea 
>>>> what this is. 
>>>>
>>>> Has anyone seen this crap before? 
>>>>
>>>>
>>>> -- 
>> 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_m...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/774e865f-88d1-4b16-8690-0c7bd8ce380en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/774e865f-88d1-4b16-8690-0c7bd8ce380en%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/f2542116-c986-4465-9fcf-831a67d1f3d3n%40googlegroups.com.


[Maya-Python] Re: Maya .ma used to launch a virus!

2020-09-23 Thread Geordie Martinez
Looks like there is something on TechArtists. 

http://discourse.techart.online/t/another-maya-malware-in-the-wild/12970

On Wednesday, September 23, 2020 at 3:34:30 PM UTC-7 Geordie Martinez wrote:

> Chad Vernon, why do you teach people to do these things? :)
>
>
> On Wednesday, September 23, 2020 at 3:32:39 PM UTC-7 Geordie Martinez 
> wrote:
>
>> Hey all, 
>>
>> I have been haxored. 
>>
>> I recently opened a file from our studio in china and this malicious code 
>> (screencap only attached) was in there. it modified my userSetup.py so when 
>> I launched the next maya session it ran all this code.  I have no idea what 
>> this is. 
>>
>> Has anyone seen this crap before? 
>>
>>
>>

-- 
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/774e865f-88d1-4b16-8690-0c7bd8ce380en%40googlegroups.com.


[Maya-Python] Re: Maya .ma used to launch a virus!

2020-09-23 Thread Geordie Martinez
Chad Vernon, why do you teach people to do these things? :)


On Wednesday, September 23, 2020 at 3:32:39 PM UTC-7 Geordie Martinez wrote:

> Hey all, 
>
> I have been haxored. 
>
> I recently opened a file from our studio in china and this malicious code 
> (screencap only attached) was in there. it modified my userSetup.py so when 
> I launched the next maya session it ran all this code.  I have no idea what 
> this is. 
>
> Has anyone seen this crap before? 
>
>
>

-- 
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/527b7647-6f06-4d1d-8650-97616c3dcbb9n%40googlegroups.com.


[Maya-Python] Disabling color management on linux for maya2020 so I can automate without errors?

2020-08-28 Thread Geordie Martinez
Hello all, 

Does anybody have a good trick to disable color management in linux 
maya2020? 
the cloud machine we are running on doesn't have a graphics card so Maya 
viewport 2.0 throws an error. In older versions of maya you could set 
viewport to legacy and save preferences and it would be fixed. That option 
no longer exists in Maya 2020

This prevents automatically loading/unloading files in any loop because 
each new file imported/opened triggers the error. 

RE Batch Mode: 
I am running in batch mode but a certain plugin we use currently requires 
the UI to be open. we are waiting for an update on that but until then I 
have a lot of things to batch process and I'm in a bind until I can fix one 
or the other. 

Any help would be appreciated. 

 


-- 
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/846cce3b-5025-4fc6-a233-90827a621f86n%40googlegroups.com.


[Maya-Python] Re: IK Advanced Twist Controls

2016-11-30 Thread Geordie Martinez


ikh = pm.PyNode('ikHandle1')# list all available attrs to change
ikh.listAttr()# here's the one you need!
ikh.dTwistControlEnable.set(1)

On Wednesday, November 30, 2016 at 9:08:58 PM UTC-8, Adam Dalley wrote:

Hi all, pretty new to this stuff so bear with me :). I'm trying to figure 
> out how to get access to the 'Advanced Twist Controls' of an IK handle 
> using pymel.  I'm not seeing anything in the documentation but I'm probably 
> just looking in the wrong place. Any advice is much appreciated, cheers!
>
>
> 
>
> ​

-- 
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/958c3f4c-4fde-480e-9281-d20c8f7b35dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] 'counter' versioning for object renaming not working

2016-09-19 Thread Geordie Martinez
ah yes. 
once I returned to having an internet connection from being trapped inside 
a concrete fortress,
the entire conversation revealed itself and my question seems now a bit 
late to the party. please disregard.

-- 
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/c214cfda-2dd6-4731-98ad-0a7a13d282d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] 'counter' versioning for object renaming not working

2016-09-19 Thread Geordie Martinez
why don’t you just add a hash to the name which auto-numerates nodes
without name collision?

import maya.cmds as mc
blah = mc.polyCube(n="someBaseName#")   # the hash inside the string
is legal and will resolve to the next unique int

​

On Mon, Sep 19, 2016 at 3:45 PM, likage  wrote:

> ah... I am still trying to get my head around 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/1088c21f-6557-4ea2-9904-
> dda0477ab32e%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/CABPXW4g4ZVifT7iZXfF7dXb2440VP%3D49A4-Mpm1QibDVyvGA%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Optimise this: Hierarchy from String

2016-09-19 Thread Geordie Martinez
Okay. I know this has probably already been figured out, but I can’t help
myself with puzzles. Marcus I think you were on to the right idea but just
needed to use an OrderedDict with enumerate. here is my stab at it:

import maya.cmds as mcfrom collections import OrderedDictdef
hierarchy_from_string(hierarchy):
stack = OrderedDict()
for line in hierarchy.split("\n"):
if not line:
continue
stack[line.strip()]= len(line) -len(line.strip())
node_stack = stack.keys()
for num,(k,v) in enumerate(stack.iteritems()):
tfm = mc.group(n=k,em=True)
if num:
par_stack = node_stack[:num]
par_stack.reverse()
for pp in par_stack:
if stack[pp] < v:
mc.parent(tfm,pp)
break

return stack

hStr = """\
rig
implementation
geometry
skeleton
interface
controls
preview
"""

hierarchy_from_string(hStr)

this will only work in this current example if there aren’t any duplicate
names.
​

On Fri, Sep 16, 2016 at 11:18 PM, Justin Israel 
wrote:

>
>
> On Sat, 17 Sep 2016, 6:12 PM Alok Gandhi 
> wrote:
>
>> Also I would like to throw my 2 cents in as someone that develops not as
>>> one that writes scripts and tools on a per-show basis to get shots finaled,
>>> but as one that works on longer term projects to serve the ongoing
>>> pipeline. The advise from that conference might be more applicable to
>>> situations like that, where a shot-delivery time frame is not the case. It
>>> really just depends on whether your deliverable is a shot, or software.
>>
>>
>> I agree, I am also employed as a Pipeline Engineer and do not have the
>> pressing need to script  for a single shot but rather develop Pipeline
>> Tools and APIs that are consumed by various departments. I can totally
>> understand where you are coming from and it makes complete sense. I started
>> out as an artist (animator, rigger, and generalist) and then a TD and
>> gradually segway into Pipeline. During this journey, I clearly saw my
>> development focus shift from 'just make it work' to 'make it beautiful and
>> readable'.
>>
>
> 100% agree!
>
>
>> On Sat, Sep 17, 2016 at 1:47 PM, Justin Israel 
>> wrote:
>>
>>>
>>>
>>> On Sat, Sep 17, 2016 at 5:34 PM Alok Gandhi 
>>> wrote:
>>>
 @Justin: I agree with readability trumping performance, and almost at
 all times, I follow almost the same tenets. However, in our trade,
 performance is ever more critical and is becoming important every single
 day. The entertainment industry is one of the major stakeholders when
 it comes to demand for processing power. We need that water to look real,
 10 million polygon processing, we need that. And on top of that, we work on
 deadlines, sometimes unreal. When there is a pressing need to process huge
 amounts of data so that the shot can be approved, we have to do that. And
 it is at such moments, readability might take a back seat. This by no means
 is a justification for ignoring readability but rather the state of
 affairs. There is sometimes a tradeoff involved, sometimes not. You can get
 the best of both the worlds if you have enough time on your hand.

>>>
>>> I appreciate this need. Ultimately we have to deliver shots and meet
>>> deadlines. Ultimately we are in the business of making
>>> Movies/Television/Games/, and not necessarily software.
>>>
>>> But really, it doesn't change the point of the advise from that
>>> conference speaker. Even if performance ends up becoming the primary focus,
>>> then naturally the other points become secondary. And you have to weigh
>>> those decisions, right? Do we need this solution beyond this shot? This
>>> show? Who gets to maintain it? How easy it is to continue to be adapted to
>>> the next challenge.
>>>
>>> Also I would like to throw my 2 cents in as someone that develops not as
>>> one that writes scripts and tools on a per-show basis to get shots finaled,
>>> but as one that works on longer term projects to serve the ongoing
>>> pipeline. The advise from that conference might be more applicable to
>>> situations like that, where a shot-delivery time frame is not the case. It
>>> really just depends on whether your deliverable is a shot, or software.
>>>
>>>

 It is good that we have a growing and healthy open source community,
 with studios investing in making amazing open source projects
 - OpenVDB exr, Alembic, USD etc. to name a few. With neatly written API to
 handle low-level high-processing procedures, all abstracted for the benefit
 of writing clean yet power packed code.

 That's my two cents.

 On Sat, Sep 17, 2016 at 9:15 AM, Justin Israel 
 wrote:

>
>
> On Sat, 17 Sep 2016, 1:09 PM yury nedelin 

Re: [Maya-Python] mayapy playblast

2016-09-18 Thread Geordie Martinez
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 20  41 6c 69 61 73 20 44 61  
> |..Linux Alias Da|01e0  74 61 20 48 61 6e 64 6c  65 72 00 00 00 24 64 69  
> |ta Handler...$di|01f0  6e 66 00 00 00 1c 64 72  65 66 00 00 00 00 00 00  
> |nfdref..|0200  00 01 00 00 00 0c 61 6c  69 73 00 00 00 01 00 00  
> |..alis..|0210  00 be 73 74 62 6c 00 00  00 66 73 74 73 64 00 00  
> |..stbl...fstsd..|0220  00 00 00 00 00 01 00 00  00 56 70 6e 67 20 00 00  
> 

Re: [Maya-Python] Selects only the group nodes

2016-08-29 Thread Geordie Martinez
whoops. forgot markdown.

import maya.cmds as mc

sel = list(set([x for x in mc.listRelatives(mc.ls(assemblies=True),
ad=True, type='transform') if not
mc.listRelatives(x,type="shape")]))print sel

​

On Mon, Aug 29, 2016 at 10:06 PM, Geordie Martinez <
geordiemarti...@gmail.com> wrote:

> here's a way to do it without getting duplicates.
>
> ```python
> import maya.cmds as mc
>
> sel = list(set([x for x in mc.listRelatives(mc.ls(assemblies=True),
> ad=True, type='transform') if not mc.listRelatives(x,type="shape")]))
> print sel
> ```
>
> try this see if it works.
>
> On Mon, Aug 29, 2016 at 6:25 PM, Justin Israel <justinisr...@gmail.com>
> wrote:
>
>>
>>
>> On Tue, Aug 30, 2016 at 12:56 PM likage <dissidia@gmail.com> wrote:
>>
>>> I am trying to grab only the group nodes within the hierarchy as shown
>>> in the screenshot..
>>>
>>
>> Is a group node considered any transform that has a child? That is, would
>> you expect to get pSphere1 or locator1 back in your results if they had
>> child transforms under them?
>>
>>
>>>
>>> While I use this code:
>>>
>>> sel = cmds.listRelatives(cmds.ls(transforms=True), ap=True, ni=True)
>>> print sel
>>>
>>> It is giving me the following results:
>>> [u'Group_1', u'Group_2', u'Group_2', u'Group_2', u'Group_2', u'Group_2',
>>> u'Group_3', u'Group_4', u'Group_5']
>>>
>>> Though it gives me duplicated result of certain groups, is this the best
>>> way to approach this?
>>> I am using Group_ as a generic naming and hence my reluctance to use
>>> Group_*, in case you are wondering...
>>>
>>>
>>>
>>> <https://lh3.googleusercontent.com/-CzmSA56LEYo/V8TYu5y1iZI/AFY/RZFoiyDPCmAjM08aTpaTns3FwR9yQtz-ACLcB/s1600/grp_hie.jpg>
>>>
>>> --
>>> 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/ms
>>> gid/python_inside_maya/a70ebb57-f68c-493f-b84a-ba5a52334697%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/a70ebb57-f68c-493f-b84a-ba5a52334697%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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/ms
>> gid/python_inside_maya/CAPGFgA16FKRem4SLDXvruX-ZOTrY0fQ_
>> Oqt2P%2BZTFozDmUPMAA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA16FKRem4SLDXvruX-ZOTrY0fQ_Oqt2P%2BZTFozDmUPMAA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> 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/CABPXW4jDjV-c0T1n%3Dvc2KOJxZxVew8K6KUTETRCWwHfSUTrH%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selects only the group nodes

2016-08-29 Thread Geordie Martinez
here's a way to do it without getting duplicates.

```python
import maya.cmds as mc

sel = list(set([x for x in mc.listRelatives(mc.ls(assemblies=True),
ad=True, type='transform') if not mc.listRelatives(x,type="shape")]))
print sel
```

try this see if it works.

On Mon, Aug 29, 2016 at 6:25 PM, Justin Israel 
wrote:

>
>
> On Tue, Aug 30, 2016 at 12:56 PM likage  wrote:
>
>> I am trying to grab only the group nodes within the hierarchy as shown in
>> the screenshot..
>>
>
> Is a group node considered any transform that has a child? That is, would
> you expect to get pSphere1 or locator1 back in your results if they had
> child transforms under them?
>
>
>>
>> While I use this code:
>>
>> sel = cmds.listRelatives(cmds.ls(transforms=True), ap=True, ni=True)
>> print sel
>>
>> It is giving me the following results:
>> [u'Group_1', u'Group_2', u'Group_2', u'Group_2', u'Group_2', u'Group_2',
>> u'Group_3', u'Group_4', u'Group_5']
>>
>> Though it gives me duplicated result of certain groups, is this the best
>> way to approach this?
>> I am using Group_ as a generic naming and hence my reluctance to use
>> Group_*, in case you are wondering...
>>
>>
>>
>> 
>>
>> --
>> 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/a70ebb57-f68c-493f-b84a-
>> ba5a52334697%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/CAPGFgA16FKRem4SLDXvruX-
> ZOTrY0fQ_Oqt2P%2BZTFozDmUPMAA%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/CABPXW4iwhSiAJi4_1re4CerPkwOHXr%2BiEr2oAKNdJ_%2BKvC3FKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] how change "display color channel" parametr?

2016-07-23 Thread Geordie Martinez
Be sure and import into a namespace instead of *.
import pymel.core as pm
And you can get a list of selected in pymel with
pm.selected()
As for the slow update of the AE, not sure.

On Saturday, July 23, 2016, Morten Bøhne  wrote:

> this seems to work for me (only tested it in 2015:
>
> from pymel.core import *
> mesh = ls(sl=True)[0]
> # change displayColorChannel to none
> mesh.displayColorChannel.set('None')
>
>
> your options are:
> 'None'
> 'Ambient'
> 'Ambient+Diffuse'
> 'Specular'
> 'Emission'
>
> The attribute Editor doesn't seem to update the value right away, not sure
> why :\
>
> On Wednesday, July 20, 2016 at 10:19:37 PM UTC+2, morem...@gmail.com
>  wrote:
>>
>> hi!
>> how change "display color channel" parametr?
>> http://s6.uplod.ir/i/00802/v6pded3ug2um.jpg
>>
>> --
> 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/4d2e87bb-47d3-4dc0-8c73-1b4e05557208%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/CABPXW4jCnujatcP6dd%3DNVgykn95Un0Fiuk-BrwQoUCOSOXc8Ug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Getting the year of the Maya version used

2016-07-12 Thread Geordie Martinez
Here is one way to use regex. it’s not super elegant, but it gets the job
done.
hope this helps.

import re# get combinations of 4 numbers in a row like 2014, 2015, 2016, etc.
pattern = re.compile(r'''.*(\d{4})''')
res = pattern.search(mc.about(v=True))if res.groups():
print("version {0}".format(res.groups()[0]))
else:
print("this doesn't give me a version")

​

On Mon, Jul 11, 2016 at 2:43 PM, likage  wrote:

> I was wondering what is the best way that I can grab the year of the Maya
> version and just the year that I am using - eg. 2012, 2014 etc?
>
> I know that there is a command - cmds.about(v=True) which returns me
> 'Extension for Autodesk Maya 2014 Service Pack 2' but any ideas in which I
> can improve on it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop 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/7c3cafbc-6b19-47b0-b864-9d541bc3e7c6%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/CABPXW4gS5yP4OzZp%3D8EW5zdqLTg5ZX44%3D9gHw3_j%3DMgVM-tpvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Right way of pep8 long maya commands

2016-07-11 Thread Geordie Martinez
RE: the code
well honestly I'd make all that pyside/PyQt instead of maya.cmds UI. it's
just much easier to maintain and edit.

RE: Pep 8.
There was a pretty decent short PyCon video on PEP8 being a **guide** and
not a rule book by Raymond Hettinger.
https://youtu.be/ARN52Mi1f3Q

Personally, I'm not a stickler for the
```underscore_variable_naming_convention```. I prefer ```camelCase```
because it's what I started out using. The hardcore pythonistas
(#chadvernon) would frown on my statement, but It's good enough for PyQt
and Pyside so it's good enough for me.






On Mon, Jul 11, 2016 at 4:00 PM, yann19  wrote:

> Oh and adding on one more questions - is it more common to write the full
> name of the flags or the short names of the flags?
> Eg. cmds.camera(q=True) or cmds.camera(query=True)
>
> --
> 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/98e1fd5c-1591-4736-b4f1-ac0725cdb4c8%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/CABPXW4i55NorWFKP-6GTCyTJ_huZ_FT%3DoS3PvWBsmOo5-HiCXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] PyMEL and its legal/official status

2016-06-07 Thread Geordie Martinez
Hey Timm,
I love PyMEL too and have been using it since 0.7 (don’t mean to be a
“topper” :) ) but I’m not worried about it. Here is why.

Paul Molodowitch maintains PyMEL. here is what he said:

First of all, PyMEL will continue to be maintained as long as Luma exists
and is using Maya, and I don’t see that changing in the near or distant
future. PyMEL has a strong following because it fills the many gaps in
Maya’s native python support, and the maya-python landscape in 2016 looks
almost exactly as it did nearly a decade ago when PyMEL first came into
existence, so the niche that it fills still exists. Studios continue to
have 3 choices: use PyMEL, suffer with maya.cmds, or rewrite their own
versions of PyMEL’s utilities.

It takes very little effort on Autodesk’s part to package PyMEL with Maya —
far, far less than it would to actually make the bare minimum of changes to
make PyMEL irrelevant. The API 2.0 overhaul is a good example of the
glacial pace of change on this front (released in 2013, then stagnated, and
still not complete in 2016). Their strategy for the past few years has been
to buy plugins in lieu of in-depth custom development, and the inclusion of
PyMEL was, and continues to be, in line with that strategy.

As for your developer’s comments, Autodesk has never taken a very active
part in PyMEL, so it’s not a completely unfair characterization, but their
general malaise has always existed and hasn’t gotten any worse. They
communicate with us when they need a new drop, and just the other day they
made a commit and pull request on github. Like you, I don’t really see them
discontinuing something that is used by many of their customers and which
takes almost no effort on their part to include.

I will be honest with you in saying that there are not any revolutionary
changes planned for PyMEL. There’s simply not much changing on Autodesk’s
end and therefore not much reason for us to innovate (we wrap their APIs,
after all). Speed would be one area of improvement, but to get a big gain
on the maya.cmds side we would need new hooks from Autodesk, and it’s not a
feature that sells licenses. We’ve considered porting the API calls to 2.0,
but it’s still unclear how much we would gain from such an overhaul or when
there will be complete coverage of all the c++ classes.

So, basically, PyMEL is not going away (even in the event that Autodesk
stopped including it as a site-package), and it’s still as solid a choice
as it has always been for all the same reasons.

​

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


Re: [Maya-Python] check if selected object is a poly mesh

2016-05-06 Thread Geordie Martinez
Wow. I don’t think I’ve ever seen/used filterExpand in any code. that’s
actually quite a useful command.

I wonder how I've missed that all these years.

Thanks Justin! Always a fount of knowledge!
​

On Fri, May 6, 2016 at 9:37 PM, Geordie Martinez <geordiemarti...@gmail.com>
wrote:

> here are two more ways to add to the ways listed here.
>
> import pymel.core as pm
> # pm.selected returns a list of selected itemsfor x in pm.selected():
>
> # if you can get a shape node continue
> if x.getShape():
>
> # if the shapenode type is mesh then the test is good
> if x.getShape().nodeType() == 'mesh':
> print("Yep {0} is indeed a polygon mesh".format(x))
> # returning only a list of meshes selected. # same as above but uses a fancy 
> pants list comprehension
> justMeshes = [y for y in [ x for x in pm.selected() if x.getShape()] if 
> y.getShape().nodeType() == 'mesh']
>
> ​
>
> On Fri, May 6, 2016 at 2:38 PM, simonp91 <simon...@gmail.com> wrote:
>
>> You can use a nodeType query, but remember, a transform node can contain
>> more than one shape node. Also, you might want to query multiple selected
>> objects. Not at the machine for syntax testing, but it would look something
>> like this :
>>
>> import pymel.core as pm
>> for o in pm.ls(selection=True):
>> for shp in pm.listRelatives(o, children=True, sh=True):
>> if pm.nodeType(shp, q=True)=='mesh':
>> print '%s is a poly mesh' % shp
>>
>> ...can't remember off the top of my head if you need an extra flag in the
>> nodeType query to return its proper type, but if it doesn't return the
>> mesh/es, just check the command in the maya python docs (is the same in
>> maya cmds and pymel) and you'll see straight away.
>>
>> Simon
>>
>> Sent from my iPhone
>>
>> > On 6 May 2016, at 21:54, s...@weacceptyou.com wrote:
>> >
>> > Hi sorry, im guessing this is a simple one. But just wanted to know the
>> simplest way of doing this.
>> >
>> > i want to check that the object i have selected is a polygon mesh. I
>> assumed i had to use the 'objectType' command. but it seems you have to
>> provide the name of the shape node of the object first. If there is a pymel
>> way of doing it that is also fine,
>> >
>> > any help would be great,
>> > thanks,
>> > Sam
>> >
>> > --
>> > 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/3a332d6c-0659-4d67-98e1-9b2caabeb760%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/DD09D5E0-531D-4323-93CD-5AA9B9572DA0%40gmail.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/CABPXW4hvTXfEaQ6ZDEYjh-sM5BjC9-2NKkP3%3DkGabrgnWr3PdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] check if selected object is a poly mesh

2016-05-06 Thread Geordie Martinez
here are two more ways to add to the ways listed here.

import pymel.core as pm
# pm.selected returns a list of selected itemsfor x in pm.selected():

# if you can get a shape node continue
if x.getShape():

# if the shapenode type is mesh then the test is good
if x.getShape().nodeType() == 'mesh':
print("Yep {0} is indeed a polygon mesh".format(x))
# returning only a list of meshes selected. # same as above but uses a
fancy pants list comprehension
justMeshes = [y for y in [ x for x in pm.selected() if x.getShape()]
if y.getShape().nodeType() == 'mesh']

​

On Fri, May 6, 2016 at 2:38 PM, simonp91  wrote:

> You can use a nodeType query, but remember, a transform node can contain
> more than one shape node. Also, you might want to query multiple selected
> objects. Not at the machine for syntax testing, but it would look something
> like this :
>
> import pymel.core as pm
> for o in pm.ls(selection=True):
> for shp in pm.listRelatives(o, children=True, sh=True):
> if pm.nodeType(shp, q=True)=='mesh':
> print '%s is a poly mesh' % shp
>
> ...can't remember off the top of my head if you need an extra flag in the
> nodeType query to return its proper type, but if it doesn't return the
> mesh/es, just check the command in the maya python docs (is the same in
> maya cmds and pymel) and you'll see straight away.
>
> Simon
>
> Sent from my iPhone
>
> > On 6 May 2016, at 21:54, s...@weacceptyou.com wrote:
> >
> > Hi sorry, im guessing this is a simple one. But just wanted to know the
> simplest way of doing this.
> >
> > i want to check that the object i have selected is a polygon mesh. I
> assumed i had to use the 'objectType' command. but it seems you have to
> provide the name of the shape node of the object first. If there is a pymel
> way of doing it that is also fine,
> >
> > any help would be great,
> > thanks,
> > Sam
> >
> > --
> > 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/3a332d6c-0659-4d67-98e1-9b2caabeb760%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/DD09D5E0-531D-4323-93CD-5AA9B9572DA0%40gmail.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/CABPXW4hJKguY%3DoxOL-tPF__qMR8oragBXK2XS_7AhLkjMGifAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Python Modules in System Environment Variable ?

2016-03-28 Thread Geordie Martinez
You can add them to your userSetup.mel or userSetup.py files in your
scripts directory.
just add it like this:

userSetup.mel:

python("import
sys;sys.path.append('S:/python');sys.path.append('X:/some/path/python');");
​

As soon as Maya loads the path(s) will be available. this is the easiest
way. And you can have it load any modules there you want to load
automatically.
if you have a package you would like to load, then it's best to put it in
the site-packages directory in your maya install


On Mon, Mar 28, 2016 at 9:36 PM, Crest Christopher <
crestchristop...@gmail.com> wrote:

> Thanks for the info.  ;-)
>
> I just want to know what is the path used so I can append it to my system
> environment variable MAYA_APP_DIR so Python modules are loaded by default
> for Maya.
>
>
>
> Geordie Martinez <geordiemarti...@gmail.com>
> Tuesday, March 29, 2016 12:17 AM
> If I were you I'd just install Anaconda and let Anaconda deal with
> appending variables based on versions.
>
> https://www.continuum.io/downloads
>
>
> --
> 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/CzEXgn-GIaI/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/CABPXW4jT6N6L91Kb7DTkZiOijy6ASNDm0pOCUKWUXrXnCMqNPw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABPXW4jT6N6L91Kb7DTkZiOijy6ASNDm0pOCUKWUXrXnCMqNPw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
> Christopher. <crestchristop...@gmail.com>
> Monday, March 28, 2016 10:00 PM
> I have Python 2.6 (26) & Python 2.7 (27) installed, what is the path used
> for the modules to append to a system environment
> variable; C:\Python27\modules\modules ?
> --
> 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/CzEXgn-GIaI/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/9a38daef-9c8e-4d80-8db3-52411b381dd0%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/9a38daef-9c8e-4d80-8db3-52411b381dd0%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/56FA063B.4090507%40gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/56FA063B.4090507%40gmail.com?utm_medium=email_source=footer>
> .
>
> 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/CABPXW4ihFwiLnoJUJ%2BUK3Ga3u-WEJrgeaKRA%3DwySK9cw5RVdXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Python Modules in System Environment Variable ?

2016-03-28 Thread Geordie Martinez
If I were you I'd just install Anaconda and let Anaconda deal with
appending variables based on versions.

https://www.continuum.io/downloads

On Mon, Mar 28, 2016 at 7:00 PM, Christopher. 
wrote:

> I have Python 2.6 (26) & Python 2.7 (27) installed, what is the path used
> for the modules to append to a system environment
> variable; C:\Python27\modules\modules ?
>
> --
> 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/9a38daef-9c8e-4d80-8db3-52411b381dd0%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/CABPXW4jT6N6L91Kb7DTkZiOijy6ASNDm0pOCUKWUXrXnCMqNPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] cross product of two vectors

2016-03-21 Thread Geordie Martinez
you can make it a LOT easier of you just stay in pymel and skip maya.cmds.
here is an example of what you’re doing:

import pymel.core as pm
# make pynodes out of each locator or transform
loc1=pm.PyNode('locator1')
loc2=pm.PyNode('locator2')
loc3=pm.PyNode('locator3')
# get the World space position of each locator# each of these returns a Point
pt1=loc1.getTranslation(space='world')
pt2=loc2.getTranslation(space='world')
pt3=loc3.getTranslation(space='world')
# to get vectors subtract one point from another# returns a Vector
vec1=pt2 - pt1
vec2=pt3 - pt1
# .cross() is a method on any vector
cross = vec1.cross(vec2).normal() # add .normal() to normalize

​

On Mon, Mar 21, 2016 at 8:10 AM,  wrote:

> sorry i meant to write this the first time. this seems to work:
>
> 
> pt1=cmds.pointPosition('locator1')
> pt2=cmds.pointPosition('locator2')
> pt3=cmds.pointPosition('locator3')
>
> vec1=pm.dt.Vector(pt2[0]-pt1[0],pt2[1]-pt1[1],pt2[2]-pt1[2])
> vec2=pm.dt.Vector(pt3[0]-pt1[0],pt3[1]-pt1[1],pt3[2]-pt1[2])
>
> perpenVec=vec1^vec2
> ###
>
> --
> 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/df047714-b73d-4af9-badc-6c10179cc4ee%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/CABPXW4igxQVyBuiaLuSQ8BjSeFWmMZygBxGGnm2XbYFapykfPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] A new plugin for crowd simulation/crowd generation in Maya at a reasonable cost!

2016-03-05 Thread Geordie Martinez
I happen to agree completely with Nicolas. I've been doing crowd work for
around 7 years now.
There's a reason there are only a few companies making software for crowd
work that is production-proven.

It is NO easy task and Goleam deserves every penny they get for their hard
work.

But who am I to dissuade you? By all means, Risu, give it your best shot.
the hurdles will be many. Including convincing someone to use your software
instead of a proven package will be
very difficult. It's taken Goleam years to get where they are.

If you feel this passionate about it, you should try it!







On Sat, Mar 5, 2016 at 2:51 PM, Marcus Ottosson 
wrote:

> Why allow people to capitalize on those plugins?
>
> You clearly have no idea what you are talking about.
> ​
>
> On 5 March 2016 at 21:17, Nicolas Chaverou 
> wrote:
>
>> Hi there,
>>
>> Hope this will not be taken as a shameless plug, but i wanted to step in
>> this discussion. Before starting let me introduce myself: my name is
>> Nicolas, I'm one of Golaem founder and crowd lead dev there. We develop and
>> sell a crowd sim plugin for Maya (here's the link for people having never
>> heard about us: http://golaem.com and prices:
>> http://golaem.com/content/buy).
>>
>> First let me say that from my experience, nobody in the VFX software
>> industry (and I met a few) is capitalizing. Some are indeed healthy
>> companies but no one drives a Ferrari to go to work neither they live in
>> huge mansions. Us included. Vfx is a very competitive niche market and
>> crowd sim even more. Contrary to rendering engine companies which can sell
>> dozens of licenses to the same company, we (and plenty of others) usually
>> sell between 1 and a few seats.
>>
>> On the other side, we've been working for 6 years now on that product and
>> I'd say it has reached *industry standards* about three years ago.
>> Behind the software there are several *brilliant developers* passionated
>> about their job, not counting their hours and trying to make a living out
>> of their passion.
>>
>> Why so long? Well, developping an *industry standard* crowd sim software
>> requires you to deal with AI, behaviors, perception, animation, ground
>> detection, cloth sim, fur/hair sim, physics ragdoll sim, muscles,
>> blendshapes, character variation (geometry, writing shaders), having decent
>> performances (being able to sim thousands of characters real time), being
>> able to display dozen of thousands of characters on screen and being able
>> to render those dozen of thousands in a decent time on most industry
>> standard rendering engines (6 in our case). Not speaking about doing an
>> API, supporting productions and special feature requests (which is common
>> to all vfx software developpers).
>> Well a lot of different skills are involved...
>> I usually like to say that crowds are a pipeline in the pipeline :)
>>
>> So at the end, we have to do the maths if we'd like to be able to live
>> out of it.
>>
>> I truly believe our pricing is fair and is a good value:
>> - commercials / tv shows studios usually rent the software for a month or
>> more and charge it to the global project
>> - heavy film studios usually go permanent and charge it to the project as
>> well
>> - and people without commercial projects ? Well, they get a license for
>> free.
>>
>> This having been said I completely understand your point but there's a
>> good reason why there are so few crowd softwares out there.
>> It takes a lot of time, skills, lines of code (hundreds of thousands) to
>> achieve a competitive product.
>>
>> Hope it shone some lights.
>> Will be happy to answer any questions :)
>>
>> Best,
>>
>>
>> ---
>> [image: Nicolas Chaverou - Golaem Crowd Product Manager - Golaem SA]
>>
>> +33 (0)2 99 27 21 44
>> http://www.golaem.com
>>
>> On Sat, Mar 5, 2016 at 9:56 AM,  wrote:
>>
>>> Hi folks,
>>>
>>> Wouldn't it be great to have a robust and reliable open source or
>>> reasonably priced plugin to do crowd generation/crowd simulation for Maya
>>> or other 3D software?
>>>
>>> Currently the existing software for crowd are in the thousands, some
>>> over $3,000 too and even hundreds of dollars for a few months' rental.
>>>
>>> Why allow people to capitalize on those plugins?
>>>
>>> Currently there is no reasonably priced crowd generation/crowd
>>> simulation plugin for Maya which can produce industry standard results.
>>>
>>> By reasonably priced I am setting the bar as high as $1,000 for a
>>> PERMANENT license, and there is no plugin that can do industry standard
>>> crowd simulation/crowd generation work that sells for at least $1,000 for a
>>> PERMANENT license. People should not have to pay more than this amount for
>>> a PERMANENT license for such a plugin and should not deserve to rent the
>>> plugin either.
>>>
>>> We cannot sit back and let plugins like these hold on to a high priced
>>> status in the market. As we know, Maya and 

Re: [Maya-Python] rotate difference in Mel and python

2016-02-26 Thread Geordie Martinez
That's not a bug.
The first argument is supposed to be an object. The docs say this function
was modified to accept any iterable.

In pymel youre in object-oriented mode so just use the method on the object
to affect rotation.

node.rotate.set((0,45,0))

If you're going to use pymel, take advantage of OOP.

On Friday, February 26, 2016, Todd Widup  wrote:

> figured out what it is
>
> if I do
> pm.rotate(0,45,0,r=1,os=1)
> its actually rotating 45 on x, not y..its thinking that first 0 is an
> object, but it still applies it to the selected node, so that is a bug
>
> On Fri, Feb 26, 2016 at 7:33 AM, Todd Widup  > wrote:
>
>> hmmm strange...anyways..in a list here, it errors.  not sure whats going
>> on..oh well...was just trying to figure out if this was a bug or not
>>
>> On Fri, Feb 26, 2016 at 2:30 AM, Martin Y > > wrote:
>>
>>> In pm you need to put the coordinates in a list or tuple.
>>>
>>> pm.rotate((0,45,0), os=True, r=True)
>>> pm.rotate([0,45,0], os=True, r=True)
>>>
>>> works fine
>>>
>>> pm.rotate(0,45,0, os=True, r=True)
>>>
>>> doesn't.
>>>
>>> I tried the pymel examples where they aren't using lists or tuples and
>>> it doesn't work here even when I'm using the same pymel version.
>>> I guess the pymel examples in the manuals are outdated.
>>>
>>> Martin
>>>
>>>
>>> On Friday, February 26, 2016 at 7:45:54 AM UTC+9, todd@gmail.com
>>>  wrote:
>>> > but the point is...try teh commands...pymel is rotating a node
>>> differently than maya.cmds or mel
>>>
>>> --
>>> 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/7234f8b3-528d-495e-ad39-755d5a9224ee%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Todd Widup
>> Creature TD / Technical Artist
>> t...@toddwidup.com 
>> todd.wi...@gmail.com
>> 
>> www.toddwidup.com
>>
>
>
>
> --
> Todd Widup
> Creature TD / Technical Artist
> t...@toddwidup.com 
> todd.wi...@gmail.com
> 
> www.toddwidup.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/CABBPk37somKN6mCQtTK-N%2BnhbGYix8aeLHo5npi6yyDHfZHVeQ%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/CABPXW4jpc1%2Bw5eMJgQQuiJjaGjNQmJxE3e67YX_FKX-oZCTqQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] rotate difference in Mel and python

2016-02-26 Thread Geordie Martinez
try this:

import pymel.core as pm
pm.rotate((0,45,0),os=True,r=True)# or
pm.selected()[0].rotate.set((0,45,0))# or
pm.rotate(pm.selected()[0], 0,45,0,os=True,r=True)

These all work as expected.
​

On Thu, Feb 25, 2016 at 2:45 PM, Todd Widup <todd.wi...@gmail.com> wrote:

> but the point is...try teh commands...pymel is rotating a node differently
> than maya.cmds or mel
>
>
> On Thu, Feb 25, 2016 at 2:36 PM, Geordie Martinez <
> geordiemarti...@gmail.com> wrote:
>
>> pm.rotate can take 3 floats or a dt.Vector(float,float,float) or just a
>> tuple with three floats. pm.rotate((0,45,0),r=True, os=True)
>> it is flexible.
>> ​
>>
>> On Thu, Feb 25, 2016 at 1:57 PM, Todd Widup <todd.wi...@gmail.com> wrote:
>>
>>> hye Damon, I would normally...was just testing something and found this
>>> bug/strange behavior
>>>
>>> On Thu, Feb 25, 2016 at 1:55 PM, damon shelton <damondshel...@gmail.com>
>>> wrote:
>>>
>>>> Use xform 
>>>>
>>>>
>>>> On Thursday, February 25, 2016, Todd Widup <todd.wi...@gmail.com>
>>>> wrote:
>>>>
>>>>> the point being though...I can get it to work in either...but the same
>>>>> values actually rotate differently between mel/maya.cmds and pymel
>>>>>
>>>>> On Thu, Feb 25, 2016 at 1:41 PM, Todd Widup <todd.wi...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> it works without it as well..atleast here is it and errors on a list
>>>>>>
>>>>>> On Thu, Feb 25, 2016 at 1:27 PM, Kurian O.S <kuria...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> rotate take a list
>>>>>>>
>>>>>>>
>>>>>>> pm.rotate([0,45,0], r=1, os=1)
>>>>>>>
>>>>>>> On Thu, Feb 25, 2016 at 1:19 PM, Todd Widup <todd.wi...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> mel and maya.cmds
>>>>>>>>
>>>>>>>> rotate -r -os 0 45 0;
>>>>>>>>
>>>>>>>> works different than
>>>>>>>>
>>>>>>>> pymel
>>>>>>>>
>>>>>>>> pm.rotate(0,45,0,r=1,os=1)
>>>>>>>>
>>>>>>>> any ideas why and what is going on with it?
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Todd Widup
>>>>>>>> Creature TD / Technical Artist
>>>>>>>> t...@toddwidup.com
>>>>>>>> todd.wi...@gmail.com
>>>>>>>> www.toddwidup.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/CABBPk34Ewu9_i_cTd48jB2GGMm11XNYjhOYmJAm-5o0SPn6-sQ%40mail.gmail.com
>>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk34Ewu9_i_cTd48jB2GGMm11XNYjhOYmJAm-5o0SPn6-sQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> --:: Kurian ::--
>>>>>>>
>>>>>>> --
>>>>>>> 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/CANEMyhPSoshxn4_oC_mYr-hJ4G2aR4xBcqRruhCNdA4-4ZK_CQ%40mail.gmail.com
>>>>>>> &

Re: [Maya-Python] rotate difference in Mel and python

2016-02-25 Thread Geordie Martinez
pm.rotate can take 3 floats or a dt.Vector(float,float,float) or just a
tuple with three floats. pm.rotate((0,45,0),r=True, os=True)
it is flexible.
​

On Thu, Feb 25, 2016 at 1:57 PM, Todd Widup  wrote:

> hye Damon, I would normally...was just testing something and found this
> bug/strange behavior
>
> On Thu, Feb 25, 2016 at 1:55 PM, damon shelton 
> wrote:
>
>> Use xform 
>>
>>
>> On Thursday, February 25, 2016, Todd Widup  wrote:
>>
>>> the point being though...I can get it to work in either...but the same
>>> values actually rotate differently between mel/maya.cmds and pymel
>>>
>>> On Thu, Feb 25, 2016 at 1:41 PM, Todd Widup 
>>> wrote:
>>>
 it works without it as well..atleast here is it and errors on a list

 On Thu, Feb 25, 2016 at 1:27 PM, Kurian O.S  wrote:

> rotate take a list
>
>
> pm.rotate([0,45,0], r=1, os=1)
>
> On Thu, Feb 25, 2016 at 1:19 PM, Todd Widup 
> wrote:
>
>> mel and maya.cmds
>>
>> rotate -r -os 0 45 0;
>>
>> works different than
>>
>> pymel
>>
>> pm.rotate(0,45,0,r=1,os=1)
>>
>> any ideas why and what is going on with it?
>>
>>
>> --
>> Todd Widup
>> Creature TD / Technical Artist
>> t...@toddwidup.com
>> todd.wi...@gmail.com
>> www.toddwidup.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/CABBPk34Ewu9_i_cTd48jB2GGMm11XNYjhOYmJAm-5o0SPn6-sQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> --:: Kurian ::--
>
> --
> 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/CANEMyhPSoshxn4_oC_mYr-hJ4G2aR4xBcqRruhCNdA4-4ZK_CQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



 --
 Todd Widup
 Creature TD / Technical Artist
 t...@toddwidup.com
 todd.wi...@gmail.com
 www.toddwidup.com

>>>
>>>
>>>
>>> --
>>> Todd Widup
>>> Creature TD / Technical Artist
>>> t...@toddwidup.com
>>> todd.wi...@gmail.com
>>> www.toddwidup.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/CABBPk35%3D7djj-0YD%2B5Vev0c_HbjC3QTqpGJTqoYBuVnmPnfMJA%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/CAM9RXoJMEVNKECHX76zjcFVVS6E-rFct9XgNcXSYyYbm22tAPA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Todd Widup
> Creature TD / Technical Artist
> t...@toddwidup.com
> todd.wi...@gmail.com
> www.toddwidup.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 

Re: [Maya-Python] Assigning TAB as hotkey

2016-02-22 Thread Geordie Martinez
in the pyside docs here is what is said about using TAB for both the
default behavior (focusing on buttons) and capturing the keypress;
https://deptinfo-ensip.univ-poitiers.fr/ENS/pyside-docs/PySide/QtGui/QWidget.html

I’m betting someone out there has reimplemented the QWidget.event method

DOCS:

Widgets that accept keyboard input need to reimplement a few more event
handlers:

PySide.QtGui.QWidget.keyPressEvent()

is called whenever a key is pressed, and again when a key has been held
down long enough for it to auto-repeat. The Tab and Shift+Tab keys are only
passed to the widget if they are not used by the focus-change mechanisms.
To force those keys to be processed by your widget, you must reimplement
QWidget.event() .
​

On Mon, Feb 22, 2016 at 2:55 PM, Martin Gunnarsson 
wrote:

> Nice solution!
>
> Unfortunately it overrides the default behaviour of tab in text-fields and
> the Node-Editor.
> Wonder if there is a way around that
>
> On Friday, June 12, 2015 at 9:38:41 PM UTC+1, Mike Bourbeau wrote:
>>
>> PySide version:
>>
>> #
>> from PySide import QtCore, QtGui
>> from shiboken import wrapInstance
>> import maya.OpenMayaUI as mui
>>
>> mainWin = wrapInstance(long(mui.MQtUtil.mainWindow()), QtGui.QWidget)
>>
>> action = QtGui.QAction(mainWin)
>> action.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Tab))
>> action.setShortcutContext(QtCore.Qt.ApplicationShortcut)
>>
>> def foo():
>> print "TAB!"
>>
>> action.triggered.connect(foo)
>> mainWin.addAction(action)
>> #
>>
>> On Sunday, November 11, 2012 at 10:38:42 AM UTC-5, Marcus Ottosson wrote:
>> > Works perfectly, thanks Justin!
>> >
>> > Marcus
>> >
>> > Den onsdagen den 7:e november 2012 kl. 18:33:11 UTC skrev Justin
>> Israel:Check this out. You can create a QAction that is set to the
>> Application context, and then attach it to the MainWindow:
>> >
>> >
>> > 
>> >
>> > from PyQt4 import QtCore, QtGui
>> > import sip
>> >
>> >
>> >
>> > import maya.OpenMayaUI as mui
>> >
>> >
>> > mainWin = sip.wrapinstance(long(mui.MQtUtil.mainWindow()),
>> QtGui.QWidget)
>> >
>> >
>> > action = QtGui.QAction(mainWin)
>> > action.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Tab))
>> >
>> > action.setShortcutContext(QtCore.Qt.ApplicationShortcut)
>> >
>> >
>> > def foo():
>> > print "TAB!"
>> >
>> > action.triggered.connect(foo)
>> > mainWin.addAction(action)
>> >
>> > 
>> >
>> >
>> > Whenever I press TAB with the MainWindow in focus, I get the action
>> triggered.
>> > Now you could either save the reference to the action and slot, and
>> disconnect/reconnect to new ones for hot key references...or..you could
>> just set this all up once and have the slot call a function on your class
>> that you can simply replace at any time. That way you never have to mess
>> with the action or original slot. You just update whatever function the
>> slot calls.
>> >
>> >
>> >
>> > -- justin
>> >
>> >
>> >
>> >
>> >
>> > On Wed, Nov 7, 2012 at 9:43 AM, Judah Baron 
>> wrote:
>> >
>> > I'm guessing you need to go higher up in the object hierarchy with the
>> event filter. There is probably something else swallowing that event so you
>> never receive it.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Wed, Nov 7, 2012 at 6:28 AM, Marcus Ottosson 
>> wrote:
>> >
>> >
>> > Thanks for your response. I should've mentioned, I did try installing
>> an event filter, but it reported events from essentially ALL keys, EXCEPT
>> tab. :)
>> >
>> >
>> >
>> > I'll give it another go tonight. Can you think of any other way to hook
>> into the tab key?
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > view archives: http://groups.google.com/group/python_inside_maya
>> >
>> > change your subscription settings:
>> http://groups.google.com/group/python_inside_maya/subscribe
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > view archives: http://groups.google.com/group/python_inside_maya
>> >
>> > change your subscription settings:
>> http://groups.google.com/group/python_inside_maya/subscribe
>>
> --
> 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/04dd609c-91e4-45c7-bbaf-73713e14e9e3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 

[Maya-Python] Re: Python Workshop

2016-02-08 Thread Geordie Martinez
I m going to use this to brainwash my students int using pymel.
pm.initBrainWash()

On Monday, February 8, 2016, Paul Molodowitch <elron...@gmail.com> wrote:

> Ha!
>
> except I get:
> ImportError: No module named wrapitup
>
> Guess that explains why I have a hard time with goodbyes...
>
> On Thu, Feb 4, 2016 at 3:01 PM Geordie Martinez <geordiemarti...@gmail.com
> <javascript:_e(%7B%7D,'cvml','geordiemarti...@gmail.com');>> wrote:
>
>> Hey all,
>>
>> There are many new faces on this group; I like that.
>>
>> AND I love to teach python to the new faces just discovering python.
>>
>> So I have a new workshop on cgccircuit.com that starts on Feb 15th.
>> It's an 8 week workshop. Roughly 22 ~ 24 hours of video content and
>> graded assignments with one-on-one feedback.
>>
>> If you're new to python and interested in hearing more about the
>> workshop, the description and trailer for it is here:
>> http://www.cgcircuit.com/workshops/learn-python-inside-maya
>>
>> Anyway, that’s my pitch. take a gander if you’re interested.
>>
>> Also — this class is for people *NEW* to python. SO you pythonistas can
>> save your money.
>>
>> import wrapitup
>> wrapitup.sayGoodbye()
>>
>> ​
>> # result: Goodbye
>>
>> --
>> 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
>> <javascript:_e(%7B%7D,'cvml','python_inside_maya%2bunsubscr...@googlegroups.com');>
>> .
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CABPXW4j_J_OQKamSBs1gKtjwx408hGKTk8XmwaMQZe54-Mc0Qg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CABPXW4j_J_OQKamSBs1gKtjwx408hGKTk8XmwaMQZe54-Mc0Qg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> 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
> <javascript:_e(%7B%7D,'cvml','python_inside_maya%2bunsubscr...@googlegroups.com');>
> .
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAAssL7b7Sh8aVzmGato7QZKyx%2Brc_JZqMj9HBoFyDC-9bcO-Bg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAAssL7b7Sh8aVzmGato7QZKyx%2Brc_JZqMj9HBoFyDC-9bcO-Bg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> 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/CABPXW4j33wabFBuH0zPYsB%2BoQ7wXyVs7u%2BAJ1t%3DOEoUtYUfS8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] Python Workshop

2016-02-04 Thread Geordie Martinez
Hey all,

There are many new faces on this group; I like that.

AND I love to teach python to the new faces just discovering python.

So I have a new workshop on cgccircuit.com that starts on Feb 15th.
It's an 8 week workshop. Roughly 22 ~ 24 hours of video content and graded
assignments with one-on-one feedback.

If you're new to python and interested in hearing more about the workshop,
the description and trailer for it is here:
http://www.cgcircuit.com/workshops/learn-python-inside-maya

Anyway, that’s my pitch. take a gander if you’re interested.

Also — this class is for people *NEW* to python. SO you pythonistas can
save your money.

import wrapitup
wrapitup.sayGoodbye()

​
# result: Goodbye

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


Re: [Maya-Python] [PyMel + PySide] QlistWidget and Pymel Selection

2015-11-30 Thread Geordie Martinez
you have to loop through and add an item at a time like this:

from PySide import QtGui, QtCore#clear it outdef refresh(self):
self.listWidget.clear()
items = pm.selected()
for item in items:
newItem = QtGui.QListWidgetItem( item.nodeName())
self.listWidget.addItem(newItem)

try that
​

On Mon, Nov 30, 2015 at 12:05 AM, Padraig Ó Cuínn <
patchquinnanimat...@gmail.com> wrote:

> Hi Everyone,
>
> I was wondering if you can help me out with the above topic.
>
> basically what I have is a simple UI with a line edit ontop of a
> ListWidget and under that a button that refreshes the list  basically
> what i am hoping to have happen..
>
> so far this:
>
> #mayas selection vioa pymel
> maya_list = pm.selected()
>
>
>
>
> #connection from button to refresh list
> button.clicked.connect(refresh)
>
>
> #the refresh function adds  the maya_list
> refresh(self):
> self.listWidget.clear()
> self.listWidget.addItem(maya_list)
>
>
> I havent even begun to work on the lineEdit part yet but it's supposed to
> search through all the listed items in the listWidget and display them as
> typed.
>
> Any help would be awh-Mazing.
>
> Thanks
>
> Padraig
>
> --
> 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/d2e2cff9-3157-428c-bc11-05b17b7a0aa2%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/CABPXW4i%3D7QfwY5iX86trtxVOQceNySyU0fKxQXieYTPWRnfKjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] [PyMel + PySide] QlistWidget and Pymel Selection

2015-11-30 Thread Geordie Martinez
when you connect the button it's probably just not calling the function.
post your code and we'll take a gander.

On Mon, Nov 30, 2015 at 3:19 PM, Padraig Ó Cuínn <
patchquinnanimat...@gmail.com> wrote:

> Hi Geordie and Justin, I tried your function and for some reason I am nt
> getting any output at all on selecting objects and pushbutton. I'll give
> more details later on when I get time thank you.
>
> Padraig
>
> --
> 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/250d829a-89d4-4c10-8540-4dcb18957793%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/CABPXW4i82cVbA-7G7brGsoFbjYpC_9ubJG4OY-FXHmCD%3DJ-xtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] fatal error in Maya when iterate opening files

2015-11-24 Thread Geordie Martinez
Marcus is right. subprocess is the best way. me likey.
However. you’re using pymel so before you begin be sure and set an
environment variable to turn *off *initializing plugins. Chad Vernon sussed
out this crash a week or two ago on this group.

so set this variable if you’re on widows in your environment vars:
set PYMEL_SKIP_MEL_INIT = 1;

or on linux:

setenv PYMEL_SKIP_MEL_INIT 1

test it before hand to make sure it’ll work in subprocess. you don't want
to hunt down two different issues.
in a shell type:
mayapy

you should get a python prompt then test this to make sure you don't get a
traceback. then you're ready to convert your code below to a subprocess
call.

import maya.standalone
maya.standalone.initialize()import osimport pymel.core as pm
# you should see this next line if you set the environment variable
correctly.#pymel.internal.startup : INFO : Skipping MEL initialization
cube = pm.polyCube()
## your code goes here

pm.saveAs("someFile.ma")# result: Path('someFile.ma')
os._exit(0)

​

-- 
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/CABPXW4jTXuTzP3VMbqLq3yXB9RgP%2B_9W2B10%2B3Xk9wt2Uw5%3DPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] some # comments break my code!! // Error: Line 1.11113: Unterminated string.

2015-11-14 Thread Geordie Martinez
you can also use  http://tohtml.com  to quickly format code for pasting
into email/forums, etc.
paste your python in there and then copy and paste the HTML formatted
content here. but no one can help you if we can't see the code.

good luck.

On Sat, Nov 14, 2015 at 8:58 AM, Justin Israel <justinisr...@gmail.com>
wrote:

> And use a pastebin please, to preserve formatting.
>
> On Sun, 15 Nov 2015 4:35 AM yury nedelin <ynede...@gmail.com> wrote:
>
>> Post here exactly what you trying to run.
>> On Nov 14, 2015 4:43 AM, "Rudi Hammad" <rudiham...@gmail.com> wrote:
>>
>>> it is weird because I can excute le code with success one time or two
>>> times. But after that it breaks. I have 2 errors:
>>>
>>> // Error: ...ta =
>>> [\"l_indexMetacarpal\",\"l_middleMetacarpal\",\"l_ringMetacarpal\",\"l_pinkyMetacarpal\"]\n
>>> for i in range(0,fin //
>>> // Error: Line 2.0: Unterminated string. //
>>>
>>> error...ta??? what is that
>>> My comments are like # mycomment or like #--[mycomment]--#. Do you thing
>>> that #--[mycomment]--# could be causing problems.
>>> But how can it work a couple of times with no errors, and then breaks?
>>>
>>>
>>> El sábado, 14 de noviembre de 2015, 7:23:49 (UTC+1), Geordie Martinez
>>> escribió:
>>>>
>>>> unterminated string usually means a typo.
>>>>
>>>> you have one too many quotes or forgot to put a quote.
>>>> your trace back will tell you which line it's happening in.
>>>>
>>>>
>>>> On Fri, Nov 13, 2015 at 6:07 PM, Justin Israel <justin...@gmail.com>
>>>> wrote:
>>>>
>>>>> Got an example of broken code?
>>>>> That fix you mentioned is only if you use Unicode characters within
>>>>> your source code.
>>>>>
>>>>> On Sat, 14 Nov 2015 12:47 PM Rudi Hammad <rudih...@gmail.com> wrote:
>>>>>
>>>>>> hi,
>>>>>> so my code breaks when he wants...if I delete all the comments it
>>>>>> works.
>>>>>> If I leave the comments, sometime it works and other times it
>>>>>> breaks...soo what is going on?
>>>>>> I´ve read that addind at the beginning of my code the following
>>>>>> solves the problem:
>>>>>>
>>>>>> #!/usr/bin/env python
>>>>>> # -*- coding: utf-8 -*-
>>>>>>
>>>>>> but it doesn´t.
>>>>>> what can I do?
>>>>>>
>>>>>> 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 on the web visit
>>>>>> https://groups.google.com/d/msgid/python_inside_maya/8a0861ca-0569-42eb-a918-03db2832542e%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/8a0861ca-0569-42eb-a918-03db2832542e%40googlegroups.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>> 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/CAPGFgA0V_5QNKoFhb6aiHR%3DoCDpFTz90QSYZGfuiBrxRbaGfYQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0V_5QNKoFhb6aiHR%3DoCDpFTz90QSYZGfuiBrxRbaGfYQ%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>>> 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 

Re: [Maya-Python] some # comments break my code!! // Error: Line 1.11113: Unterminated string.

2015-11-13 Thread Geordie Martinez
unterminated string usually means a typo.

you have one too many quotes or forgot to put a quote.
your trace back will tell you which line it's happening in.


On Fri, Nov 13, 2015 at 6:07 PM, Justin Israel 
wrote:

> Got an example of broken code?
> That fix you mentioned is only if you use Unicode characters within your
> source code.
>
> On Sat, 14 Nov 2015 12:47 PM Rudi Hammad  wrote:
>
>> hi,
>> so my code breaks when he wants...if I delete all the comments it works.
>> If I leave the comments, sometime it works and other times it
>> breaks...soo what is going on?
>> I´ve read that addind at the beginning of my code the following solves
>> the problem:
>>
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>>
>> but it doesn´t.
>> what can I do?
>>
>> 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 on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/8a0861ca-0569-42eb-a918-03db2832542e%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/CAPGFgA0V_5QNKoFhb6aiHR%3DoCDpFTz90QSYZGfuiBrxRbaGfYQ%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/CABPXW4gvGMcSWAbRxnaP7U3qdmBuEBTmPb8ktisE1WZ32F2x6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] 'insertknotcurve' nightmare :(

2015-11-02 Thread Geordie Martinez
there is a detailed description of the ins and outs of NURBS curves at the
top of this page I think is pretty useful. it was for me anyway.
http://download.autodesk.com/us/maya/2011help/API/class_m_fn_nurbs_curve.html

I was having similar issues with a controller recorder/recreator script I
was working on.

do you have some code you want to post?






On Wed, Oct 28, 2015 at 3:55 PM,  wrote:

> Hello friends,
>
> i think i posted something similar to this a year ago but no answers.
> Basically i have a script which generates a curve using 'cmds.curve()'
> command with 'ep' for edit point flag.  (this curve will be curved not
> straight).
>
> Then the second part of the code involves adding two more points, each one
> evenly between these 3 initial points using the 'insertKnotCurve' command.
>
> However in order to place these two additional points evenly between the
> first points, the curve first needs to be rebuilt with
> 'cmds.rebuildCurve()' so the parameterisation of the curve is even between
> each point. so then i know to insert a knot at 'u[0.5]' and u'[1.5]' and it
> will be placed evenly.
>
> if the curve is rebuilt however , any point between the first and last
> move position  slightly (for some bizarre reason) which means those points
> that move need to be moved back before the knew points can be inserted and
> finally the job is done.
> ###
>
> this may not be clear, but basically if anyone can tell me how to rebuild
> a curve without the central points changing position...or maybe a way to
> create uniforms parameterisation with the cmds.curve command. i would love
> love love to know, because the workaround to fix this issue is ridiculous.
>
>
> thanks,
> Sam
>
> --
> 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/049ebeba-f36c-49e6-8ff6-9d0acd33086b%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/CABPXW4h-1XMX9BWsKZxxzkQGTayBR3KvPg_NzndTusHW6zPPtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Weird pymel hierarchy results

2015-10-18 Thread Geordie Martinez
Or you can always use .longName()
So if you try and select that joint later you don't get an error resulting
from having two identical node names.

It's probably better to have unique joint names in the first place.

On Sunday, October 18, 2015, Chris Lesage  wrote:

> Hey Aren,
>
> That (usually) happens when you have more than one node with the same
> name. Maya resolves the conflict by showing the entire path.
>
> You can still use .nodeName() if you need to grab just the name without
> the path. But watch out for conflicts.
>
> On Oct 18, 2015, at 11:40 PM, Aren Voorhees  > wrote:
>
> Hey all,
>
> I've noticed this sort of thing sometimes when using pymel.  If I run
> something like: curSel = pm.selected()[0] with a joint selected it will
> normal return:
>
> // Result: nt.Joint(u'Hand_L_Result_JNT) //
>
> That result is expected, but then other times it returns the entire
> hierarchy like this:
>
> // Result:
> nt.Joint(u'Arm_L_Upper_Result_JNT|Arm_L_UpperRoll_Result_JNT|Arm_L_Lower_Result_JNT|Arm_L_LowerRoll_Result_JNT|Hand_L_Result_JNT')
> //
>
> It seems to happen randomly and I haven't figured out how to get rid of
> it.  Does anyone know what causes this, and how to prevent 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 on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/02b926c5-91cc-466a-a875-3c6bea34330d%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/A10FE21E-7E9C-492C-9B83-DCF9C4924DF7%40gmail.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/CABPXW4gYTGW1zHbw3j921cPUZjmVHaQbxNLyGuNr2QoAC0st0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] List referenced files

2015-08-11 Thread Geordie Martinez
pymel is super useful for this

import pymel.core as pm
# GET A LIST OF REFERENCES
refs = pm.listReferences()
# LOOP THROUGH AND PRINT THE PATH# for ref in refs:
# PATH
print(path: %s%  ref.path)

# NAMESPACE
print(namespace: %s % ref.namespace)




On Tue, Aug 11, 2015 at 1:34 PM, Sivanny Selvakumar 
sivanny.selvaku...@gmail.com wrote:

 `file -q -list` will return all the file reference paths and string
 attributes marked as usedAsFilename. So it saves you from having to iterate
 over the nodes in the scene yourself. This is how Maya gets a list of files
 for the File  Archive Scene feature. You can also access this
 functionality from outside Maya with the `maya.exe -archive scene_file`
 flag.

 As long as your plugin nodes mark their file path attributes as
 usedAsFilename, or override the MPxNode::getFilesToArchive function, it
 should pick up the paths.


 On Tuesday, August 11, 2015 at 8:59:47 AM UTC-7, Marcus Ottosson wrote:

 I’m looking for a way to list all nodes that somehow reference an
 external file; be it references, textures, or some obscure custom node with
 an attribute for paths.

 I was looking at the cmds.filePathEditor
 http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/filePathEditor.html
 which is close.

  cmds.filePathEditor(query=True, listDirectories=)
 [list of paths]

 But it doesn’t show me which nodes are responsible for these paths, and
 doesn’t show me the full filenames.

 Any ideas?
 ​
 --
 *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/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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/CABPXW4i8Ai3%3D3Q4x_bTVQuqxTG1B%2BA0Eo-SaX5CbT9J3mDdTQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] List referenced files

2015-08-11 Thread Geordie Martinez
there used to be a script on creative crash called File Path Manager that
did this with textures

On Tue, Aug 11, 2015 at 9:59 PM, Geordie Martinez geordiemarti...@gmail.com
 wrote:

 pymel is super useful for this

 import pymel.core as pm
 # GET A LIST OF REFERENCES
 refs = pm.listReferences()
 # LOOP THROUGH AND PRINT THE PATH# for ref in refs:
 # PATH
 print(path: %s%  ref.path)

 # NAMESPACE
 print(namespace: %s % ref.namespace)




 On Tue, Aug 11, 2015 at 1:34 PM, Sivanny Selvakumar 
 sivanny.selvaku...@gmail.com wrote:

 `file -q -list` will return all the file reference paths and string
 attributes marked as usedAsFilename. So it saves you from having to iterate
 over the nodes in the scene yourself. This is how Maya gets a list of files
 for the File  Archive Scene feature. You can also access this
 functionality from outside Maya with the `maya.exe -archive scene_file`
 flag.

 As long as your plugin nodes mark their file path attributes as
 usedAsFilename, or override the MPxNode::getFilesToArchive function, it
 should pick up the paths.


 On Tuesday, August 11, 2015 at 8:59:47 AM UTC-7, Marcus Ottosson wrote:

 I’m looking for a way to list all nodes that somehow reference an
 external file; be it references, textures, or some obscure custom node with
 an attribute for paths.

 I was looking at the cmds.filePathEditor
 http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/filePathEditor.html
 which is close.

  cmds.filePathEditor(query=True, listDirectories=)
 [list of paths]

 But it doesn’t show me which nodes are responsible for these paths, and
 doesn’t show me the full filenames.

 Any ideas?
 ​
 --
 *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/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/1ebbe8ae-aada-4a31-8e71-2eddd8f02e93%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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/CABPXW4iqzWM7afR%2BC%2BV9aMLMOZBHCKvaLE9xvuEw%2B%2B-8PU4S5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] mel in python script calling

2015-06-01 Thread Geordie Martinez
pymel has a good converter that you can use to convert mel to a python
script:

paste this code into a python panel in maya.

a little prompt will come up for you to enter in some MEL.
paste some MEL in there and
press OK.

in the script editor history panel will have the python  you need converted.
it's not perfect, but it's a good place to start learning if you already
know MEL.


#MEL TO PYimport pymel.core as pmimport pymel.tools.mel2py as mel2py
result = pm.promptDialog(

title='SPIT BACK PYMEL',
message='Enter string:',
button=['OK', 'Cancel'],
defaultButton='OK',
cancelButton='Cancel',
dismissString='Cancel')
if result == 'OK':
text = pm.promptDialog(query=True, text=True)

# GET THE PYMEL EQUIVALENT
pmAnswer = mel2py.mel2pyStr(text,  pymelNamespace='pm')

# GET RID OF THE OLD WAY
pmCode = pmAnswer.replace(pymel.all,pymel.core)
print(pmCode)









On Mon, Jun 1, 2015 at 1:21 PM, Justin Israel justinisr...@gmail.com
wrote:

 Haha, yes. You get to put anything your heart desires in that string and
 it will come true.
 Actually, you just put valid MEL syntax into that string, and it will
 execute:

 some_mel = ls -sl
 mm.eval(some_mel)


 On Tue, Jun 2, 2015 at 3:47 AM Christopher. crestchristop...@gmail.com
 wrote:

 When you say (some_mel_code_string) do you mean a string of whatever I
 want, or mel code as a string, or something else ?


 On Sunday, May 31, 2015 at 6:42:37 PM UTC-4, Justin Israel wrote:

 You can use both MEL and Python in your solutions. MEL goes in mel
 files, and python goes in py files.

 How to call python code from your mel scripts:

 http://download.autodesk.com/global/docs/maya2014/en_us/Commands/python.html

 How to call mel code from your python scripts:

 import maya.mel as mm
 mm.eval(SOME_MEL_CODE_STRING)

 ​

 On Mon, Jun 1, 2015 at 10:28 AM Christopher. crestchr...@gmail.com
 wrote:

 That's what I thought.  How can I have a mixed bag of MEL and Python,
 would you need to see one of the other parts of the script ?


 On Sunday, May 31, 2015 at 3:49:14 PM UTC-4, Justin Israel wrote:

 You are trying to mix python and MEL syntax together? You can't do
 that, unless it's Mel code that uses the python() function to call python
 code, and visa versa.

 # some .py
 def foo():
 # py syntax
 foo()

 // some .mel
 global proc foo() {
 // Mel syntax
 }

 On Mon, 1 Jun 2015 7:34 AM Christopher. crestchr...@gmail.com wrote:

 Hi, I have a script that uses the def() syntax, the problem is the
 original code is MEL, using the following syntax is not working ?

 def acme()
 [MEL code]
 acme()





  --
 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/89a8b58e-6287-467f-b3c3-5137356b6a9b%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/89a8b58e-6287-467f-b3c3-5137356b6a9b%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/89d09d96-1048-44cb-9bf1-676f036c9837%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/89d09d96-1048-44cb-9bf1-676f036c9837%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/742c2f73-77cf-4175-8047-9006ca88285e%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/742c2f73-77cf-4175-8047-9006ca88285e%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/CAPGFgA04ny%2BfBRY116oRhBYtF-MH4Ts3aab7Se8d_u8RYfkPMg%40mail.gmail.com
 

Re: [Maya-Python] Printing loop statement ?

2015-06-01 Thread Geordie Martinez
you probably have something like this I'm guessing:


for j in range(0,5):
print('j=' + str(j)) # print the value of j for testing
# with string formatting.
print(string formatted: j=%s % j)


On Mon, Jun 1, 2015 at 8:56 PM, Geordie Martinez geordiemarti...@gmail.com
wrote:

 it's just a string and the plus sign is tacking the other string to the
 end of it. concatenating.
 there are a lot of ways to concatenate strings in python.

 another popular way is called string formatting. you can find some
 decent examples here:
 http://www.diveintopython.net/native_data_types/formatting_strings.html

 On Mon, Jun 1, 2015 at 8:52 PM, Christopher. crestchristop...@gmail.com
 wrote:

 You can print a loop, one thing I don't understand is the following;
 Suppose I have

 for j in range (0,5):
 First thing, what is the string 'j=' + str(j)) doing, I know what the
 second part of the loop is doing, converting the variable into a string or
 rather the float into a string, what is the first half of the statement
 saying ?

 --
 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/1b6d806a-80e1-485e-96c5-525136bdb599%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/1b6d806a-80e1-485e-96c5-525136bdb599%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4jRxDsu5QHkmgmpB0czSxqJ4XKVpf-RPhz%2BmH5TQvjnag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Selecting objects within a set namespace?

2015-03-16 Thread Geordie Martinez
if the item is unique in the namespace you can refer to it by its short
name:

import maya.cmds as mc
mc.select(ref_RN1:left_eye_geo,r=True)

you only need the long name if it's not unique.

select it in the scene and look in your script editor. that should give you
an idea.
if it has a | pipe in the name, then it's not unique. if there is no pipe
in the name it's unique.





On Sun, Mar 15, 2015 at 10:20 PM, Panupat Chongstitwattana 
panup...@gmail.com wrote:

 If I store my object names without namespace and then reference them into
 a new scene.

 For example if this is the string I stored.
 rig_grp|geo_grp|head_grp|left_eye_geo

 And I know for certain my namespace would be ref_RN1

 Currently I would manipulate the stored string so it turns into
 ref_RN1:rig_grp|ref_RN1:geo_grp|ref_RN1:head_grp|ref_RN1:left_eye_geo
 But I'm curious if there's a cleaner or more proper way to do this?

 Tried use namespace(set=':ref_extra_RN1') but that doesn't seem to do
 anything

 Best regard.

 --
 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/bb64548b-111e-483e-a609-e4d3015a8b15%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/bb64548b-111e-483e-a609-e4d3015a8b15%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4hj3sWVSJ_ABXdvHiuDgPa5eYC2OugrLs_gmK0o2nJP5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-12 Thread Geordie Martinez
you can use the pymel path method that wraps os and glob into one useful
set of utilities.

http://download.autodesk.com/global/docs/maya2014/en_us/PyMel/generated/classes/pymel.util.common/pymel.util.common.path.html?highlight=path#pymel.util.common.path
https://docs.python.org/2/library/glob.html

# make a path object
thePath =pm.Path(YOURPATH)

if not thePath.exists():
thePath.mkdir()

tests:
thePath.exists()
thePath.isFolder()
thePath.mkdir()
etc. see link above

# RETURN ALL FILES IN A FOLDER. returns path objects instead of strings.
filesInFolder = thePath.glob(*.*)

super useful


On Thu, Mar 12, 2015 at 9:55 PM, Panupat Chongstitwattana 
panup...@gmail.com wrote:

 Is there a list of available except type? For example if I'm doing

 try:
 os.makedir(dir)
 except .:
 pass

 Where can I find out what error to catch apart from trying it out?

 On Wednesday, March 11, 2015 at 8:22:06 PM UTC+7, elrond79 wrote:

 From a functional standpoint, there isn't a difference. There may be a
 performance difference, but unless you're making thousands, I wouldn't
 worry about it.

 Generally speaking, if I usually expect it to exist, and want to use it
 as a PyNode if it does, I'll do the try/except thing.  One note though -
 you should probably do:

 try:
 pmc.PyNode(string)
 except pmc.MayaNodeError:
 print something

 It's bad practice to have blanket except statements** - particularly if
 you're expecting a certain type of error. Get in the habit of having
 targeted try excepts, and you'll save yourself from headaches down the road.

 - Paul

 **There are always exceptions, of course - for instance, if you're
 running an app and don't want an unknown error to bring everything to a
 halt, it can make sense to have some generic high-level try/except
 statements.  And in those cases, you'll probably want to at least print
 some sort of warning or traceback, or maybe log it to an error log, or
 email a bug report, etc.  Also, even then, it's better to do except
 Exception as e: or except Exception: instead of except:, because the
 latter will catch strange things you almost certainly don't want to - ie,
 if the user presses ctrl-c, or even if you've explicitly tried to call
 sys.exit!


 On Wed, Mar 11, 2015 at 12:32 AM, Panupat Chongstitwattana 
 panu...@gmail.com wrote:

 Ah thank you. Such a silly mistake :(

 Is there any draw back if I don't check objExists but instead go for
 this?

 try:
 PyNode(string)
 except:
 print something



 On Wednesday, March 11, 2015 at 2:02:06 PM UTC+7, Justin Israel wrote:

 You have a typo between the two ways you format the string :

 tmpname = %smaster_crtl % sel.namespace()
 tmp = %smaster_ctrl % selects[0].namespace()

 crtl vs ctrl

 On Wed, 11 Mar 2015 7:02 PM Panupat Chongstitwattana panu...@gmail.com
 wrote:

 Hi.

 I ran into another problem. objExists is returning different result
 when I put it in a for loop.

 selects = pmc.selected()

 for sel in selects:
 tmpname = %smaster_crtl % sel.namespace()
 print tmpname
 print pmc.objExists(tmpname)
 # SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_LoopAnim
 _v001:exMaleHair001:master_ctrl
 # False

 tmp = %smaster_ctrl % selects[0].namespace()
 print tmp
 print pmc.objExists(tmp)
 # SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_LoopAnim
 _v001:exMaleHair001:master_ctrl
 # True

 What could be the cause of 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/8f3151a3-7a9b-4fdc-8721-
 f8cb60d35c10%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/8f3151a3-7a9b-4fdc-8721-f8cb60d35c10%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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/7d8ad41f-3f98-43ca-946a-1d5f14ab4b50%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/7d8ad41f-3f98-43ca-946a-1d5f14ab4b50%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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 

Re: [Maya-Python] Re: New to PyMEL. Couple question please?

2015-03-11 Thread Geordie Martinez
If you'd like to learn more about pymel this is a great book.
check out Practical Maya Programming with Python:
http://www.amazon.com/Practical-Programming-Python-Robert-Galanakis/dp/1849694729/ref=sr_1_1?ie=UTF8qid=1426095687sr=8-1keywords=practical+maya+programming+with+python

and I hear these videos are okay ;)  (shameless plug)
http://www.cgcircuit.com/course/intro-to-pymel-part-1






On Wed, Mar 11, 2015 at 6:21 AM, Paul Molodowitch elron...@gmail.com
wrote:

 From a functional standpoint, there isn't a difference. There may be a
 performance difference, but unless you're making thousands, I wouldn't
 worry about it.

 Generally speaking, if I usually expect it to exist, and want to use it as
 a PyNode if it does, I'll do the try/except thing.  One note though - you
 should probably do:

 try:
 pmc.PyNode(string)
 except pmc.MayaNodeError:
 print something

 It's bad practice to have blanket except statements** - particularly if
 you're expecting a certain type of error. Get in the habit of having
 targeted try excepts, and you'll save yourself from headaches down the road.

 - Paul

 **There are always exceptions, of course - for instance, if you're running
 an app and don't want an unknown error to bring everything to a halt, it
 can make sense to have some generic high-level try/except statements.  And
 in those cases, you'll probably want to at least print some sort of warning
 or traceback, or maybe log it to an error log, or email a bug report, etc.
 Also, even then, it's better to do except Exception as e: or except
 Exception: instead of except:, because the latter will catch strange
 things you almost certainly don't want to - ie, if the user presses ctrl-c,
 or even if you've explicitly tried to call sys.exit!


 On Wed, Mar 11, 2015 at 12:32 AM, Panupat Chongstitwattana 
 panup...@gmail.com wrote:

 Ah thank you. Such a silly mistake :(

 Is there any draw back if I don't check objExists but instead go for this?

 try:
 PyNode(string)
 except:
 print something



 On Wednesday, March 11, 2015 at 2:02:06 PM UTC+7, Justin Israel wrote:

 You have a typo between the two ways you format the string :

 tmpname = %smaster_crtl % sel.namespace()
 tmp = %smaster_ctrl % selects[0].namespace()

 crtl vs ctrl

 On Wed, 11 Mar 2015 7:02 PM Panupat Chongstitwattana panu...@gmail.com
 wrote:

 Hi.

 I ran into another problem. objExists is returning different result
 when I put it in a for loop.

 selects = pmc.selected()

 for sel in selects:
 tmpname = %smaster_crtl % sel.namespace()
 print tmpname
 print pmc.objExists(tmpname)
 # SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_
 LoopAnim_v001:exMaleHair001:master_ctrl
 # False

 tmp = %smaster_ctrl % selects[0].namespace()
 print tmp
 print pmc.objExists(tmp)
 # SC05A_0110_ECh_LoopAnim_v002:SC05A_0020_Extra_Cheer_
 LoopAnim_v001:exMaleHair001:master_ctrl
 # True

 What could be the cause of 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/8f3151a3-7a9b-4fdc-8721-f8cb60d35c10%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/8f3151a3-7a9b-4fdc-8721-f8cb60d35c10%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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/CAAssL7bjy%2BHYmO0o4byZMrWSZ%2BmThofJkZkUD8O_HgwoBDhZ0g%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAAssL7bjy%2BHYmO0o4byZMrWSZ%2BmThofJkZkUD8O_HgwoBDhZ0g%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] PyMel - name at creation inconsistency

2015-03-05 Thread Geordie Martinez
Another approach is to at the # into your naming schema. this will
increment to the next unique number for that name.
then the name will not have a collision with other objects in your scene

for x in range(10):
grp = pm.group(em=True)
t = pm.spaceLocator(n='*test#*')  # add the pound symbol to get
next unique number.
pm.parent(t, grp)



On Thu, Mar 5, 2015 at 10:52 AM, Chris Lesage chris.g.les...@gmail.com
wrote:

 Oh sorry, that was your workaround. :)

 On Thu, Mar 5, 2015 at 7:51 PM, Chris Lesage chris.g.les...@gmail.com
 wrote:

 It's because when there are more than one nodes that have the same
 non-unique name, Maya sees them as this:

 |group1|test
 |group2|test
 |group3|test

 So it can't find test anymore. Even though you are casting it as a
 variable, there is some bug. This bug only seems to occur for locators.

 Is there a reason you aren't using unique names?

 If you do need non-unique names, then this works: Rename the locator
 after creation.

 for x in range(10):
 grp = pm.group(em=True)
 t = pm.spaceLocator()
 pm.rename(t, 'test')
 pm.parent(t, grp)


 On Thu, Mar 5, 2015 at 6:37 PM, Marcus Ottosson konstrukt...@gmail.com
 wrote:

 I had a good look at this, and it looks to be quite the interesting
 quirk. :)

 Here’s the same problem in maya.cmds.

 from maya import cmds
 for x in range(2):
 grp = cmds.group(em=True)
 t = cmds.polySphere(n='test')[0]
 assert isinstance(grp, unicode)
 assert isinstance(t, unicode)
 cmds.parent(t, grp)

 Merely replacing polySphere with spaceLocator causes the error for me
 in Maya 2015, and I have no idea why.

 Good find!
 ​

 --
 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/CAFRtmODHPmSgwZkj-uh8%3DswwjnZjL9jR8wXXu0EvsEbXRXwp9Q%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODHPmSgwZkj-uh8%3DswwjnZjL9jR8wXXu0EvsEbXRXwp9Q%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 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/CAHUba0KynD8USgVOKg6ohOx8c7EA0WXfHccDRt%3Dd5kgWbLY0%2Bg%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAHUba0KynD8USgVOKg6ohOx8c7EA0WXfHccDRt%3Dd5kgWbLY0%2Bg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 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/CABPXW4iOuL%3DFZ05t6gqHyZaNsAjqRHLLAb-LhE8fSFycB3-9FQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-09-20 Thread Geordie Martinez
Later in in the book (page 256-257) galanakis shows how to defer the
loading of pymel.

Try that perhaps it will help out.

On Friday, September 19, 2014, tushar sankhala tusharsankh...@gmail.com
wrote:

 Hi All,

 I was mostly developing for Maya C++ Api and i am new to Maya Python. So
 sorry if am wrong somewhere. I was reading and following
 *Practical Maya Programming Book by Robert Galanakis*

 i am getting a error as soon as i import pymel.core as pmc in mayapy

 Error:

 pymel.internal.startup : ERROR : maya.standalone was successfully
 initialized, b
 ut pymel failed to import maya.cmds (or it was not populated)
 Traceback (most recent call last):
   File stdin, line 1, in module
   File C:\Program
 Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\_
 _init__.py, line 11, in module
 _startup.mayaInit()
   File C:\Program
 Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\intern
 al\startup.py, line 170, in mayaInit
 from maya.cmds import about
 ImportError: cannot import name about

 Can anyone help me in this?

 Thanks in advance

 Tushar

 --
 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
 javascript:_e(%7B%7D,'cvml','python_inside_maya%2bunsubscr...@googlegroups.com');
 .
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/python_inside_maya/7d4520ac-cace-4462-b283-999ab65a44b4%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/7d4520ac-cace-4462-b283-999ab65a44b4%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4gqSbDXKJLqXNVUDF-AoxerJY83XOKZw2Low%3D3uWRWz4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Is pyMEL slower than MEL? Why PyMEL?

2014-09-18 Thread Geordie Martinez
Honestly you should learn maya.cmds and PyMEL. You need to know both
because studios use both. and you can't get away with just knowing one.
Then learn the Python API

PyMEL saves you coding time not cycles.  if you're writing a deformer or
iterating over the verts in a poly mesh you'd want to use the Python API.
if you're rigging I prefer PyMEL.

PyMEL is object-oriented. It's a framework wrapper that wraps MEL,
maya.cmds and the Python API. Which ever route returns the fastest
most-complete data is what PyMEL will use.

for rigging or general scripts PyMEL is great! I've used it for years.
For code that needs to be super fast and deals with gigantic data sets, use
the Python API or C++ API.

RE the ls command being 40x slower in PyMEL is a faulty comparison. Here's
why:
the pymel selected() command is slower because each item it returns is
converted to a pynode object instead of a string (maya.cmds).
What is returned is more useful, but you have to wait a millionth of a
second longer to get it.

if you are a python coder, PyMEL will behave as you would expect. Like
other python modules in the python universe. It is more pythonic as it
passes around objects with function sets related to the object. instead of
strings that force you to search for the right methods.

therefore you can run help on any PyMEL object and see a list of methods.
This is pythonic.
help(pynode)
or
help(pynode.__class__)

the Python API 2.0 is not as complete as the 1.0 API and is incompatible
with the 1.0 API.

Perhaps soon the 2.0 API will be fully functional.







On Thu, Sep 18, 2014 at 4:52 AM, Hans Baldzuhn hans.baldz...@gmail.com
wrote:

 PyMel is far slower than mel or default python.

 As Jeremy YK, pyMel is a wrapper of the python and maya api.
 If you are using api calls on a single object (like querying vertex
 position etc), it will as fast as the python API.

 But for everything accessible through mel, like the ls command, pymel
 can be up to 40 times slower on huge scene (from my experience). There is a
 big overhead of wrapping all returned strings to PyMel nodes.

 For me it's only a way to write faster and in a more pythonic way. But
 it's going to be always slower than mel, python or API.  And it's HUGE to
 load.
 I personally just need it to be fast so pymel is useless to me.

 In my codes, I finally removed all pymel call with default python command,
 and I made a simple node wrapper to keep a few pymel functionality.

 Le jeudi 18 septembre 2014 11:58:11 UTC+2, Srinivasan Samuel a écrit :

 Hi pyGeeks  pyNERDS out there :)

 I salute you all. Knowing Python(an OK scripter) I have started learning
 Maya scripting from MEL and now gravitating towards pyMEL as I feel thats
 the way to go.

 I also want to know the cons of pyMEL over Python in Maya  MEL ofcourse.
 Please refer the following link and this gentleman says pyMEL is slower
 than MEL.

 http://jeremyyk.com/tutorials/maya-s-python-api-2-0-

 Could somebody motivate and justify me that pyMEL is the future  the way
 to go :)

 I appreciate your time.

 Solomon.

  --
 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/07319b50-d8d6-4830-8576-17baf3a328e6%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/07319b50-d8d6-4830-8576-17baf3a328e6%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] Re: component islands

2014-09-18 Thread Geordie Martinez
I can help you.
when you say component islands you mean you have some polygon that has a
bunch of separate poly islands.
i.e., if you selected the geometry and did a separate command you'd have a
bunch of individual pieces?

you want to discover those pieces without using the separate command. You
want to make a set of data sets like a list of verts converted to faces
based on a vert selection?

is this correct?


On Thu, Sep 18, 2014 at 4:27 PM, Justin Israel justinisr...@gmail.com
wrote:


 On 19/09/2014 11:20 AM, kevcorte...@gmail.com wrote:
 
  I suppose I've been put on ignore for mentioning xsi (i'm sorry, i'm
 sorry ;) )
 

 You haven't been put on ignore for any reason. I just think it's a matter
 of the the right person not yet having responded with an answer.

  but if anyone is listening, I've taken a step back, and decided to work
 on the simpler bits for now. avoiding the islands for now, and just
 focusing on what I want from the components passed in.
 
  Things would be much easier for me I think if my selection list remained
 objects, and not strings after converting the list to verts using
 pm.polyListComponentConversion().  is there a better way?
 
  sorry for a silly question, but how could I get the objects instead or
 after? so that I can get the position, and normal, etc, etc.
 
  ===
 
  def getComponentIslands( components ):
  '''
  do fancy stuff here to return component islands
  '''
  return componentIslands
 
 
  def convertToVerts( components ):
  return pm.polyListComponentConversion( components, toVertex=True )
 
 
  def getAvgVertTfm( components ):
 
  avgTfm = pm.datatypes.TransformationMatrix()
  verts = convertToVerts(components)
  for vert in verts:
  '''
  do all the fancy math stuff here
  '''
  pass
 
  return avgTfm
 
  =
 
  Thanks
  Kev
 
  --
  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/6507d05d-8aba-4085-8637-6faf20a92f56%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/CAPGFgA3hPSRf-HdjrZyWz3gq-5nPGMV7VgajJ-WyZ%3DXqX5XPDw%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3hPSRf-HdjrZyWz3gq-5nPGMV7VgajJ-WyZ%3DXqX5XPDw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] Re: component islands

2014-09-18 Thread Geordie Martinez
here is some code I use for doing that. It could be written better, but I
was young. I needed the money. It has some code smell, but I dont' have
time to improve it.

import pymel.core as pmdef tfmAtCentroid(vertSel=None, tfmSel=None,
locator=True, name=None):
 select verts and joints. snaps a joint to the centroid
position of selected verts. 
# SELECTED VERTS AND JOINTS

verts = vertSel or []
tfms = tfmSel or []
sel = pm.selected()

returnList=[]

# NOTHING PASSED IN OR SELECTED
if not vertSel and not tfmSel and not sel:
return

# IF NO ARGS PASSED IN GET SELECTED
if sel:
for item in sel:
   # SORT THE SELECTION
   if item.__class__.__name__ == MeshVertex:
   verts.append(item)

   else:
   tfms.append(item)

# JUST SELECTED WHOLE PIECE(s) OF GEOM
if tfms != [] and verts == []:

for tfm in tfms:
try:
pm.select(%s.vtx[:]%tfm,r=True)
newTfm = tfmAtCentroid(locator=locator,name=name)[0]
returnList.append(newTfm)
except:
# NOT A MESH
if locator:
name = name or %sNUL%tfm
loc = pm.spaceLocator(n=name)
pm.delete(pm.pointConstraint(tfm,loc,mo=False))
returnList.append(loc)
else:
name = name or %sJNT%tfm
pm.select(d=True)
j = pm.joint(n=name)
pm.select(d=True)
pm.delete(pm.pointConstraint(tfm,j,mo=False))
returnList.append(j)

# HAVE TO RETURN HERE OR IT WILL CONTINUE ON AND MOVE YOUR TFM
TO THE ORIGIN
return returnList

# SELECTED SOME VERTS AND THATS IT
if tfms == [] and verts != []:
if locator:
name = name or %sNUL% verts[0].node()
loc = pm.spaceLocator(n=name)
tfms.append(loc)
returnList.append(loc)
else:
name = name or %sJNT% verts[0].node()
j = pm.joint(n=name)
pm.select(d=True)
tfms.append(j)
returnList.append(j)

pm.select(verts,r=True)
# CREATE A CLUSTER TEMPORARILY
clsNode, clsHandle = pm.cluster()
for tfm in tfms:
# SNAP JOINTS TO THE CLUSTER HANDLE
pm.select(d=True)
pm.delete(pm.pointConstraint(clsHandle,tfm,mo=False))

#DELETE THE CLUSTER HANDLE
pm.select(d=True)
try:
pm.delete(clsNode,clsHandle)
except: pass

return returnList



On Thu, Sep 18, 2014 at 4:52 PM, kevcorte...@gmail.com wrote:

 Hi, Thanks for replying.

 by component islands, I mean to say - 'Groups' of connected components
 (edges, faces, verts) in the current selection or passed in component id's.

 I'd love some help with that. I will just be creating locators at the
 average tfm of those component 'Groups' for now.

 I've figured out my previous posts dilemma, by just instancing a
 pm.MeshVertex() with the string(s) that the conversion cmd was giving me.
 that's probably not that best way though i figure.

 even so, now I have access to their positions and normals, just need to do
 some err, math.

 --
 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/9c954523-f47d-4f5d-b67e-50b8bd6a13fe%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/CABPXW4g0KD%2Bw61MzjDZTZaiy1LhR%3Ddq4gn%2Bj1RYHL3w2%3DTjgrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] PyMel FBXExport method?

2014-09-15 Thread Geordie Martinez
there is no pymel api for FBX to my knowledge, BUT
you can python-ify your calls by using pm.mel
then the mel command is python. try it.

import pymel.core as pm
pm.loadPlugin(fbxmaya) # LOAD PLUGIN

# EXAMPLE SYNTAX
# pm.*mel*.FBXCommand(args)
#for example
pm.mel.FBXExport(f=FILENAME)
pm.mel.FBXImport(f=FILENAME,t=TAKE)



On Mon, Sep 15, 2014 at 1:59 PM, Eric Thivierge ethivie...@hybride.com
wrote:

 Looking around in the PyMel docs not finding too much info on FBXExports
 via PyMel. Anyone got any info?

 Thanks in advance,
 Eric T.

 --
 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/5417533C.8050801%40hybride.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/CABPXW4h48ZBiHY%3Dxhc3QnchnEGgtGBBfFyGzE7bb4dJRWSJZ4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] PyMel FBXExport method?

2014-09-15 Thread Geordie Martinez
What kind of weirdness? do you have any stack traces or examples? I'd like
to see if it's an unknown bug or if there are problems like having an
argument called import or something that will break python.
behind the scenes pm.mel is doing mel.eval so there shouldn't any weirdness.

On Mon, Sep 15, 2014 at 3:15 PM, Yi Liang Siew soni...@gmail.com wrote:

 Been doing a ton of stuff with FBXExport lately. I recommend just going
 through mel.eval(). I've experienced a lot of weird stuff when trying to do
 it through pymel.


 On 9/15/2014 2:55 PM, Eric Thivierge wrote:

 Awesome thanks.

 On Monday, September 15, 2014 5:54:22 PM, Geordie Martinez wrote:

 there is no pymel api for FBX to my knowledge, BUT
 you can python-ify your calls by using pm.mel
 then the mel command is python. try it.

 import  pymel.core as pm
 pm.loadPlugin(fbxmaya)  # LOAD PLUGIN

 # EXAMPLE SYNTAX
 # pm.*mel*.FBXCommand(args)

 #for example
 pm.mel.FBXExport(f=FILENAME)
 pm.mel.FBXImport(f=FILENAME,t=TAKE)


 On Mon, Sep 15, 2014 at 1:59 PM, Eric Thivierge
 ethivie...@hybride.com mailto:ethivie...@hybride.com wrote:

 Looking around in the PyMel docs not finding too much info on
 FBXExports via PyMel. Anyone got any info?

 Thanks in advance,
 Eric T.

 --
 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
 mailto:python_inside_maya%2bunsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/__msgid/python_inside_maya/__
 5417533C.8050801%40hybride.com
 https://groups.google.com/d/msgid/python_inside_maya/
 5417533C.8050801%40hybride.com__.
 For more options, visit https://groups.google.com/d/__optout
 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
 mailto:python_inside_maya+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/python_inside_maya/CABPXW4h48ZBiHY%
 3Dxhc3QnchnEGgtGBBfFyGzE7bb4dJRWSJZ4Q%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CABPXW4h48ZBiHY%
 3Dxhc3QnchnEGgtGBBfFyGzE7bb4dJRWSJZ4Q%40mail.gmail.com?utm_
 medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout.




 ---
 This email is free from viruses and malware because avast! Antivirus
 protection is active.
 http://www.avast.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/54176505.9070205%40gmail.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/CABPXW4icfM%3DAkY2C%2BevTTv%2BXwoA_KJqqKCWtPG6x3Hy%2BDQJWXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Maya-Python] How can you add maya's color picker UI into a pyside tool?

2014-09-03 Thread Geordie Martinez
hey all,
need some help.

I'm trying to figure out how to add maya's colorpickerUI into a pyside GUI.

it's the same color picker that comes up when you try and edit preferences
-  colors
(see attached image)

Any help would be appreciated.

-- 
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/CABPXW4i9yxBH434p0%2BoE07TwwXVGnoPn1w-cS%3DZN_b2ttwygEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] How can you add maya's color picker UI into a pyside tool?

2014-09-03 Thread Geordie Martinez
colorEditor. that's what it's called. thank you. that is what I was looking
for.


On Wed, Sep 3, 2014 at 12:33 PM, Justin Israel justinisr...@gmail.com
wrote:

 Do you specifically not want to use the Qt QColorDialog?
 http://qt-project.org/doc/qt-4.8/qcolordialog.html

 There isn't anything stopping you from using the Maya colorEditor if you
 really want that specifically:

 http://download.autodesk.com/global/docs/maya2014/en_us/CommandsPython/colorEditor.html

 Either way, you can just wire a button to a slot that shows either one.
  On 4/09/2014 5:19 AM, Geordie Martinez geordiemarti...@gmail.com
 wrote:

 hey all,
 need some help.

 I'm trying to figure out how to add maya's colorpickerUI into a pyside
 GUI.

 it's the same color picker that comes up when you try and edit
 preferences -  colors
 (see attached image)

 Any help would be appreciated.

  --
 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/CABPXW4i9yxBH434p0%2BoE07TwwXVGnoPn1w-cS%3DZN_b2ttwygEg%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CABPXW4i9yxBH434p0%2BoE07TwwXVGnoPn1w-cS%3DZN_b2ttwygEg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 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/CAPGFgA1TxhN7aYqqmNCemqSVgMzvXhjcUfvJK9t_FEqeWp%2BZgQ%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1TxhN7aYqqmNCemqSVgMzvXhjcUfvJK9t_FEqeWp%2BZgQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4gouu2kxKOLnWRxkv6rV%3D%3Dfn78knHM_Qiyy4zD0KaSCcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: pymel globalscale

2014-08-20 Thread Geordie Martinez
Ah yes. I completely forgot about that utility node. it works perfectly for
this.



On Tue, Aug 19, 2014 at 9:45 PM, Marcus Ottosson konstrukt...@gmail.com
wrote:

 There is also the decomposeMatrix node, and the worldMatrix slot of
 transforms.

 my_transform, my_shape = cmds.polyCube()
 decompose = cmds.createNode('decomposeMatrix')
 cmds.connectAttr(my_transform + .worldMatrix, decompose + .inputMatrix)
 cmds.getAttr(decompose + .outputScale)

 This will give you the worldspace equivalent of all transform channels in
 real-time.

 cmds.getAttr(decompose + .outputTranslate)
 cmds.getAttr(decompose + .outputRotate)
 cmds.getAttr(decompose + .outputShear)
 ...

 ​


 On 20 August 2014 04:59, kevcorte...@gmail.com wrote:

 Hi Geordie,  Thanks for the help. I think I'm confused now.  What is the
 difference in returns between using getMatrix() and getTransformation()?
 They both say they return a transformation matrix, is it correct?

 Anyhow, I basically just want to return the scale of an object/locator as
 if you unparented it, and got that value in scale.  Which I believe your
 functions does for me. Thank you.  I'm a little surprised maya doesn't give
 you access to 'global scale', but does for all other components of a
 transform.

 I think this will work great for my need though. Cheers!

 --
 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/9788952a-59f0-4ed7-9311-408ebc12cf4f%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/CAFRtmOAK85fYnyNmvDh%3DhCXwRnqiHZ%3DPYw0Vxw4_bzPkUyRFrA%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAK85fYnyNmvDh%3DhCXwRnqiHZ%3DPYw0Vxw4_bzPkUyRFrA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] PyMEL access of blendShapes

2014-07-14 Thread Geordie Martinez
you can try the listAliases() method which will
give you a list of tuples with the name of the blendshape geom and the
weight attr it is driving on the blendshape node:

example: I just made a sphere with 3 blendshapes called frown smile and
furrow:

geom = pm.PyNode(someGeometryName)
blends = geom.getShape().inputs(type='blendShape')
blends[0].listAliases()

# Result: [(u'frown', Attribute(u'blendShape.weight[0]')),
 (u'smile', Attribute(u'blendShape.weight[1]')),
 (u'furrow', Attribute(u'blendShape.weight[2]'))] #






On Mon, Jul 14, 2014 at 10:22 AM, Kenneth Ibrahim kenibra...@gmail.com
wrote:

 Using PyMEL I'm able to access the list of blendShape targets as follows
 given that 'bs_node' is a reference to the blendShape object:

 bs_node.getTarget()

 This returns the list of names of the targets as expected but only while
 the original target geometry objects are still connected to the blendShape
 node. If I delete all of the targets the 'getTarget' method returns an
 empty list though the blendShape node itself has a 'weight' parent
 attribute which still has the names of the original targets and their
 values.

 What is the best way in PyMEL to poll this list of target names on the
 blendShape node if the original target meshes no longer exist?

 Thx!

 --
 God is a metaphor for a mystery that absolutely transcends all human
 categories of thought. It's as simple as that! - Joseph Campbell

 --
 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/CAP_aC5Yogs6WdXCmhCbAFjTnMuY6S7QQnasbR%3DKsOkZBUkCt0A%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5Yogs6WdXCmhCbAFjTnMuY6S7QQnasbR%3DKsOkZBUkCt0A%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4jy4mJaEfyCNfv4F6jTbuo%2BkyNC550gMD2P3m2mS%2BsPxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] PyMEL access of blendShapes

2014-07-14 Thread Geordie Martinez
no worries. good luck.



On Mon, Jul 14, 2014 at 1:21 PM, Kenneth Ibrahim kenibra...@gmail.com
wrote:

 Geordie,

 Thanks for the answer. I'm going with this though I had to deal with the
 different, non-sequential return order of the aliases compared to the
 'getTarget' method which always seemed to return the targets in order.

 It would be nice if 'getTarget' worked in both cases :)

 Cheers!


 On Mon, Jul 14, 2014 at 10:36 AM, Geordie Martinez 
 geordiemarti...@gmail.com wrote:

 you can try the listAliases() method which will
 give you a list of tuples with the name of the blendshape geom and the
 weight attr it is driving on the blendshape node:

 example: I just made a sphere with 3 blendshapes called frown smile and
 furrow:

 geom = pm.PyNode(someGeometryName)
 blends = geom.getShape().inputs(type='blendShape')
 blends[0].listAliases()

 # Result: [(u'frown', Attribute(u'blendShape.weight[0]')),
  (u'smile', Attribute(u'blendShape.weight[1]')),
  (u'furrow', Attribute(u'blendShape.weight[2]'))] #






 On Mon, Jul 14, 2014 at 10:22 AM, Kenneth Ibrahim kenibra...@gmail.com
 wrote:

 Using PyMEL I'm able to access the list of blendShape targets as follows
 given that 'bs_node' is a reference to the blendShape object:

 bs_node.getTarget()

 This returns the list of names of the targets as expected but only while
 the original target geometry objects are still connected to the blendShape
 node. If I delete all of the targets the 'getTarget' method returns an
 empty list though the blendShape node itself has a 'weight' parent
 attribute which still has the names of the original targets and their
 values.

 What is the best way in PyMEL to poll this list of target names on the
 blendShape node if the original target meshes no longer exist?

 Thx!

 --
 God is a metaphor for a mystery that absolutely transcends all human
 categories of thought. It's as simple as that! - Joseph Campbell

 --
 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/CAP_aC5Yogs6WdXCmhCbAFjTnMuY6S7QQnasbR%3DKsOkZBUkCt0A%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5Yogs6WdXCmhCbAFjTnMuY6S7QQnasbR%3DKsOkZBUkCt0A%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 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/CABPXW4jy4mJaEfyCNfv4F6jTbuo%2BkyNC550gMD2P3m2mS%2BsPxw%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CABPXW4jy4mJaEfyCNfv4F6jTbuo%2BkyNC550gMD2P3m2mS%2BsPxw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




 --
 God is a metaphor for a mystery that absolutely transcends all human
 categories of thought. It's as simple as that! - Joseph Campbell

 --
 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/CAP_aC5bgDgURdZ-%2Bjc8ObY3ShzyLxkrtC9A2JKtV%3DmLN1YtjGA%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5bgDgURdZ-%2Bjc8ObY3ShzyLxkrtC9A2JKtV%3DmLN1YtjGA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] Re: Open Discussion of Pymel by a Pymel noob

2014-07-07 Thread Geordie Martinez
Getting back to Pymel. I love it. OOP is the way to go. the only way to go.
I just hate that it has mel in the name.

if and when there is ever a concerted effort by Autodesk to truly OOP their
Maya python API I will adopt it.
but in the meantime. Objects with methods makes more sense than flinging
strings everywhere.

2 cents.


On Mon, Jul 7, 2014 at 5:13 AM, Christopher Crouzet 
christopher.crou...@gmail.com wrote:

 SideFX came up with Houdini Engine which is a similar idea but not as
 complete I guess? Just throwing a prejudice here, not sure what I'm talking
 about.
 Anyways, I disagree when you say those companies would be against it.
 Fabric can act like a glue between them all, potentially bringing more
 customers to some of them, and definitely bringing more power to them all
 with the crazy optimizations Fabric comes with.

 OT: not sure where you got that I'm inundated with work, I've ben
 travelling for over 1 year :D



 On 7 July 2014 00:36, Jeremy YeoKhoo jyeok...@gmail.com wrote:

 Ill try my best to look into FabricEngine, and get back to this Forum!
 Like Christopher, I am currently inundated with work, and Fabric is on my
 lower priority list. Also thanks for the info regarding Julia.

 From my current knowledge of FabricEngine and Maya, current version of
 Maya have a few internal issues with the API that is causing a few bugs to
 prop up. Additionally I wouldnt be surprised that Autodesk, Foundry, SideFX
 and etc are probably against the idea of a middleware platform. So I might
 just wait a bit.



 On Friday, 4 July 2014 12:06:52 UTC+10, Jeremy YeoKhoo wrote:

 Hey guys,

 I want to ask your personal opinion of pyMel. After reading the topic on 
 Monkey
 Patching the Maya API
 http://christophercrouzet.com/blog/post/2014/06/23/From-Monkey-Patching-the-Maya-Python-API-to-Gorilla-and-Bananas
 by Christopher Crouzet and an earlier discussion regarding this topic in
 this forum
 https://groups.google.com/forum/#!topic/python_inside_maya/cLdkFBAgRtI
 , I started thinking back to pyMel and wondered if it might be an
 answer, I feel like kicking myself for disregarding PyMel previously. I
 have just realised how pythonic and how pyMel holds more of a object
 oriented paradigm as opposed to MEL and maya.cmds (even described by
 Autodesk
 http://download.autodesk.com/us/maya/2011help/PyMel/why_pymel.html)

 So I have a few queries, Pymel is now being shipped with Maya, but not
 supported by Autodesk which my have production implications.

 What do you guys think of Pymel?

 -Jeremy


  --
 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/9de94ba1-2607-46d5-82ee-4bcad3fd6067%40googlegroups.com
 https://groups.google.com/d/msgid/python_inside_maya/9de94ba1-2607-46d5-82ee-4bcad3fd6067%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




 --
 Christopher Crouzet
 *http://christophercrouzet.com* http://christophercrouzet.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/CANuKW52_ij1KZ50ztmpazooR_9hJV34sphsAGSd9hULUNfa%3DWg%40mail.gmail.com
 https://groups.google.com/d/msgid/python_inside_maya/CANuKW52_ij1KZ50ztmpazooR_9hJV34sphsAGSd9hULUNfa%3DWg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 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/CABPXW4geLsbG4%3DjGqMP6PHk%2Bk3g6GtK9SjRihq5oQ3Dc8F%2BTmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: Open Discussion of Pymel by a Pymel noob

2014-07-07 Thread Geordie Martinez
I look forward to seeing how these new wrappers pan out. But they are just
wrappers like pymel. They'll encounter the same under-the-hood issues and
have to find some way to deal with them.
Pymel has had years of development and is accepted by Autodesk. And I'm
sure there will be similarities and overlap and compromises.

I do disagree with you about OOP vs. strings (maya.cmds). You can translate
your python skills to other forms of python if you understand the OOP
methodology and take advantage of oodles of modules out there  -- all using
the OOP methodology. having a string reperesent an object in 3D space,
itself an object-oriented world, also makes little sense to me.

I've spent years using pymel and I much prefer it to maya.cmds. (it has
maya.cmds inside so if I had to use it I could).
Especially for getting and setting attributes, connecfting attributes,
dealing with skin clusters, all rigging procedurals, shaders, and file
system importing and exporting, it has the path and glob functions built
in, references, namespaces... Pymel is powerful. As a creature TD I can't
agree with your disagreement. It is very useful.

Anyway, to each his own.







On Mon, Jul 7, 2014 at 10:10 AM, Marcus Ottosson konstrukt...@gmail.com
wrote:

 I'm certainly not one to argue the merits of object-oriented programming.
 But OOP is only one of many programming paradigms
 http://en.wikipedia.org/wiki/Programming_paradigm and is as much of a
 silver-bullet as any other. If you're suggesting it fits and problem I'd
 have to disagree with you; it certainly isn't the only way to go and is
 very much dependent on the problem at hand. The problem in this case being
 commands being wrapped up into objects with methods when what really should
 happen is the Python API being object-oriented to begin with, or at least
 wrapped up into one. Maybe this is what Red9 or MRV is doing, I'm not sure,
 but for anyone looking for OOP in Maya that would seem the more consistent
 way to go.


 On 7 July 2014 17:41, Geordie Martinez geordiemarti...@gmail.com wrote:

 Getting back to Pymel. I love it. OOP is the way to go. the only way to
 go.
 I just hate that it has mel in the name.

 if and when there is ever a concerted effort by Autodesk to truly OOP
 their Maya python API I will adopt it.
 but in the meantime. Objects with methods makes more sense than flinging
 strings everywhere.

 2 cents.


 On Mon, Jul 7, 2014 at 5:13 AM, Christopher Crouzet 
 christopher.crou...@gmail.com wrote:

 SideFX came up with Houdini Engine which is a similar idea but not as
 complete I guess? Just throwing a prejudice here, not sure what I'm talking
 about.
 Anyways, I disagree when you say those companies would be against it.
 Fabric can act like a glue between them all, potentially bringing more
 customers to some of them, and definitely bringing more power to them all
 with the crazy optimizations Fabric comes with.

 OT: not sure where you got that I'm inundated with work, I've ben
 travelling for over 1 year :D



 On 7 July 2014 00:36, Jeremy YeoKhoo jyeok...@gmail.com wrote:

 Ill try my best to look into FabricEngine, and get back to this Forum!
 Like Christopher, I am currently inundated with work, and Fabric is on my
 lower priority list. Also thanks for the info regarding Julia.

 From my current knowledge of FabricEngine and Maya, current version of
 Maya have a few internal issues with the API that is causing a few bugs to
 prop up. Additionally I wouldnt be surprised that Autodesk, Foundry, SideFX
 and etc are probably against the idea of a middleware platform. So I might
 just wait a bit.



 On Friday, 4 July 2014 12:06:52 UTC+10, Jeremy YeoKhoo wrote:

 Hey guys,

 I want to ask your personal opinion of pyMel. After reading the topic
 on Monkey Patching the Maya API
 http://christophercrouzet.com/blog/post/2014/06/23/From-Monkey-Patching-the-Maya-Python-API-to-Gorilla-and-Bananas
 by Christopher Crouzet and an earlier discussion regarding this topic in
 this forum
 https://groups.google.com/forum/#!topic/python_inside_maya/cLdkFBAgRtI
 , I started thinking back to pyMel and wondered if it might be an
 answer, I feel like kicking myself for disregarding PyMel previously. I
 have just realised how pythonic and how pyMel holds more of a object
 oriented paradigm as opposed to MEL and maya.cmds (even described by
 Autodesk
 http://download.autodesk.com/us/maya/2011help/PyMel/why_pymel.html)


 So I have a few queries, Pymel is now being shipped with Maya, but not
 supported by Autodesk which my have production implications.

 What do you guys think of Pymel?

 -Jeremy


  --
 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/9de94ba1-2607-46d5

Re: [Maya-Python] Getting started with PyMel

2014-06-09 Thread Geordie Martinez
for the most part if you see an argument in maya.cmds as as someArg=1  then
you can try it with someArg=True to see if it works.

try this for your newFile example.
f means don't bother to ask the user if they want to save the file. force
unload it and start fresh.

import pymel.core as pm
f = pm.newFile(f=True)

pymel didn't want to collide with the existing file built-in in python.
maya.cmds.file is wrapped




On Sun, Jun 8, 2014 at 10:26 PM, bradleynew...@gmail.com wrote:

 I'm following the Getting Started with PyMel docs here:
 http://download.autodesk.com/us/maya/2011help/PyMel/tutorial.html#an-intro-to-pymel-objects-in-maya

 My question is how to translate arguments and flags in the documentation
 into PyMel synatx. I'm confused what f=1 means in the following code:

 f=newFile(f=1) #start clean

 The docs for newFile are as follows. Does f=1 correspond to the force
 flag=true? How do you specify the type of file?

 def newFile(*args, **kwargs):
 
 Initialize the scene. Returns untitled scene with default location.

 Flags:
   - force:
   Force an action to take place. (new, open, save, remove
 reference) Used with removeReference to force remove reference
   namespace even if it has contents. Cannot be used with
 removeReference if the reference resides in the root namespace.
   - type:
   Set the type of this file. By default this can be any one of:
 mayaAscii, mayaBinary, mel, OBJ, directory,
   plug-in, audio, move, EPS, Adobe(R) Illustrator(R),
 image plug-ins may define their own types as well.Return
   a string array of file types that match this file.

 Derived from mel command `maya.cmds.file`
 

 pass

 --
 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/b7a28bcd-08e6-4d9e-bbc7-6856f65592d5%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/CABPXW4h-xiLqXsuH_zYrNfr5vbnht-4WEGFMcBHfNWhRDCTAYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Getting started with PyMel

2014-06-09 Thread Geordie Martinez
it's a bit different from maya.cmds
pymel is object-oriented not string-passing-oriented
* however it is actually doing the string passing in most cases under the
hood but you don't have to worry about it.

I like using the see module to view what methods are on pynode objects.
download it and put it in your scripts dir
http://inky.github.com/see/

you make an object and then you see the methods and attributes on the
object.

example:
import pymel.core as pm
from see import see
jnt = pm.joint()

# CHECK OUT ALL THE METHODS YOU CAN DO
see(jnt)

and it will give you a list of methods you can run on a joint. this applies
to all pynodes created or cast by pymel.

pymel wraps maya.cmds under-the-hood so for some methods in pymel you can
pass in the same arguments

like for instance the .inputs() and .outputs() methods are wrapping
maya.cmds listConnections so you can pass the same arguments.

so if you did help(jnt.inputs)

you would see it's wrapping maya.cmds version of listConnections as a
method on the object.

check this out (begin shameless self promotion):
http://www.cgcircuit.com/course/intro-to-pymel-part-1

-- 
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/CABPXW4i_OjAmqB%3DF8RS-2tctPdpOmCCF4%3DQbLJiNEVMPJKCGbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] Re: how to get faces from a selected shadingEngine

2014-05-02 Thread Geordie Martinez
Pretty close and you have the right idea.
but there is an easier way to get the member sets

import pymel.core as pm
# MAKE THE GEOM A PYNODE
geom = pm.PyNode(pSphere1)
# GET THE SHAPE NODE
geomShape = geom.getShape()
# GET A LIST OF SHADING ENGINES INPUTS
shadEngs = geomShape.inputs(type='shadingEngine')
# MEMBERS WILL LIST THE FACES in EACH SHADING GROUPfor sEng in shadEngs:
print(sEng.members() )




On Thu, May 1, 2014 at 3:34 PM, Andres Weber andresmwe...@gmail.com wrote:






 import pymel.core as pm


 def getFaces(shadingGroup):

 pm.hyperShade(objects=shadingGroup)

 faces=[]

 for obj in pm.ls(sl=True):

 faces.extend( pm.polyListComponentConversion(obj, tf=True)
 )

 return faces



 a=getFaces('lambert2SG')
 Not crazy about it (I hate things that are selection based) but it gets
 the job done and it was quick to write.



 On Tuesday, April 29, 2014 3:30:13 AM UTC-4, Chi Ngai Lai wrote:

 May I know how to get faces, which might be from different models, from a
 selected shadingEngine? Could someone help? Thank you very much 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/c6c3561c-599a-4b72-8ce2-ce484fa7e334%40googlegroups.comhttps://groups.google.com/d/msgid/python_inside_maya/c6c3561c-599a-4b72-8ce2-ce484fa7e334%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


Re: [Maya-Python] Re: how to get faces from a selected shadingEngine

2014-05-02 Thread Geordie Martinez
You are welcome!


On Fri, May 2, 2014 at 12:49 AM, Chi Ngai Lai predator@gmail.comwrote:

 Thank you so much for your help! Have a wonderful day!

 --
 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/52ee2cf0-5753-4141-b955-67891ccc910f%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/CABPXW4gkfdqm0AK1mGekwtx1qwM6m6xm6ZaaX9wY0LvmuTTOfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] shiboken.getCppPointer() crashes Maya

2014-03-06 Thread Geordie Martinez
I seem to remember this post by Nathan Horne says you have to modify the
shiboken method to get the right pointer ( to get the equivalent of what
sip would return to you):
http://nathanhorne.com/?p=485


On Thu, Mar 6, 2014 at 5:42 PM, Justin Israel justinisr...@gmail.comwrote:

 I don't have a Maya 2014 handy but I can check again on Monday
 I tested in a shell.
 On Mar 7, 2014 2:12 PM, Daniel Wynne wynne...@gmail.com wrote:

 dang.
 It seems to work in vanilla Maya, so it must be our setup here. Thats too
 bad.
 Thanks,
 (Im on windows 7, maya 2014)

 Danny Wynne
 www.dannywynne.com


 On Thu, Mar 6, 2014 at 11:51 AM, Justin Israel justinisr...@gmail.comwrote:

 I had to correct the syntax to:

 as_ptr = long(shiboken.getCppPointer(orig)[0])

 But it didn't crash for me. This is with the latest brew install of
 PySide on osx



 On Fri, Mar 7, 2014 at 6:45 AM, Danny Wynne wynne...@gmail.com wrote:

 I'm wondering if anyone else has experienced this and has a work
 around? Maybe I need to recompile shiboken?
 thanks,
 example

 import PySide.QtGui as QtGui
 import shiboken
 orig = QtGui.QWidget() #Generic QWidget we want to cast
 as_ptr = long(shiboken.getCppPointer(orig))
 casted = shiboken.wrapInstance(as_ptr, QtGui.QLineEdit)

 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 on the web visit
 https://groups.google.com/d/msgid/python_inside_maya/91a83722-eb6e-4fe3-a1b8-2b05f5ac78c2%40googlegroups.comhttps://groups.google.com/d/msgid/python_inside_maya/91a83722-eb6e-4fe3-a1b8-2b05f5ac78c2%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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/xq-q3EybUIg/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/CAPGFgA0%3DbwLUBYcS4c24ndMf387Tt2G4Fao%2BG-AmzX5TFQ%2B-Vw%40mail.gmail.comhttps://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0%3DbwLUBYcS4c24ndMf387Tt2G4Fao%2BG-AmzX5TFQ%2B-Vw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/python_inside_maya/CAO1VJHiJAkk_hXAJ3HC5gUmm2KB-0Gy8QG%3DfLh2JmJzNmki0JA%40mail.gmail.comhttps://groups.google.com/d/msgid/python_inside_maya/CAO1VJHiJAkk_hXAJ3HC5gUmm2KB-0Gy8QG%3DfLh2JmJzNmki0JA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 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/CAPGFgA2wKg-tMPQ9c4FHib-1Gg-prU%3DKguMjqrVit-iSLA3i%2BQ%40mail.gmail.comhttps://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2wKg-tMPQ9c4FHib-1Gg-prU%3DKguMjqrVit-iSLA3i%2BQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 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/CABPXW4jrCLHP14zxgwS%3DLxTcj4S_%2BT5NU2yA%3D3p2wYy1RqHbYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Maya-Python] pymel duplicate shape

2014-02-06 Thread Geordie Martinez
try this. you were passing a list which is what getChildren gives you.
in this case you're getting the shape node (not a list). Hope this helps!


import pymel.core as pm
node = pm.circle()[0]
curves = node.getShape()
newCurves = pm.duplicate(curves, addShape=True)



On Thu, Feb 6, 2014 at 10:45 AM, Mikkel Caiafa 
mcai...@bossfightentertainment.com wrote:

  Hello all,



 I noticed this in the pymel docs for the duplicate command:



 Modifications:

 · new option: addShape

 If addShape evaluates to True, then all arguments fed in must be shapes,
 and each will be duplicated and added under the existing parent transform,
 instead of duplicating the parent transform. The following arguments are
 incompatible with addShape, and will raise a ValueError if enabled along
 with addShape:

 renameChildren (rc), instanceLeaf (ilf), parentOnly (po), smartTransform
 (st)



 Decided to try it out but I'm getting an error.  Any ideas what I'm doing
 wrong?



 node = pm.circle()[0]

 curves = node.getChildren(type='nurbsCurve')

 newCurves = pm.duplicate(curves, addShape=True)



 # Error: Maya Attribute does not exist:
 u[nt.NurbsCurve(u'nurbsCircleShape1')]

 # Traceback (most recent call last):

 #   File maya console, line 1, in module

 #   File C:\Program
 Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\general.py,
 line 1265, in duplicate

 # for origShape in [PyNode(x) for x in args]:

 #   File C:\Program
 Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\general.py,
 line 1787, in __new__

 # raise _objectError( name )

 # MayaAttributeError: Maya Attribute does not exist:
 u[nt.NurbsCurve(u'nurbsCircleShape1')] #





 Thanks!

 -Mikkel.

 --
 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/bc286db7ae354cf2a6cfa4c54f7840ac%40CO1PR05MB362.namprd05.prod.outlook.com
 .
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CABPXW4gux__rAnGa3VwxDn3h4_aST31v9%3DS6e5JPVwC%2BRmB2AA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Maya-Python] Get the list of all dependency nodes from a single node

2013-06-18 Thread Geordie Martinez
using pymel you can get all the outputs using .outputs() with the arg
type you can narrow it to

import pymel.core as pm

con = pm.PyNode(CON_NAME)


# paired groups of what the con connects to

connectList = con.outputs(plugs=True, connections=True)


# disconnect them

[src.disconnect() for src,dest in connectList]


# MOVER YOUR CON TO WHEREEVER or do your thing.


# TRY AND RECONNECT

for src,dest in connectList:

try:

src.connect(dest,f=True)

except:

print(NOPE: %s - %s  % (src,dest))







On Tue, Jun 18, 2013 at 2:21 AM, Narann fevrier.dor...@yahoo.fr wrote:

 Yes but I was wondering if there already was a command to do this. :(

 This is what I've actually done:
 - Get every children nodes
 - for each child Get connections and traverse the graph blocking some
 unwanted node types.
 - Store everything.

 But it's a ugly code. :(

 Le lundi 17 juin 2013 19:56:36 UTC+2, Ravi Jagannadhan a écrit :
  Can't you just traverse the connections from that node?
 
 
 
 
  On Mon, Jun 17, 2013 at 2:17 AM, Narann fevrier...@yahoo.fr wrote:
 
 
  Hi all! :)
 
 
 
  I desperate with this and I'm sure some of you have already encounter
 this:
 
 
 
  I have a complex character rigg and I know a specific controller has
 been moved. From this node, I want to get every nodes that will be affected
 by this move. :(
 
 
 
  When you select this node, some Maya shapes became mallow. Actually, I
 want to get all this shapes.
 
 
 
  Any advise is welcome!
 
 
 
  Regards,
 
 
 
  Dorian
 
 
 
  --
 
  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 post to this group, send email to python_in...@googlegroups.com.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
  --
  Where we have strong emotions, we're liable to fool ourselves - Carl
 Sagan

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Get the list of all dependency nodes from a single node

2013-06-18 Thread Geordie Martinez
#* stupid indenting mistake on cut and paste
#this should be the last part;

for src,dest in connectList:

 try:

 src.connect(dest,f=True)

 except:

 print(NOPE: %s - %s  % (src,dest))



On Tue, Jun 18, 2013 at 10:44 AM, Geordie Martinez 
geordiemarti...@gmail.com wrote:

 using pymel you can get all the outputs using .outputs() with the arg
 type you can narrow it to

 import pymel.core as pm

 con = pm.PyNode(CON_NAME)


 # paired groups of what the con connects to

 connectList = con.outputs(plugs=True, connections=True)


 # disconnect them

 [src.disconnect() for src,dest in connectList]


 # MOVER YOUR CON TO WHEREEVER or do your thing.


 # TRY AND RECONNECT

 for src,dest in connectList:

 try:

 src.connect(dest,f=True)

 except:

 print(NOPE: %s - %s  % (src,dest))







 On Tue, Jun 18, 2013 at 2:21 AM, Narann fevrier.dor...@yahoo.fr wrote:

 Yes but I was wondering if there already was a command to do this. :(

 This is what I've actually done:
 - Get every children nodes
 - for each child Get connections and traverse the graph blocking some
 unwanted node types.
 - Store everything.

 But it's a ugly code. :(

 Le lundi 17 juin 2013 19:56:36 UTC+2, Ravi Jagannadhan a écrit :
  Can't you just traverse the connections from that node?
 
 
 
 
  On Mon, Jun 17, 2013 at 2:17 AM, Narann fevrier...@yahoo.fr wrote:
 
 
  Hi all! :)
 
 
 
  I desperate with this and I'm sure some of you have already encounter
 this:
 
 
 
  I have a complex character rigg and I know a specific controller has
 been moved. From this node, I want to get every nodes that will be affected
 by this move. :(
 
 
 
  When you select this node, some Maya shapes became mallow. Actually,
 I want to get all this shapes.
 
 
 
  Any advise is welcome!
 
 
 
  Regards,
 
 
 
  Dorian
 
 
 
  --
 
  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 post to this group, send email to python_in...@googlegroups.com.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
  --
  Where we have strong emotions, we're liable to fool ourselves - Carl
 Sagan

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Re: Getting submeshes of a polyMesh

2013-06-13 Thread Geordie Martinez
Quick pymel addendum:

yeah. it's better to just
import pymel.core as pm

then do

pm.ls

PyMEL has some convenience pointers so you don't have to do the full module
path.
you should be able to just do
pm.WHATEVER
and it will be available

the exception is datatypes. but you can just use dt for that (built in)

pm.dt.Vector
pm.dt.Matrix
etc.



On Thu, Jun 13, 2013 at 2:34 PM, Jesse Capper jesse.cap...@gmail.comwrote:

 Get the submeshes as what? Objects? As stated, maya (and pymel) doesn't
 treat different poly shells as different objects.

 If you want to get the faces that comprise each shell (subobject) of an
 object, Justin Israel's script shows a simple way of doing so:
 https://gist.github.com/justinfx/3738519

 Also, when you import pymel.core, all the subpackages of pymel.core get
 imported into the pymel.core namespace. That means that you can use
 pymel.core.ls instead of having to specify pymel.core.general.ls. This
 also includes the mel object. pymel.core.mel is valid.

 On Wednesday, June 12, 2013 3:25:47 PM UTC-7, Christian Akesson wrote:
  Does anyone know how to get the submeshes of a polygon mesh.
  Combine two spheres into a single mesh and each sphere will be a submesh.
 
 
  I've been searching the docs and Google, but have not been able to find
 anything.
 
  Anyone know if PyMel has anything for this anywhere?
 
 
  Thanks,
  /Christian

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Maya-Python] Intro to PyMEL training video

2013-06-12 Thread Geordie Martinez
Hey all,

This is the place where people come to ask questions about PyMEL so I figured 
it would be a good place to post this as a resource (and shamelessly 
self-promote) for those wishing to learn PyMEL:

http://www.cgcircuit.com/lessondetailcomplete.php?val=1283

I just published an Intro to PyMEL training video for those interested in 
Object-Oriented scripting in Maya. I'd love to hear your feedback!





-- 
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 post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Getting submeshes of a polyMesh

2013-06-12 Thread Geordie Martinez
Pymel will help you for sure.
if you have the transform you can use getShape() and it will return a list
of shape nodes underneath.

import pymel.core as pm

theTransform = pm.PyNode(nameOfYourObject)
shapes = theTransform.getChildren()

[nt.Mesh(u'pSphereShape1'), nt.Mesh(u'pSphereShape2')]

you can limit it to polygon shapenodes too with the type=mesh kwarg.

shapes = theTransform.getChildren(type=mesh)





On Wed, Jun 12, 2013 at 3:25 PM, Christian Akesson
cakes...@dslextreme.comwrote:

 Does anyone know how to get the submeshes of a polygon mesh.
 Combine two spheres into a single mesh and each sphere will be a submesh.

 I've been searching the docs and Google, but have not been able to find
 anything.
 Anyone know if PyMel has anything for this anywhere?

 Thanks,
 /Christian

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Getting submeshes of a polyMesh

2013-06-12 Thread Geordie Martinez
sorry getShape() will only get the first shape. use getChildren()


On Wed, Jun 12, 2013 at 3:49 PM, Geordie Martinez geordiemarti...@gmail.com
 wrote:

 Pymel will help you for sure.
 if you have the transform you can use getShape() and it will return a list
 of shape nodes underneath.

 import pymel.core as pm

 theTransform = pm.PyNode(nameOfYourObject)
 shapes = theTransform.getChildren()

 [nt.Mesh(u'pSphereShape1'), nt.Mesh(u'pSphereShape2')]

 you can limit it to polygon shapenodes too with the type=mesh kwarg.

 shapes = theTransform.getChildren(type=mesh)





 On Wed, Jun 12, 2013 at 3:25 PM, Christian Akesson 
 cakes...@dslextreme.com wrote:

 Does anyone know how to get the submeshes of a polygon mesh.
 Combine two spheres into a single mesh and each sphere will be a submesh.

 I've been searching the docs and Google, but have not been able to find
 anything.
 Anyone know if PyMel has anything for this anywhere?

 Thanks,
 /Christian

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Maya-Python] pymel crashing maya.standalone

2013-05-21 Thread Geordie Martinez
hey all,

pymel is crashing when used in maya.standalone.  it does all of the work, but 
when you're done and want to exit the maya.standalone session. 

all you have to do to see it in action is this in a shell:

# CRASHES THE PYTHON SESSION
python2_maya
import maya.standalone
maya.standalone.initialize()
import pymel.core as pm
quit()


# DOES NOT CRASH THE PYTHON SESSION
python2_maya
import maya.standalone
maya.standalone.initialize()
quit()

Paul or Chad, do you guys have any ideas how we can fix 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 post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Maya-Python] Re: pymel crashing maya.standalone

2013-05-21 Thread Geordie Martinez
Another strange  behaviour is it generates a new file, trashing the previous 
file if you don't put a pm.saveAs(...), destroying the working file right 
before the seg fault.  

-- 
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 post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] modo to maya abc - same name for shape and xform

2013-05-16 Thread Geordie Martinez
this will get all the shape nodes of the type mesh (is that the type from
modo you're bringing in?) or is it subD? anyway... you can change that part
but this should do the trick.

import pymel.core as pm
shapes = pm.ls(type=mesh)
for shape in shapes:
parTrans = shape.getParent()
if parTrans.nodeName() == shape.nodeName():
pm.rename(shape,%sShape %shape)


On Mon, May 13, 2013 at 1:45 AM, CharlieWales charliewa...@gmail.comwrote:

 Use the 'f' (full path) flag when querying the shape node with the
 listRelatives command. It will spit back a unique node name with its full
 DAG path, which you can use in the rename command.
 El 13/05/2013 02:43, Aleks Jones bergjo...@gmail.com escribió:

 Hi. I have a situation where I have a large number of objects coming from
 modo after being modelled. Alembic is the best way to transfer everything
 by far, however the shape node and the transform node come in with the same
 name. This causes problems in other scripts. Ive tried to use this to
 rename the shape node, but because the transform has the same name, it wont
 work. Is there a quick fix for this?


 #RENAME THE SHAPE NODE TO BE UNIQUE
 for i in cmds.ls(sl=1):
 cmds.select(cl=1)
 cmds.select(i)
 get_shape = cmds.listRelatives(i, shapes=1)[0]

 get_shape_fixed = get_shape + '_shape'

 cmds.rename(get_shape, get_shape_fixed)

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
 To post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Extracting information from a Massive Simulation File (asf file)

2013-05-06 Thread Geordie Martinez
Bay,
you can just export maya skeletons from massive (Prime). so you can pin a
skeleton to a skeleton.
in the Sim Export dialog you can pick maya instead of apf.
this will make your task much easier.



On Mon, May 6, 2013 at 11:13 AM, Bay gannboonb...@gmail.com wrote:

 Hi Justin,
   thanks for the reply. I've taken a look at the script examples
 you've typed up. The problem is that the naming convention for all the
 joints in the simulation have the same name for example so I have to use
 the BEGIN Ultralisk as a marker to identify that the next b_Waist_JNT is
 the root joint of that particular agent.

 BEGIN Zergling_1
 b_Waist_JNT 1625.036499 72.764275 -624.906616 0 2.574 0

 BEGIN Ultralisk_68
 b_Waist_JNT -80.944084 22.512356 -150.658325 -2.806 100.024 -2.850

 BEGIN Ultralisk_69
 b_Waist_JNT 451.513000 -49.609299 -54.891254 -2.747 100.236 -2.791

 While the logical thing is just to read the next line since that's how the
 information is arranged, I eventually want to specify a particular joint
 that I want to use as a marker. That's why I'm trying to see how I could
 get Python to use the BEGIN as a start point and a end point.

 I hope I'm making sense here or I simply just didn't understand the
 example you gave me.



 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Optimizing my PyMEL code

2013-05-06 Thread Geordie Martinez
in pymel, each pynode has a method called .nodeType() that you can query.
.type() is no longer used to determine the node type because of clashes
with

if you get selected objects with pymel it will automatically pynode all of
your objects:
pm.selected() returns a list of pynode

types = [node.nodeType() for node in pm.selected()]


this might simplify your code a bit I hope.



On Mon, May 6, 2013 at 8:50 AM, Day Dreamer day.dreamer.m...@gmail.comwrote:

 Edit :-

 i mport pymel.core as pm

 def get_all_nodes(all_nodes, node_type):
 return [ node for node in all_nodes if
 pm.nodeType(node)==node_type]

 As, pymel is highly object oriented we can modify our function to

 def get_all_nodes(all_nodes, pymel_node_type):
 return[ node for node in all_nodes if isinstance(pm.PyNode(node),
 pymel_node_type)]

 Here, pymel_node_type is a pymel class and we checking our node is a
 instance of that particular class, if positive append the node to the list
 of desired nodes and finally return the formerd list.

 On Monday, May 6, 2013, Day Dreamer wrote:

  import maya.cmds as cmds

 Def objs_of_type(all_nodes, node_type):
 Return [node for node in all_nodes if cmds.nodeType(node==node_type)]

 I used list comprehension.

 On Monday, May 6, 2013, Simen Chris wrote:

 Hey guys, I'm working on creating generic functions that are flexible
 and can be called from my other scripts. However, I feel like I use a lot
 more code that necessary, I have 12 if-conditions just in this little
 script that I've attached.

 The attached script is a function that reads all the objects I define as
 inputs, then checks if they match the specified objectType, and then
 returns the objects that match the objectType specified.

 I was hoping someone could take a quick look and see if things could be
 done in a better way :)

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
 To post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Extracting information from a Massive Simulation File (asf file)

2013-05-06 Thread Geordie Martinez
Bay, you're welcome. any massive questions you can come to me too!


On Mon, May 6, 2013 at 5:31 PM, Bay gannboonb...@gmail.com wrote:

 Thank you again for taking the time and effort to help me out Justin but
 Geordie pointed out how I could get what I wanted via Massive instead,
 rather than through Python. Thanks again!

 On Monday, May 6, 2013 1:17:29 PM UTC-7, Justin Israel wrote:
  I'm not sure I understand the problem with the examples I gave, in
 achieving what you want.
 
  If you are concerned with being able to retrieve the 'b_Waist_JNT'
 attribute, and that it could appear at any point within each agent block,
 why not just parse the file, and get the attribute you want for each agent?
 
 
 
  agents = parse_apf(frame.1.apf)
 
 
 
  for agent, attrs in agents.iteritems():
 
  print agent, attrs['b_Waist_JNT']
 
 
 
  Zergling_64 [-1987.39563, -0.160679, -336.820892, 0.0, -2.651, 0.0]
 
  Zergling_39 [-581.739136, 79.09861, -315.018768, 0.0, 1.405, 0.0]
 
  Zergling_38 [-631.878357, 49.06324, -539.750732, 0.0, 1.584, 0.0]
 
  ...
 
 
 
 
 
 
 
  On May 7, 2013, at 6:13 AM, Bay wrote:
 
 
 
   b_Waist_JNT

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Re: Getting this error

2013-04-25 Thread Geordie Martinez
the error you're getting is telling you that root_LOC is a list of strings.
the move command wants what's  IN the list. Not the list itself. Just the
first item in the list.
what the spaceLocator command is returning is a list of strings

[u'root_LOC'] # -- see how this is a list

root_JNT # and this isn't

[u'root_CTL', u'makeNurbCircle1'] # - the circle keeps its construction
history as the second in the list so there are two items.


you can fix it quick by adding [0] to the end of your command like this:
root_LOC=cmds.spaceLocator (n = 'root_LOC', r = 2)[0]

and to the root_CTL command like this:
root_CTL=cmds.circle(n = 'root_CTL', r = 2)[0]

this lets you index into the the first item in the list that the
spaceLocator (or any) command returns.
you'll still need to DE SELECT the locator first before making the joint or
the joint will end up inside the locator.

BUT...
another way is to use pymel which is a whole lot simpler (in my opinion):


import pymel.core as pm
def blah():
 put your notes here.  inside TRIPLE quotes you can put anything!!


# CREATE A SPACE LOCATOR
root_LOC=pm.spaceLocator(n='root_LOC')

# MOVE IT IN SPACE TO SOME LOCATION
root_LOC.setTranslation((0, 18.485, -2.815))
print(root_LOC)

# DESELECT IT OR THE JOINT WILL BE A CHILD OF THE LOCATOR
pm.select(d=True)

# MAKE THE JOINT
root_JNT=pm.joint(n='root_JNT')

# MOVE IT TO THE SAME POSITION AS THE root_LOC by getting the
root_LOC's translation
root_JNT.setTranslation(   root_LOC.getTranslation()   )
print(root_JNT)

# MAKE A NURBS CURVE
root_CTL=pm.circle(n='root_CTL')[0]

# MOVE THAT NURBS CURVE TO THE SAME SPOT AS THE JOINT
root_CTL.setTranslation(   root_JNT.getTranslation()   )
print(root_CTL)

blah()

Hope this was helpful. It's worth the struggle to learn python!



On Wed, Apr 24, 2013 at 10:01 PM, DayDreamer day.dreamer.m...@gmail.comwrote:

 Edit:-
 The Move command should be
 cmds.move (0, 18.485, -2.815, root_LOC[0], relative=True)

 --
 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 post to this group, send email to python_inside_maya@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_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 python_inside_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Maya-Python] Noob question

2012-08-30 Thread Geordie Martinez
I was a bit confused about what you wanted to do. to get all meshes or just
the top level meshes.
here is some pymel examples you can sift through pretty easily in a single
line for either

import pymel.core as pm

# GET ALL MESHES IN A SCENE

allMeshes = [x.getParent() for x in pm.ls(type=mesh)]


# GET ONLY TOP LEVEL MESHES

topMostMeshes = [top for top in   [x.getParent() for x in
pm.ls(type=mesh)
]  if not top.getParent()]

hope this helps


On Thu, Aug 30, 2012 at 2:33 PM, Justin Israel justinisr...@gmail.comwrote:

 Do you mean you just want to get the parent of each item from your ls
 command?
 You can pass the geometry results from the ls - listRelatives

 cmds.listRelatives(cmds.ls(geometry=True, l=True), parent=True, f=True)

 That should return the parent of each item from the ls command.



 On Thu, Aug 30, 2012 at 2:13 PM, GWinters glenn.j.wint...@gmail.com
 wrote:
  Hi everyone!
  Im starting to write scripts in python within maya and Im running into an
  issue. Im trying to get the list to select the top dependency node of all
  geometry in the scene.  I get this list by having the list focus on the
  transforms but that is also pulling in transforms in on the cameras and
  lights.  I want it to run execute similarly to selecting geometry in
  outliner and duplicating it.  As of right now I have a list of all the
  geometry
 
  allMeshes2 = cmds.ls(geometry=True)
 
  Then in the for loop I have a pickWalk before duplicating it.
  cmds.pickWalk(direction= up)
 
  Is there anyway to just have the ls select that object from the outliner?
  Thanks!
 
  Glenn
 
  --
  view archives: http://groups.google.com/group/python_inside_maya
  change your subscription settings:
  http://groups.google.com/group/python_inside_maya/subscribe

 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] python noob question - can I define a procedure and call it?

2012-08-08 Thread Geordie Martinez
Here is a pymel version of what you're trying to do. Maybe this can help
you.

import pymel.core as pm
def renameChain(items=None):
renames a joint chain based on asterisk as a wildCard 
items = items or pm.selected()
name = promptForName()
if not name:
return

num = 1
for item in items:
newName = name.replace(*,%s%num)
pm.rename(item, newName)
num += 1

On Tue, Aug 7, 2012 at 3:48 PM, j00ey timbac...@gmail.com wrote:

 Hi

 I'm learning some python, coming from a MEL background [though I'm no
 expert in that either] and I'm trying to write a simple script to rename a
 number of objects according to a user input name. I've got it to work but I
 want it to test if there is no user input and if not [and the user didn't
 press the cancel button] loop back and re-prompt for input.

 I was thinking something along the lines of this :
 1 - declare a procedure to do the renaming
 2 - prompt dialog
 3 - if the input is valid run the procedure, if not pop up a message and
 ask whether to retry or cancel
 4 - if retry, run the procedure again

 but I came unstuck and I can't find anything to do with declaring a
 procedure in pymel. Can anyone help? Here's what I've written so far.
 Thanks in advance


 ##

 #get selection

 sel=ls(sl=1)

 #get user input
 input = promptDialog(t='New
 Name',b=['OK','Cancel'],db='OK',cb='Cancel',ds='no input')

 #set base number to 1

 x=1

 #test user input and if not empty string, rename selected objects

 if input=='OK':
 name=promptDialog(q=1, t=1)
  if len(name) != 0:
 for s in sel:
 s.rename(name + str(x))
 x+=1
 else:
 #if user has not input a valid string prompt to retry
 message = confirmDialog(message ='Please enter a
 name',b=['Retry','Cancel'],db='Retry',cb='Cancel',ds='Cancel')


 ##

  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] pymel matrix / vector multiplication

2012-07-31 Thread Geordie Martinez
Try this:
import pymel.core as pm

sphere = pm.PyNode(pSphere1)

sphereM = sphere.worldMatrix.get()

sphereInvM = sphereM.inverse()

sphere.setMatrix(sphereInvM * sphereM)


On Tue, Jul 31, 2012 at 5:31 PM, meeotch meeo...@gmail.com wrote:

 Hopefully someone can tell me how I'm screwing this up...

 1)  create a sphere, translate it away from the origin
 2)  m = PyNode(pSphere1).worldMatrix.get()
 3)  v = PyNode(pSphere1).translate.get()

 So far, so good - m looks like a reasonable matrix, v is the position of
 the sphere.  So now:

 4) m.inverse() * v  (or maybe the other way around)

 Shouldn't that give (0,0,0) ?  I.e., transforming the position back to the
 origin.  Or is matrix*vector multiplication not implemented?

 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


[Maya-Python] pymel casting a motion path node does not allow access to parametric Length attr...

2012-07-09 Thread Geordie Martinez
Hey all.

if you cast a motion path node as a pynode and attempt to access the
attribute for parametric length... it doesn't exist.

to be clear. toggling the attribute: Use Parametric Length doesn't
seem to be available in the pynode object.

any ideas how I could access that attribute? I'm stumped right now.

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] pymel casting a motion path node does not allow access to parametric Length attr...

2012-07-09 Thread Geordie Martinez
Got it. setting it at creation time with :

fractionMode=False




On Mon, Jul 9, 2012 at 12:43 PM, Geordie Martinez geordiemarti...@gmail.com
 wrote:

 Hey all.

 if you cast a motion path node as a pynode and attempt to access the
 attribute for parametric length... it doesn't exist.

 to be clear. toggling the attribute: Use Parametric Length doesn't
 seem to be available in the pynode object.

 any ideas how I could access that attribute? I'm stumped right now.

 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


[Maya-Python] floatSliderGrp HOW do I add a listener to the slider so as it moves you get updates?

2012-04-12 Thread Geordie Martinez
I have a floatSliderGrp that I need to spit back interactive updates
to the slider.
is there a callback or command that can watch the slider handle?

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] PyMEL tools.loggingControl

2011-12-08 Thread Geordie Martinez
if you get the latest from the gitHub it fixes the issue.

On Thu, Dec 8, 2011 at 4:38 PM, Count Zer0 count@gmail.com wrote:

 Looks like this may be broken again in 2012, or possible an OSX issue.
 I get this when I open the menu:

 
 # Error: CallbackError: file /Applications/Autodesk/maya2012/Maya.app/
 Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/
 site-packages/pymel/internal/factories.py line 744: Error executing
 callback bound method LoggingMenu.refresh of
 ui.LoggingMenu('MayaWindow|pymelLoggingControl') - refresh - module
 pymel.tools.loggingControl - /Applications/Autodesk/maya2012/Maya.app/
 Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/
 site-packages/pymel/tools/loggingControl.py, line 113

 Original message:
 Traceback (most recent call last):
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 internal/factories.py, line 742, in callback
res = origCallback( *newargs )
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 tools/loggingControl.py, line 121, in refresh
self.refreshLoggingMenu()
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 tools/loggingControl.py, line 35, in refreshLoggingMenu
self.buildSubMenu(self, logging.root)
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 tools/loggingControl.py, line 65, in buildSubMenu
pymel.menuItem(l=Remove, p=parent, ob=True,
 c=pymel.Callback(logger.removeHandler, item))
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 internal/factories.py, line 764, in newUiFunc
return beforeUiFunc(*args, **kwargs)
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 internal/factories.py, line 878, in newFuncWithReturnFunc
res = beforeReturnFunc(*args, **kwargs)
  File /Applications/Autodesk/maya2012/Maya.app/Contents/Frameworks/
 Python.framework/Versions/Current/lib/python2.6/site-packages/pymel/
 internal/pmcmds.py, line 134, in wrappedCmd
res = new_cmd(*new_args, **new_kwargs)
 RuntimeError: Option box items must be inserted after valid menu
 items. #
 

 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] Book

2011-10-12 Thread Geordie Martinez
your link to amazon to  Buy the Book at maya-python.com isn't working.

On Wed, Oct 12, 2011 at 1:14 PM, Ehsan Kiani ehsankiani.t...@gmail.comwrote:

 thanks !


 On Wed, Oct 12, 2011 at 11:42 PM, Ricardo Viana cgolhei...@gmail.comwrote:

 Thank you very much
 For this book just bought the kindle version. This time im really gonna
 learnt it.

 Cheers
 Ricardo Viana

 On Oct 12, 2011, at 8:05 PM, Farsheed Ashouri farsheed.asho...@gmail.com
 wrote:

 Very good.

 On Wednesday, October 12, 2011, Sahak Sahakian wrote:

 On Wednesday, October 12, 2011 6:43:08 PM, Adam Mechtley wrote:

 Hey folks,

 For those interested, Ryan and I finally wrapped up our book and (not
 that anyone is keeping me in the loop on release dates) it's available on
 Kindle now, hardcover later this week 
 http://www.amazon.com/Maya-Python-Games-Film-Reference/dp/0123785782/ref=sr_1_1?ie=UTF8qid=1318437212sr=8-1
 http://www.amazon.com/Maya-**Python-Games-Film-Reference/**
 dp/0123785782/ref=sr_1_1?ie=**UTF8qid=1318437212sr=8-1. Many thanks
 to Seth Gibson and Kristine Middlemiss for contributing chapters, and to
 Dean Edmonds for technical editing assistance. If you're curious, you can
 also check out the companion web site at http://www.maya-python.com/
 http://www.maya-python.com/

 I mostly wanted to post here to ask that, if anyone on this list happens
 to pick up a copy, please do get in touch with me regarding any errors you
 find! It turns out writing a book is really hard, so I'm sure there were
 plenty of things that made it in under the radar in the final crunch ;) I
 just want to make sure we have an opportunity to fix as many issues as
 possible for the second printing. Thanks!

 --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/**group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/**group/python_inside_maya/**subscribe


 Hi Adam.

 I am expecting it in mail soon and will let you know of typos/errors...

 cheers

 --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/**group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/**group/python_inside_maya/**subscribe



 --
 Sincerely,
 Farsheed Ashouri,
 ourway.ir
 Tel: +98 9388801504

  --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/group/python_inside_maya/subscribe

  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe




 --
 
 Ehsan Kiani
 Character TD
 http://vimeo.com/user2219426
 Mobile: +98 918 936 9006
 [GMT: +3:30 hrs]
 Iran
 

  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] Book

2011-10-12 Thread Geordie Martinez
yeah. it's working now. It might have been the amazon site.

On Wed, Oct 12, 2011 at 1:41 PM, Richard Kazuo richard...@gmail.com wrote:

 Here it's workin' just fine.


 On Wed, Oct 12, 2011 at 5:33 PM, Geordie Martinez 
 geordiemarti...@gmail.com wrote:

 your link to amazon to  Buy the Book at maya-python.com isn't working.


 On Wed, Oct 12, 2011 at 1:14 PM, Ehsan Kiani 
 ehsankiani.t...@gmail.comwrote:

 thanks !


 On Wed, Oct 12, 2011 at 11:42 PM, Ricardo Viana cgolhei...@gmail.comwrote:

 Thank you very much
 For this book just bought the kindle version. This time im really gonna
 learnt it.

 Cheers
 Ricardo Viana

 On Oct 12, 2011, at 8:05 PM, Farsheed Ashouri 
 farsheed.asho...@gmail.com wrote:

 Very good.

 On Wednesday, October 12, 2011, Sahak Sahakian wrote:

 On Wednesday, October 12, 2011 6:43:08 PM, Adam Mechtley wrote:

 Hey folks,

 For those interested, Ryan and I finally wrapped up our book and (not
 that anyone is keeping me in the loop on release dates) it's available on
 Kindle now, hardcover later this week 
 http://www.amazon.com/Maya-Python-Games-Film-Reference/dp/0123785782/ref=sr_1_1?ie=UTF8qid=1318437212sr=8-1
 http://www.amazon.com/Maya-**Python-Games-Film-Reference/**
 dp/0123785782/ref=sr_1_1?ie=**UTF8qid=1318437212sr=8-1. Many
 thanks to Seth Gibson and Kristine Middlemiss for contributing chapters, 
 and
 to Dean Edmonds for technical editing assistance. If you're curious, you 
 can
 also check out the companion web site at
 http://www.maya-python.com/http://www.maya-python.com/

 I mostly wanted to post here to ask that, if anyone on this list
 happens to pick up a copy, please do get in touch with me regarding any
 errors you find! It turns out writing a book is really hard, so I'm sure
 there were plenty of things that made it in under the radar in the final
 crunch ;) I just want to make sure we have an opportunity to fix as many
 issues as possible for the second printing. Thanks!

 --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/**group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/**group/python_inside_maya/**subscribe


 Hi Adam.

 I am expecting it in mail soon and will let you know of typos/errors...

 cheers

 --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/**group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/**group/python_inside_maya/**subscribe



 --
 Sincerely,
 Farsheed Ashouri,
 ourway.ir
 Tel: +98 9388801504

  --
 view archives: http://groups.google.com/group/python_inside_maya
 http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 http://groups.google.com/group/python_inside_maya/subscribe

  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe




 --
 
 Ehsan Kiani
 Character TD
 http://vimeo.com/user2219426
 Mobile: +98 918 936 9006
 [GMT: +3:30 hrs]
 Iran
 

  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


  --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe


-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


[Maya-Python] virtual class not calling _preCreateVirtual function... why?

2011-06-22 Thread Geordie Martinez
Here is a simple example.
_preCreateVirtual is not being called in this virtual class. I can't
figure out why. Any insight?

---CODE
import pymel.all as pm
class blahNode( pm.Transform):

@classmethod
def _preCreateVirtual(cls,  **kwargs ):
print ' _preCreateVirtual '
return kwargs

@classmethod
def _isVirtual( cls, obj, name ):
PyMEL code should not be used inside the callback, only API
and maya.cmds. 
print '_isVirtual '


pm.factories.registerVirtualClass( blahNode,nameRequired=False)

loc = pm.spaceLocator()



-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


Re: [Maya-Python] Re: Creating a transform with multiple shared parents

2011-04-29 Thread Geordie Martinez
Have you tried applying the space switching to the original rig before it gets 
referenced? Then when it is in the shot it can pass its long name to your 
script.

On Apr 29, 2011, at 4:58 AM, stephenkmann stephenkm...@gmail.com wrote:

 except that you don't have to use name spaces to reference...
 
 They did do some updates that speed up some things with referencing
 using name spacing but in the end its pretty much the same.
 -s
 
 On 4/29/11, Judah Baron judah.ba...@gmail.com wrote:
 It sounds like your scripts need to be addressed, in that case.
 Referencing isn't just common practice at your school, it's also a
 ubiquitous and necessary practice in the industry. Working with
 namespaces is just one of the hazards of this work.
 
 -Judah
 
 On Apr 28, 2011, at 3:41 PM, notanymike notanym...@gmail.com wrote:
 
 Well parent constraints would work but I'd need to know how to get
 past namespace issues to get it working properly. What I need is a
 node for setting up space-switching without jumping for a character's
 already broken hierarchy that eliminates the need for mel scripts to
 do the same job since they easily break once the rig that script is
 intended for has all it's node name strings changed when the rig is
 referenced (a common practice at my school).
 
 On Apr 26, 12:43 pm, Animatix mbergl...@gmail.com wrote:
 It sounds like he is talking about a parent constraint with mulitple
 offsets firing at a particular frame, do that sound right?
 
 On Apr 26, 9:54 am, Shawn Patapoff spatap...@bluecastlegames.com
 wrote:
 
 
 
 
 
 
 
 Doesn't a parent constraint do all this all ready for you?
 
 On Sun, Apr 24, 2011 at 6:14 PM, notanymike notanym...@gmail.com
 wrote:
 Hi, I'm trying to come with some sort of transform node that can have
 multiple transform matrices influencing it's own translate,rotate,and
 scale attributes, but still allows for control, animation, and
 preservation of the user-intended position of that transform.
 Basically it's a space-switching/dynamic parenting transform.I have
 two ideas for what attributes to create on the transform: Either have
 a compound message attributes or compound matrix attributes that the
 user can add or delete, with an enable and/or weight attribute for
 each added parent. The only two parts I'm stuck on is how to write out
 when the enable and/or weight attribute is changed, recompute the
 transforms position in python, and how to re-compute the transform's
 final position after parents have been added/removed from the compound
 attribute. Does anyone have time to help me on this? I'm brand new to
 python, but I'm starting to understand the syntax. It's structure I
 have to learn somehow...
 
 --
 http://groups.google.com/group/python_inside_maya
 
 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 
 --
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings:
 http://groups.google.com/group/python_inside_maya/subscribe
 
 
 -- 
 Sent from my mobile device
 
 -- 
 view archives: http://groups.google.com/group/python_inside_maya
 change your subscription settings: 
 http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe


[Maya-Python] pymel cluster node method to get associated clusterHandle?

2011-04-19 Thread Geordie Martinez
Hey,

In pymel is there a quick way (method) to get the clusterHandle for a
cluster Node? and vice versa?

I looked for a method like getClusterHandle or getHandle. Is there
a link via the message attr?

Rather than traverse the inputs and outputs looking for it and
sifting, I thought i'd ask here.



-- 
http://groups.google.com/group/python_inside_maya


Re: [Maya-Python] pymel cluster node method to get associated clusterHandle?

2011-04-19 Thread Geordie Martinez
Nevermind found it.

getWeightedNode()

On Tue, Apr 19, 2011 at 10:09 AM, Geordie Martinez 
geordiemarti...@gmail.com wrote:

 Hey,

 In pymel is there a quick way (method) to get the clusterHandle for a
 cluster Node? and vice versa?

 I looked for a method like getClusterHandle or getHandle. Is there
 a link via the message attr?

 Rather than traverse the inputs and outputs looking for it and
 sifting, I thought i'd ask here.



 --
 http://groups.google.com/group/python_inside_maya


-- 
http://groups.google.com/group/python_inside_maya


Re: [Maya-Python] Re: python modules

2011-04-12 Thread Geordie Martinez
I use 're' for reg ex to  figure out naming schemas  or how to parse the
name of selected objects in pymel to determine information.
I use 'logging' as well for just about everything.
pymel of course.

'pickle' for storing dictionaries of information like skin weights, node
settings, and what not.




On Tue, Apr 12, 2011 at 5:20 PM, JP jspatr...@gmail.com wrote:

 I use logging...ummm..everywhere.  It's probably my most commonly
 imported module.
 pyyaml (3rd party) for loading and dumping text into string
 attributes, external files, etc.  Much more readable than XML.
 pygraph (3rd party) is handy for creating directed graphs in Python.
 math ...duh...
 Maya.OpenMaya - I haven't needed to create much in the way of plugins
 (just simple little nodes here and there), but I still use OpenMaya a
 great deal.  It can be a very powerful scripting weapon for a pretty
 broad range of problems.

 That's all I got at the moment :)


 On Apr 12, 12:13 am, C. B. Esquire crackerbu...@gmail.com wrote:
  Just a generic question, this goes for modeling, texturing, lighting,
  animation, rigging, dynamics, sims, all of it ~
 
  If you want to go into detail, great, if not just a quick answer is fine.
  What are some of the built-in, and 3rd party python modules you are using
  and for Maya tasks?
 
  PyQt for gui development as an example.

 --
 http://groups.google.com/group/python_inside_maya


-- 
http://groups.google.com/group/python_inside_maya


Re: [Maya-Python] Re: Checking nurbsSurface symmetry

2010-11-09 Thread Geordie Martinez
you can get the bounding box XYZ values. If they don't match then it's not
symmetrical... not fool proof.


On Tue, Nov 9, 2010 at 2:56 PM, Dave Nunez nun...@gmail.com wrote:

 point positions (CV's)

 On Tue, Nov 9, 2010 at 5:55 PM, Dave Nunez nun...@gmail.com wrote:
  without getting into heavy math, the easiest way to do it for your
  sphere example is to find the points that are not equal to zero.
 
  hth, -d
 
 
 
  On Tue, Nov 9, 2010 at 5:27 PM, vib jackshaoch...@gmail.com wrote:
  Let's say do you these operations.
 
  1.  file -new -f;
  2.  sphere -ch on -o on -po 0 -ax 0 1 0 -r 21.213203 -nsp 4 ;
  3.  select -r nurbsSphere1.cv[4][2] ;
  4.  move -r 3.329444 -0.31653 10.181211 ;
 
  The nurbsSurface / sphere is no long symmetrical.
 
  How would you write a Python / Mel script to detect that the sphere is
  no longer symmetrical?
 
  Thanks.
 
 
  On Nov 9, 2:16 pm, Dave Nunez nun...@gmail.com wrote:
  Can you be a little more specific, symmetry has a lot of meanings. -d
 
  On Tue, Nov 9, 2010 at 4:53 PM, vib jackshaoch...@gmail.com wrote:
   Hi,
 
   How would you go about checking a nurbsSurface for symmetry?
 
   Thanks.
 
   --
  http://groups.google.com/group/python_inside_maya
 
  --
  When things get too complicated, it sometimes makes sense to stop and
  wonder: Have I asked the right question?
  -Enrico Bombieri
 
  --
  http://groups.google.com/group/python_inside_maya
 
 
 
  --
  When things get too complicated, it sometimes makes sense to stop and
  wonder: Have I asked the right question?
  -Enrico Bombieri
 



 --
 When things get too complicated, it sometimes makes sense to stop and
 wonder: Have I asked the right question?
 -Enrico Bombieri

 --
 http://groups.google.com/group/python_inside_maya


-- 
http://groups.google.com/group/python_inside_maya

Re: [Maya-Python] Little iterable doubt

2010-11-08 Thread Geordie Martinez
try this:

for (i,p) in plist:
   cmds.parent(i,p)

parent takes two arguments.

if it's a pymel object you can use this kind of method on the object:
 cubeA.setParent(cubeB)

but maya.cmds it's a command not a method so you need to tell parent where
to put it.

G

On Sun, Nov 7, 2010 at 3:42 PM, Fernanda nanda...@live.com wrote:

 #Hello guys!!
 # I'm studying practical ways to study iteration.
 # Who can explain to me the error correction ... i will be grateful

 # i'm Make 4 polyCubes
 clist = ['cube1','cube2','cube3','cube4']
 pos = [1,3,5,7]
 for i,a in zip(clist,pos):
cmds.polyCube(n=i)
cmds.move(a,i)

 #Parent methods

 #Now , i'm need parenting one for one polyCube... for exemple:
 cmds.parent('cube1','cube2') # method OK
 cmds.parent('cube2','cube3') # method OK
 cmds.parent('cube3','cube4') # method OK

 # Other methods:
 plist = [('cube1','cube2'),('cube2','cube3'),('cube3','cube4')]

 for i in plist:
cmds.parent(i) # method OK

 # But, why this method having the same effect, it generates this
 error? how to fix?

 cmds.select(clist)

 while clist:
   cmds.parent()

 # RuntimeError: Not enough objects or values.
 # ???

 --
 http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya