Re: [Maya-Python] executing external python script and returning a list?

2014-05-04 Thread Fredrik Averpil
Hi Gerard, Here's an example how you can catch (or list the output) from python's subprocess: http://fredrik.averpil.com/post/63722065215 To source the script and run it within Maya, first do: import sys sys.path.append('c:/where/your/script/is/at') import yourScriptName And optionally/prefera

Re: [Maya-Python] Applying a 3d matrix to a bunch of 3d nurbs cvs

2014-05-04 Thread Marcus Ottosson
Sure, the opposite of a decomposeMatrix is called composeMatrix. Alternatively, you could use any transform node, as it will have regular t, r and s channels, and its outcoming matrix, either world or local. Once you've got your t, r and s values baked into a matrix, there is a node called wtAddMa

[Maya-Python] executing external python script and returning a list?

2014-05-04 Thread Gerard v
Hi. I wrote a script using pyAlembic that I can use to parse a file and list contents etc. I am not sure how to execute the external script from within maya, with an argument (path) and return a list that is generated from the script. I have read up on python's subprocess module and os.popen but

Re: [Maya-Python] Applying a 3d matrix to a bunch of 3d nurbs cvs

2014-05-04 Thread Paxton
Interesting idea! I am setting this up to test the speed difference. One question though. Since the transformGeometry nodes "transform" attr is a matrix attribute, how would I input a translate rotate or scale value? is there a simple way to add translate/rotate/scale values to a matrix? > > -

[Maya-Python] maya plug development with windows 8, 8.1, thanks

2014-05-04 Thread paul jordan
Thanks for your comments here, chad I got this to work mostly following your cgcircuit api video A couple of points to anyone following along 1-you'll need to download win sdk 7.1 in addition to visual studio express 10. Otherwise, visual studio cannot compile x64 and you will not se x64 opt

[Maya-Python] Re: Regex Stuff to determinng versioning.

2014-05-04 Thread Jeremy YeoKhoo
Thanks for that everyone, Didnt know the padded version < ie [\d(3)] > nor the $ to search end the string. Cool stuff!! On Sunday, 4 May 2014 20:47:26 UTC+10, Jeremy YeoKhoo wrote: > > Hey guys, > > This should be fairly easy for you guys who know regex. If I have a string > that I want to

Re: [Maya-Python] Create contextMenu on lots of buttons PyQt - QtDesigner - Maya

2014-05-04 Thread Justin Israel
Awesome. Glad it worked! On May 5, 2014 8:26 AM, "mAtt RINGOT" wrote: > The toolTip is perfect :D > > About the mousePressEvent() I've linked a clear selection to this command > and it works too :D > > def mousePressEvent(self, event): > self.offset = event.pos() > QtGui.QWid

Re: [Maya-Python] Create contextMenu on lots of buttons PyQt - QtDesigner - Maya

2014-05-04 Thread mAtt RINGOT
The toolTip is perfect :D About the mousePressEvent() I've linked a clear selection to this command and it works too :D def mousePressEvent(self, event): self.offset = event.pos() QtGui.QWidget.mousePressEvent(self, event) cmds.select(clear=True) Thanks for everythin

Re: [Maya-Python] Create contextMenu on lots of buttons PyQt - QtDesigner - Maya

2014-05-04 Thread Justin Israel
On May 5, 2014 5:33 AM, "mAtt RINGOT" wrote: > > It worked perfectly ! I used the self.sender method instead of the partial. Thank you for your really great and clear reply ! > > I'm also listing all the children from my widget instead of having a long list of strings using : > > buttonList = self

Re: [Maya-Python] Applying a 3d matrix to a bunch of 3d nurbs cvs

2014-05-04 Thread Marcus Ottosson
Hi Paxton, This is possibly not what you are looking for, as you asked for a coded method, but Maya is quite capable of transforming points using a matrix via its own nodes. Have a look at the fourByFourMatrix, multMatrix and decomposeMatrix nodes. You would connect the transform of your curve, o

[Maya-Python] Applying a 3d matrix to a bunch of 3d nurbs cvs

2014-05-04 Thread Paxton
Hey guys. long time lurker, first post... I posted this over on stack overflow, but I think this might be a better place for it.. I am creating a toolset for creating nurbs curves/surfaces inside maya using python. I have a set of dictionaries that include cvPositions, knots, form etc. eac

Re: [Maya-Python] Create contextMenu on lots of buttons PyQt - QtDesigner - Maya

2014-05-04 Thread mAtt RINGOT
It worked perfectly ! I used the self.sender method instead of the partial. Thank you for your really great and clear reply ! I'm also listing all the children from my widget instead of having a long list of strings using : buttonList = self.ui.myWidget.findChildren(QtGui.QPushButton) I would

Re: [Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Marcus Ottosson
Very useful! Always wondered why that command was called "group" when I only ever got a single result back. :) On 4 May 2014 17:16, Eduardo Grana wrote: > Hello Jeremy, > One thing i found very usefull is the groups method of re.match, > so you can get parts of the matched pattern > for example

Re: [Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Eduardo Grana
Hello Jeremy, One thing i found very usefull is the groups method of re.match, so you can get parts of the matched pattern for example, >>> import re >>> st = 'hello_v001' >>> regex = '(.*)_[vV]([0-9]{3})$' # notice the ( ) to separate the parts you get later, the $ represents the end of the strin

Re: [Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Justin Israel
The re module also has a case insensitive flag: re.search(r'_v\d+', 'hello_v001', re.I) You can also limit it to a 3 padded version scheme if you want to go that far: re.search(r'_v\d{3}', 'hello_v001', re.I) On May 4, 2014 11:07 PM, "Anthony Tan" wrote: > If the leading 'v' is the relevant th

Re: [Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Anthony Tan
If the leading 'v' is the relevant thing, would '_[Vv][0-9]+' do? (Its just hunting for an underscore, lowercase OR uppercase v, then a string of numbers) On 4 May 2014 20:47, Jeremy YeoKhoo wrote:Hey guys,This should be fairly easy for you guys who know regex. If I have a string that I want to

Re: [Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Marcus Ottosson
Hi Jeremy, You can put a character in front of a pattern. >>> re.search(r'v[0-9]+', 'hello_v001') You can also use \d in-place of [0-9] >>> re.search(r'v\d+', 'hello_v001') More here: https://docs.python.org/2/library/re.html On 4 May 2014 11:47, Jeremy YeoKhoo wrote: > Hey guys, > > This sh

[Maya-Python] Regex Stuff to determinng versioning.

2014-05-04 Thread Jeremy YeoKhoo
Hey guys, This should be fairly easy for you guys who know regex. If I have a string that I want to enable versioning, so say for an example I want to recognize a string if it contains ['v001', 'v002', etc...] I have something like this... remp= re.search('[0-9]+', 'hello_v001') print temp.grou