[Maya-Python] Re: Adjusting Maya for 4k monitors ...via python?

2015-03-26 Thread Jack Straw
Sounds like a good starting point and a fun little project.. I'm not lucky enough to have a high DPI screen so I wouldn't develop it myself. This thread on HiDPI for Qt might be useful as well; http://comments.gmane.org/gmane.comp.lib.qt.devel/6983 . On Thursday, 19 March 2015 11:55:24 UTC, Fre

[Maya-Python] Re: C++ Programming for Autodesk Maya

2014-10-17 Thread Jack Straw
though I am quite happy to read C++ stuff here too. > > http://forums.autodesk.com/t5/programming/bd-p/area-b50/page/2 > > > > On Wednesday, 8 October 2014 22:38:26 UTC+11, Jack Straw wrote: >> >> This group is a great resource for Python development and basically it

Re: [Maya-Python] Re: dictionary help

2014-10-09 Thread Jack Straw
I now understand what you are trying to achieve. You want to group selections of vertices that are connected. The approach you were using had the caveat that you would need to select the verts in connected order otherwise it was possible to have orphaned ones that should be grouped (I fixed your c

Re: [Maya-Python] Re: dictionary help

2014-10-08 Thread Jack Straw
import pymel.core as pm sel = pm.ls(sl=1, fl=True) connectedVertGroups = {} vertGroups = {}for i, vtx in enumerate(sel): vtxKey = next((key for key, vtx_list in connectedVertGroups.iteritems() if vtx in vtx_list), None) if vtxKey is None: connectedVerts = [ vert for vert in vtx.co

[Maya-Python] Re: dictionary help

2014-10-08 Thread Jack Straw
This is how I generally go about searching the values in a dict; my_key = next((key for key, value in dict.iteritems() if value == 'what im testing against'), None) my_key will be None if the condition is never True. On Wednesday, 8 October 2014 15:14:40 UTC+1, kevco...@gmail.com wrote: > > He

[Maya-Python] Re: check for surface collisions along particular vector

2014-10-08 Thread Jack Straw
Writing it using the maya Python 2.0 API might make it simpler though as the array types can be iterated over much more easily. On Wednesday, 8 October 2014 17:02:23 UTC+1, Jack Straw wrote: > > Heres a little bit of code to print out the corrdinates; > > intersections = returnCol

[Maya-Python] Re: check for surface collisions along particular vector

2014-10-08 Thread Jack Straw
Heres a little bit of code to print out the corrdinates; intersections = returnCollisionPoints() for pnt_idx in range(intersections.length()): print intersections[pnt_idx][0], intersections[pnt_idx][1], intersections[pnt_idx][4] Writing it using the Python 2.0 API On Wednesday, 8 October 20

Re: [Maya-Python] C++ Programming for Autodesk Maya

2014-10-08 Thread Jack Straw
This is why I would lean towards making the c++ one separate and just have it as a sister group to this one. On 8 October 2014 16:45, Fredrik Averpil wrote: > But then you kind of need to write that prefix instruction in the footer > or something... At least I know I'm going to forget about that

Re: [Maya-Python] C++ Programming for Autodesk Maya

2014-10-08 Thread Jack Straw
> > How about a prefix, such as [C++] to questions involving C++? E.g. > "[Maya-Python][C++] My question" > > On 8 October 2014 14:55, Jack Straw > wrote: > >> The name of this group will throw a lot of people and even if they do ask >> C++ questions here, t

Re: [Maya-Python] C++ Programming for Autodesk Maya

2014-10-08 Thread Jack Straw
:13:42 UTC+1, Michał Frątczak wrote: > > W dniu 2014-10-08 13:38, Jack Straw pisze: > > This group is a great resource for Python development and basically it > > would be great to have another for discussing C++ development for > > Maya. I just wanted to gauge interest be

[Maya-Python] C++ Programming for Autodesk Maya

2014-10-08 Thread Jack Straw
This group is a great resource for Python development and basically it would be great to have another for discussing C++ development for Maya. I just wanted to gauge interest before I set it up, I have seen plenty of questions on C++ development on this group. If it could be added to the useful

Re: [Maya-Python] installing external packages into Maya python

2014-10-08 Thread Jack Straw
If the package is pure python, no cpython extensions and compiled files, they should work correctly by just including them in your python path. But if they do have cpython components like numpy or PyOpenGL you will have to compile it for the instance of python that inside Maya and not use a bina

[Maya-Python] Re: X-Ray OpenGL shapes in Maya API

2014-01-20 Thread Jack Straw
; glFT.glPushAttrib(OpenMayaRender.MGL_CURRENT_BIT) > # Enabled Blend mode (to enable transparency) > glFT.glEnable(OpenMayaRender.MGL_BLEND) > > glFT.glClear(OpenMayaRender.GL_DEPTH_BUFFER_BIT) here is get the error > OpenMayaRender doesnt have attribute > > > D. > > >

[Maya-Python] Re: X-Ray OpenGL shapes in Maya API

2014-01-20 Thread Jack Straw
You need to call them from the OpenGL function table. Here is an example; http://www.fevrierdorian.com/blog/post/2010/02/12/Creating-custom-locator-with-Maya-s-Python-API On Monday, 20 January 2014 13:05:23 UTC, Dilen Shah wrote: > > > Hey Jack, > > I am trying to use that but in python as I am

[Maya-Python] Re: X-Ray OpenGL shapes in Maya API

2014-01-17 Thread Jack Straw
As it is a full OpenGL viewport you can just use standard OpenGL methods for rendering on top. From a quick google it looks like glClear(GL_DEPTH_BUFFER_BIT) is the best option. I have done this before but I cannot remember the exact command I used that time. Jack On Friday, 17 January 2014 08

[Maya-Python] Re: deformer weight transfer

2013-12-05 Thread Jack Straw
Hi, yep the idea is feasible, I worked at a studio with a similar script for transferring skinning weights. The way I would go about it would be to store the vertex position relative to the wire point (instead of the vertex ID) with the influence then when reapplying the weights use this positio