Re: [Maya-Python] how to reflect download progress onto QtableView or QtableWidget?

2013-05-22 Thread Justin Israel
I haven't studied the code that deeply, but this part stands out to me as a potential problem: class MainWindow(QMainWindow): ... for i in downloadLink: self.t=DownloadTask(i) self.downloadTaskList.append(downloadTaskInfo(fileName=self.t.fileName,

Re: [Maya-Python] Re: Retrieving data from txt file for usage

2013-05-23 Thread Justin Israel
Jessie gave some really good example of how to simply using the pickle module. But it seemed like you took only the call to the pickle module and ditched the rest ;-) There is absolutely no reason to use more than one file here. The point of using pickle is that you can store entire object stru

Re: [Maya-Python] Retrieving data from txt file for usage

2013-05-24 Thread Justin Israel
There is no need for nested for loops in this solutions. But I did have a typo: for data in valList: attr, diffColorAmmount cmds.setAttr(attr, val) That should resolve it On May 24, 2013, at 8:28 AM, Justin Israel wrote: > for data in valList: >attr, val >cmds.setAttr(

Re: [Maya-Python] My personal workspace

2013-05-25 Thread Justin Israel
1. Why do you have local __version__ variables in a bunch of your methods that serve no purpose? 2. line 33 is not correct. When you split with os.path.splitexit, the extension will retain its leading period character. But you are joining it back again with a period, producing duplicate perio

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

2013-05-25 Thread Justin Israel
Just a suggestion, but you may find it a lot easier to work with actual function objects, as opposed to passing a string for the callback, to be evaluated. When you pass a string it is not a closure and anything in there will get evaluated when it is executed. So you could change your callback t

Re: [Maya-Python] creating dynamic objects

2013-06-04 Thread Justin Israel
It doesn't sounds like you really need an entire class structure with methods, to change the properties of the file nodes in the scene, unless each instance has some state that needs to be preserved? Sounds just like a function. What is fileObj in this snippet? You could have your class take a fil

Re: [Maya-Python] how to convert python ‘s byte array to QByteArray ?

2013-06-06 Thread Justin Israel
You hit up all the forums at once with your question don't ya? (stackoverflow, qt-project.org, python_inside_maya) ;-) Is this for python3? Placing 'b' in front of the string literal doesn't do anything in python2, and in python3 it doesn't create a bytearray, it creates a bytes instance. So

[Maya-Python] [ANN] Plow: Open Source Render Farm Software for VFX

2013-06-06 Thread Justin Israel
Hi Everyone! I wanted to announce a project I have been working on for a while now. It is still in dev status, but has made enough progress towards being production ready to reach out to enthusiastic developers. *Plow* - A render farm management software specifically designed for VFX workloads.

[Maya-Python] Re: [ANN] Plow: Open Source Render Farm Software for VFX

2013-06-06 Thread Justin Israel
pipelines (environment management, statistics reporting, submission / job description, tracking / asset management) - Decent client tools - Decent configuration options There... I feel better about that replacement description :-) On Fri, Jun 7, 2013 at 2:20 PM, Justin Israel wrote: >

Re: [Maya-Python] Re: Attach a Maya popupMenu to a QPushButton

2013-06-13 Thread Justin Israel
Is that a marking menu or just a normal menu? He was asking about marking menus. On Jun 14, 2013 7:03 AM, "Christian Akesson" wrote: > To populate context menu > # Clear the list > for e in myContextMenu .actions(): > myContextMenu.removeAction(e) > # Populate the list > if dataItems: >

Re: [Maya-Python] Re: Attach a Maya popupMenu to a QPushButton

2013-06-13 Thread Justin Israel
or use Maya > buttons instead of QPushButton when I want to make use of Maya marking > menus. Correct me if I am wrong. Thanks. > > El 14/06/2013 00:26, "Christian Akesson" escribió: > > On Thursday, June 13, 2013 12:53:06 PM UTC-7, Justin Israel wrote: >> >

Re: [Maya-Python] error with setFoatVector

2013-06-14 Thread Justin Israel
round() is a python built-in function http://docs.python.org/2/library/functions.html#round On Jun 15, 2013 10:05 AM, "Daniel Lindsey" wrote: > I just skimmed through this really quick. But if the quick read, shouldn't > it be math.round not round? Not sure is that's the error you're getting it

Re: [Maya-Python] PyQt Node,Link

2013-06-15 Thread Justin Israel
Are you asking why code you have written for a PyQt < 4.8 worked fine, and on PyQt 4.8.x it does not work fine? There could be a few reasons, depending on what that previous version of PyQt actually is. Minor version releases are allowed to change the API (4.7 => 4.8 for example). Can you post a s

Re: [Maya-Python] Restoring the color from a QFrame Widget

2013-06-16 Thread Justin Israel
Hey, You are on the right path, but just missed one thing. The static QColorDialog.getColor() can take an optional initial color. What you will want to do is save the previous QColor only if its valid (not every time). You can also set the color to its exact rgb values instead of a color name.

Re: [Maya-Python] GUI Tkinter error ....Newb

2013-06-17 Thread Justin Israel
Well one thing is for sure. You should only be working with python2.6 modules if they are to be imported into Maya. Anything you install for python2.7 or python 3.3 should be considered usable only from standalone python scripts. You would end up with binary incompatibilities. That being said, see

Re: [Maya-Python] GUI Tkinter error ....Newb

2013-06-17 Thread Justin Israel
on2.6 will allow you to build a 64-bit tkinter, which you can then add to your pythonpath. On Tue, Jun 18, 2013 at 2:04 PM, Marc Morrisseau wrote: > On Monday, June 17, 2013 5:41:49 PM UTC-7, Justin Israel wrote: > > Well one thing is for sure. You should only be working with python2.

Re: [Maya-Python] Embedd Maya window in custom program

2013-06-20 Thread Justin Israel
I don't know exactly how to go about it, but I know it's possible to use the window Id of a widget/window in maya and set it on a QWidget. On Fri, Jun 21, 2013 at 3:07 PM, Mathew Schwartz wrote: > I remember reading that it is possible to run maya from a command line so > I am wondering if it i

Re: [Maya-Python] Restoring the color from a QFrame Widget

2013-06-21 Thread Justin Israel
m on a PC running Windows 7. > > As for your question in regards of my import statements, I was importing > the specific classes that I'm using. > This allows me only to load the ones that I need and I thought that there > was no need for namespaces in this case. > > > > O

Re: [Maya-Python] how to use QNetworkAccessManager::setProxyFactory ( QNetworkProxyFactory * factory )?

2013-06-21 Thread Justin Israel
I haven't used the QNetworkProxy objects yet, but it seems you would just subclass a QNetworkProxyFactory and implement the virtual QNetworkProxyFactory::queryProxy The docs say to use the factory if you need fine grained control over which proxy to use for which requests. Do you have this situ

Re: [Maya-Python] Embedd Maya window in custom program

2013-06-23 Thread Justin Israel
o the qwidget > or can it just be loaded through a python command? > > Does anyone know how to to this. I imagine if justin doesnt, it will be > hard to find someone who does :) > > > On Fri, Jun 21, 2013 at 1:32 PM, Justin Israel wrote: > >> I don't know exactly how

Re: [Maya-Python] pyside and QUiLoader

2013-06-26 Thread Justin Israel
The naming convention for the automatic "connectSlotsByName"should be: on__ So I would think your slot should be called: on_create_button_clicked() But really, its so much easier to just ditch connectSlotsByName, name you

Re: [Maya-Python] Re: pyside and QUiLoader

2013-06-26 Thread Justin Israel
When I still used the Designer, I would always pre-generate my ui files to py, using uic. And I would use one of the inheritance approaches, with setupUi(). Now I don't use the Designer any more, so its not really an issue for me. Also, I use only the new-style signal slots convention. On Thu, J

Re: [Maya-Python] I can find PyQt under the shell mode

2013-06-26 Thread Justin Israel
ipython is using your standard system installed python, whereas Maya is using its own bundled python. So if you only install PyQt for maya, then you would not have it in a shell. You should go and install Qt/PyQt4 for your system Similarly, having access to the uic/rcc tools in Maya is dependant

Re: [Maya-Python] Dynamic menus

2013-07-02 Thread Justin Israel
If you are just using the native Maya UI, could you just make use of the postMenuCommand? It gets called when the menu is about to be shown, given you the opportunity to populate it any way you want. It would then just be a matter of packaging up the right data for each callback. Something like

Re: [Maya-Python] Dynamic menus

2013-07-02 Thread Justin Israel
It would probably also be a good idea to clear the previous menu items each time: def populate_menu(path, menuPath, *args, **kwargs): cmds.menu(menuPath, e=True, deleteAllItems=True) ... On Jul 2, 2013, at 10:56 PM, Justin Israel wrote: > If you are just using the native Maya

Re: [Maya-Python] Dynamic menus

2013-07-02 Thread Justin Israel
tor). I had looked > at the postMenuCommand, but it doesn't seem to work for sub-menus. I'll > give it another shot and see if I'm doing something wrong. > > > On Tue, Jul 2, 2013 at 11:56 AM, Justin Israel wrote: > >> If you are just using the native Maya UI, c

Re: [Maya-Python] Embedd Maya window in custom program

2013-07-04 Thread Justin Israel
Autodesk\Maya2013\Python\lib\lib-tk") > sys.path.append("C:\Program Files\Autodesk\Maya2013\\bin") > sys.path.append("C:\Program Files\Autodesk\Maya2013\Python") > sys.path.append("C:\Program > Files\Autodesk\Maya2013\Python\lib\site-packages") > >

Re: [Maya-Python] Closing PySide windows in Maya

2013-07-10 Thread Justin Israel
It is actually the expected behavior with Qt, but just a little more pronounced because it is in the persistent python sessions of Maya. In python, by default a widget would only be deleted indirectly if it either had no parent and its reference went out of scope, or its parent was deleted which de

Re: [Maya-Python] I can find PyQt under the shell mode

2013-07-12 Thread Justin Israel
Pyuic4 and pyrcc4 get installed to the bin/ directory of your installation by PyQt4 It is possible that you don't have the bin/ in your PATH Try:mdfind -name pyuic4 See if that turns up the full path. Installing from source or using homebrew to install pyqt4 will end up putting it in /usr/loc

Re: [Maya-Python] I install pyqtx on lion but still can't find pyqt4

2013-07-12 Thread Justin Israel
If you install packages that are prebuilt, like the PyQtX, then they will go to a specific site-packages location assumed to be the right one. When you build from source, you are building against your specific python which will install them to the same site-packages location. This command should b

Re: [Maya-Python] I install pyqtx on lion but still can't find pyqt4

2013-07-14 Thread Justin Israel
Ok so that just means you probably didn't start ipython via: $ ipython --gui=qt That would automatically create a QApplication and start an event loop for you. On Mon, Jul 15, 2013 at 3:29 PM, m li wrote: > Hello Justin: > It's very nice of you for giving me those advise. I followed

Re: [Maya-Python] Windows NAS and pyqt

2013-07-16 Thread Justin Israel
Are you trying it with raw strings? unc = r'\\worknas\\raid1' On Jul 17, 2013 5:48 AM, "Ricardo Viana" wrote: > Hi guys . > Started a new job at a windows based pipeline house. Thing is > I never worked with windows before, more of a unix kind of guy. > > The issue: > Im Trying to create folders

Re: [Maya-Python] how to redirect Wheel events of QWidget to QTextEdit ?

2013-07-18 Thread Justin Israel
It depends on where the pointer currently is. If it is still within your app, you could catch all wheel events and forward them to the line edit. But if your mouse is outside of the app then another widget is free to grab the focus away On Fri, Jul 19, 2013 at 6:05 PM, iMath wrote: > when you t

Re: [Maya-Python] how to redirect Wheel events of QWidget to QTextEdit ?

2013-07-19 Thread Justin Israel
try: if event.type() == event.Wheel: self.textEdit.wheelEvent(event) event.accept() except RuntimeError: pass On Fri, Jul 19, 2013 at 9:37 PM, iMath wrote: > 在 2013年7月19日星期五UTC+8下午2时25分55秒,Justin Israel写道: > > It depends on where the pointer

Re: [Maya-Python] redirect keyboard events to QTextEdit when it has no focus ?

2013-07-20 Thread Justin Israel
This is really similar to your last question about wheel events. Have you tried anything yet like catching keyPress events? Calling setFocus() on your text edit? Trying grabKeyboard()? On Jul 21, 2013 2:22 PM, "iMath" wrote: > when the QTextEdit doesn’t have focus ,how to redirect keyboard event

Re: [Maya-Python] redirect keyboard events to QTextEdit when it has no focus ?

2013-07-21 Thread Justin Israel
### class Window(QtGui.QDialog): def __init__(self): super(Window, self).__init__() self.resize(800,600) self.text = QtGui.QTextEdit(self) self.text.setText("All your key press are belong to us") layout = QtGui.QVBoxLayout(self) layout.addWidg

Re: [Maya-Python] Send data from Maya to external application

2013-07-22 Thread Justin Israel
Here is a quick example using Qt classes: ### from functools import partial from PySide import QtNetwork def handleConn(): conn = s.nextPendingConnection() conn.readyRead.connect(partial(readConn, conn)) def readConn(conn): data = conn.readAll() print "Read:", data # Make a ser

Re: [Maya-Python] Send data from Maya to external application

2013-07-22 Thread Justin Israel
nd(self, message): > sock = QtNetwork.QLocalSocket() > sock.connectToServer('myLocalSocket') > sock.write('foo\n') > > > if __name__ == '__main__': > import sys > > app = QApplication(sys.argv) > > server = Se

Re: [Maya-Python] redirect keyboard events to QTextEdit when it has no focus ?

2013-07-23 Thread Justin Israel
I put a comment above that line ;-) It was to still pass the key event to the dialog in addition to the text edit. It may or may not still be needed depending on what type of widget you really are reimplementing the keyPressEvent on. On Jul 24, 2013 12:55 AM, "iMath" wrote: > thanks ,but what’s

Re: [Maya-Python] Question on PyQt Layouts

2013-07-30 Thread Justin Israel
The layouts have the ability to set an alignment : http://doc-snapshot.qt-project.org/4.8/qlayout.html#setAlignment You can align the items to the top. Also you can play with making your expanded widgets size policy set to mininumExpanding On Jul 30, 2013 8:52 PM, "Joe Weidenbach" wrote: > Hello

Re: [Maya-Python] dynamic building a pySide/pyQT ui

2013-07-30 Thread Justin Israel
Not really sure how to answer this completely, but you have many options to make a UI driven by a config. I have a few applications I maintain that have this feature. Some have a form of a declarative UI structure that gets parsed and translated into custom widgets. Some just define prefs to apply

Re: [Maya-Python] Question on PyQt Layouts

2013-07-30 Thread Justin Israel
4 AM, "Joe Weidenbach" wrote: > Thanks Justin-- > > Great videos on CMIVFX btw :) > > Sent from my iPhone > > On Jul 30, 2013, at 5:11 AM, Justin Israel wrote: > > The layouts have the ability to set an alignment : > http://doc-snapshot.qt-project.org/4.8/qla

Re: [Maya-Python] styleSheet on pushButton problem

2013-07-30 Thread Justin Israel
I would wager is it because signals emitted and received within the same thread use a direct connection, which means that the button has probably not fully completed its "clicked" state until it returns back to the event loop. You could either called QApplication.processEvents() in your slot before

Re: [Maya-Python] styleSheet on pushButton problem

2013-07-31 Thread Justin Israel
is active. until i need > the setChecked(False) called. > > if there is an easier way please let me know. > > thanks again > > john > > On 30/07/2013 9:09 PM, Justin Israel wrote: >> I would wager is it because signals emitted and received within the same >&g

Re: [Maya-Python] Loop with name change - not maya related

2013-07-31 Thread Justin Israel
Do you mean just using a counter? You can do it a couple ways. If I am looping over a list, then I tend to use enumerate: aList = someListofStuff() for i, item in enumerate(aList): print "{0}{1}".format(item, i) Is that what you are after? On Aug 1, 2013, at 12:27 AM, Daz wrote: > He

Re: [Maya-Python] Loop with name change - not maya related

2013-07-31 Thread Justin Israel
It is essentially a shorter and probably more performant version of this: i = 0 for item in aList: print "{0}{1}".format(item, i) i += 1 On Aug 1, 2013, at 12:32 AM, Justin Israel wrote: > Do you mean just using a counter? You can do it a couple ways. If I am > loo

[Maya-Python] MayaSublime plugin change

2013-08-06 Thread Justin Israel
Hi all, For anyone that happens to be using my MayaSublime plugin, I just wanted to post a quick note. I merged a submitted patch (with some modifications) that adds a feature but changes some default behavior. What it adds is the ability to exec the entire file when sending an empty selectio

Re: [Maya-Python] certain command crashes Maya 2014

2013-08-15 Thread Justin Israel
Do those snippets crash when run by themselves, from the Script Editor? The first one seems to work fine in Maya 2013 Does it completely take down Maya? If so, is the error you are seeing the process where it is writing out the temporary scene file before crashing the app? On Aug 15, 2013, at

Re: [Maya-Python] Re: SublimeJEDI: Easier than SublimeCodeIntel

2013-08-20 Thread Justin Israel
you? It doesn't give me any completion > on pymel objects. Any ideas? > > -v > > On Thursday, April 25, 2013 1:00:15 PM UTC+2, Justin Israel wrote: > > Just stumbled across this: > > https://github.com/svaiter/SublimeJEDI > > > > Thought I would give it

Re: [Maya-Python] why qslider disappears as soon as i drag it in maya ?

2013-08-22 Thread Justin Israel
The problem seems to be specifically with using a QSlider as an editor, as opposed to something like a QSpinBox, because of the way the events are handled for that kind of widget. The focus events are being mishandled, which makes the widget hide when you click on it. A solution would be to imp

Re: [Maya-Python] setPlaceholderText for QLineEdit in maya

2013-08-23 Thread Justin Israel
What version of maya/pyqt4? On Aug 23, 2013 8:01 PM, "Arjun Thekkummadathil" <3dar...@gmail.com> wrote: > Hi >am trying to make a UI for a small tool i developed and i use PyQt and > i use a Input Widget called QLineEdit and use a feature for that called > placeHoldetText to put up a temp tex

Re: [Maya-Python] setPlaceholderText for QLineEdit in maya

2013-08-23 Thread Justin Israel
Sorry. Was late on the updates. Maya 2012. On Aug 23, 2013 8:27 PM, "Justin Israel" wrote: > What version of maya/pyqt4? > On Aug 23, 2013 8:01 PM, "Arjun Thekkummadathil" <3dar...@gmail.com> > wrote: > >> Hi >>am trying to make a UI for a

Re: [Maya-Python] setPlaceholderText for QLineEdit in maya

2013-08-23 Thread Justin Israel
not changing the PyQt build. On Aug 23, 2013, at 8:30 PM, Kurian O.S wrote: > Its pyqt version issue. Just google it you will get the answer. > > On Friday, August 23, 2013, Justin Israel wrote: > Sorry. Was late on the updates. Maya 2012. > > On Aug 23, 2013 8:27 PM, "Jus

Re: [Maya-Python] setItemWidget of QTreeWidget Issue in PyQt4

2013-08-29 Thread Justin Israel
Seems to work fine for me. What behavior are you seeing? On Fri, Aug 30, 2013 at 6:31 PM, DayDreamer wrote: > I am adding a Qwidget(QPushButton) into a QTreeWidget through > setItemWidget method, but Button is not appearing as expected(should come > at column index 1). > > Need some help in this

Re: [Maya-Python] Re: setItemWidget of QTreeWidget Issue in PyQt4

2013-08-30 Thread Justin Israel
Possibly. I don't have that old of a PyQt setup to confirm. Tested with > Qt 4.7 On Fri, Aug 30, 2013 at 7:18 PM, DayDreamer wrote: > > its not showing up in treeWidget. > > i raised the same question on SO, there also its working for other guys. > Its not working for me. > > can it be an issue

Re: [Maya-Python] Re: setItemWidget of QTreeWidget Issue in PyQt4

2013-08-30 Thread Justin Israel
"Outside" meaning standalone? What pyqt4 version are you using from a standalone install? I tested on a standalone and it worked as expected. On Aug 30, 2013 11:59 PM, "DayDreamer" wrote: > sorry for late reply, I opened the UI in Maya 2013 and it worked fine(can > see the button). > But, its not

Re: [Maya-Python] Re: setItemWidget of QTreeWidget Issue in PyQt4

2013-09-01 Thread Justin Israel
If you just want to make sure you are working in the same API compatibility with Maya's Qt, you could do Qt 4.7.x if you are using maya 2012-2013, or Qt 4.8.x if you are using Maya2014 On Mon, Sep 2, 2013 at 4:13 PM, DayDreamer wrote: > Yaa, i meant standalone, its 4.5.2, never-mind its working

Re: [Maya-Python] How reliable is SQLite in production?

2013-09-06 Thread Justin Israel
Is your application write heavy? If so, sqlite may be a significant performance decrease over postgres, because of the database locking during concurrent write access or a write happening in combination with readers. On Sep 7, 2013 12:48 PM, "Panupat Chongstitwattana" wrote: > Hi everyone. > > I'

Re: [Maya-Python] How reliable is SQLite in production?

2013-09-07 Thread Justin Israel
ll > if I expand it to cover other area... hmm > > Thanks again Justin :) > > > On Saturday, September 7, 2013 8:19:37 AM UTC+7, Justin Israel wrote: > > Is your application write heavy? If so, sqlite may be a significant > performance decrease over postgres, because of the

Re: [Maya-Python] Infinite Loop

2013-09-10 Thread Justin Israel
What does your actual loop look like that is causing the problem? I don't see a recursive call here. Are you trying to trace a specific path along the way or to build a big tree data structure? Also you might want to set the source/destination flags in listConnections to control the direction you w

[Maya-Python] Re: New Manager for Group

2013-09-12 Thread Justin Israel
On Friday, September 13, 2013 9:13:22 AM UTC+12, Farsheed Ashouri wrote: > Hey guys. Hope you're doing well. I am happy to introduce to you the new > manager. > Well... you know him very well. Justin! > I am sure he would be a better and more active manager than me. > > Cheers, > Farsheed Ashou

Re: [Maya-Python] Running chain of scripts from different files

2013-09-13 Thread Justin Israel
I have a couple suggestions that might help, specifically in this situation, and also to prevent some future frustrations. Some of it is just Maya-scripting related and some of it is Python idiom: http://pastebin.com/yR5PXwG3 It is a lot easier to use functools.partial for passing a callback to

Re: [Maya-Python] Question about masking method by an object

2013-09-13 Thread Justin Israel
I'm not 100% clear on the intent of the code, but if you are trying to discourage users from replacing existing attributes on the instance, you could try and catch it all in the __setattr__ of the class: class Bunch(object): def __init__(self, *args, **kwargs): for key, value in kwar

Re: [Maya-Python] Running chain of scripts from different files

2013-09-14 Thread Justin Israel
Not sure what this would do: >cbk = > partial(module+'.'+function,float_name,attributes,lightsAll,lightsSel) Where does 'module' and 'function' come from and how to you determine what you are passing? partial() is expecting a callable as the first argument, but you are passing something th

Re: [Maya-Python] Running chain of scripts from different files

2013-09-14 Thread Justin Israel
Yea thats an issue with the usage of partial in this cirumstance. partial() creates a closure over the parameters that you pass. That means the light list you give it, is the light list. If your function needs to get the list of lights every time it is evaluated then you will want to direct it t

Re: [Maya-Python] Question about masking method by an object

2013-09-14 Thread Justin Israel
I was going to suggest slots as well when I first started reading the question, but it appeared Matthew wanted to be able to protect existing API from being replaced. Slots would still allow the defined attributes to be assigned to, while preventing any new api from being added. On Sun, Sep 15,

Re: [Maya-Python] Running chain of scripts from different files

2013-09-15 Thread Justin Israel
Awesome! Nice work. On Sun, Sep 15, 2013 at 6:49 PM, Daz wrote: > All sorted. I rewrite my UI and it behaves how I expected now :) > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group

Re: [Maya-Python] How reliable is SQLite in production?

2013-09-16 Thread Justin Israel
Is your application running queries against the data, or simply retrieving a payload of rig data for a given key? On Tue, Sep 17, 2013 at 4:09 PM, Joe Weidenbach wrote: > John, > > Are there any other decent cross-platform embedded solutions? In my case, > this is a distributed project, so it

Re: [Maya-Python] How reliable is SQLite in production?

2013-09-17 Thread Justin Israel
#x27;s > going to be managing studio-wide settings and preferences. I was planning > on using sqlite for the single-user version, and MySQL for the enterprise. > Is that the wrong approach? > > > On 9/16/2013 9:35 PM, Justin Israel wrote: > > Is your application running queries

Re: [Maya-Python] Re: Ensuring one window in PyQt

2013-09-17 Thread Justin Israel
The only thing I might add to that is to use deleteLater() instead of close(), unless you are using the "delete on close" widget attribute for your window. What can happen is that even though you replace the python symbol with a new window, the fact that you are parenting it to the Maya main window

Re: [Maya-Python] Re: Accessing Embedded MayaUI objects in PyQt

2013-09-17 Thread Justin Israel
My 2cents is that it ends up being more of a pain to try and mix the two (PyQt and Maya UI) and I would go with one or the other. The only time I mess with Maya UI from PyQt is when i want to embed some existing type of specialized Maya UI component, like a viewport. The documentation for the Maya

[Maya-Python] Re: PySide Menus like Maya Menus

2013-09-18 Thread Justin Israel
Seems like you are on the right path to implementing that solution. Here are a couple adjustments that might help: http://pastebin.com/tscd7LTk First off, I think there is a bug in the menu not properly responding to a QWidgetAction trigger. The docs say your custom widget should be calling that

Re: [Maya-Python] Maya 2014 and Qt problems with getting it to run...very newbie

2013-09-20 Thread Justin Israel
Hi Shannon, First thing you will want to do is ditch python3. its not really of any use to you when developing for Maya, since Maya is only on python 2.x anyways. The trick with using PyQt/PySide for Maya is that it needs to be compiled against the same binary compatible version of Qt that ship

Re: [Maya-Python] Camera Frustum

2013-09-20 Thread Justin Israel
You can use the API to perform the programmatic equivalent of a marquee selection across the entire active viewport: import maya.cmds as cmds import maya.OpenMaya as om import maya.OpenMayaUI as mui view = mui.M3dView.active3dView() x = view.portWidth() y = view.portHeight() om.MGlobal.selectFro

Re: [Maya-Python] Question about the code

2013-09-21 Thread Justin Israel
Seems like that approach will work just fine, aside from a couple small adjustments: In your add_coconut method, you will want to be checking for an instance of Coconut, instead of Inventory. You could also increase the efficiency of your total_weight() method by tracking the weight from insid

Re: [Maya-Python] Question about the code

2013-09-21 Thread Justin Israel
ct of the stack, how to use > __repr__ for > this case, I know the way for the string type but not for the list type. > > Thanks again!! > > Matt > > > On Sat, Sep 21, 2013 at 7:35 PM, Justin Israel wrote: > Seems like that approach will work just fine, aside

Re: [Maya-Python] Question about the code

2013-09-21 Thread Justin Israel
Any time! On Sep 22, 2013, at 4:33 PM, matthew park wrote: > Thank you so much Justin, now I am gonna walk through myself, and make the > concept clear of my head. > > As always, Thanks again ! > > Matt, > > > On Sat, Sep 21, 2013 at 9:24 PM, Justin Israel

Re: [Maya-Python] Question about the code

2013-09-21 Thread Justin Israel
.append(name.weight) > > def total_weight(self) > totalWeight = sum(self.__weights) > return totalWeight > > > Thanks! > > Matt, > > > On Sat, Sep 21, 2013 at 9:38 PM, Justin Israel wrote: > >> Any time! >> >> On Sep 22, 2013

Re: [Maya-Python] Question about the code

2013-09-21 Thread Justin Israel
Forgive my crappy/limited reply formatting. Replying mobile ;-) On Sep 22, 2013 6:09 PM, "Justin Israel" wrote: > Actually just store a float and add to it as you add a coconut. Because > storing a bunch of loose floats probably isnt as useful > > # add coconut >

Re: [Maya-Python] Accessing pyNode from QtreeWidget

2013-09-22 Thread Justin Israel
Why does the object need to be serialized to json? Can't you just store your object as data directly? Also, you could subclass QTreeWidgetItem and store a custom item in the tree. On Sep 22, 2013 11:39 PM, "shapeofmotion" wrote: > Hi, > First off thanks for a great forum! > > I am using the pysid

Re: [Maya-Python] Accessing pyNode from QtreeWidget

2013-09-24 Thread Justin Israel
3 10:02:07 PM UTC+2, Justin Israel wrote: >> Why does the object need to be serialized to json? Can't you just store your >> object as data directly? >> >> Also, you could subclass QTreeWidgetItem and store a custom item in the >> tree. >> >> On Sep

Re: [Maya-Python] Accessing pyNode from QtreeWidget

2013-09-24 Thread Justin Israel
On Sep 24, 2013, at 9:01 PM, Justin Israel wrote: > # Now fetch it back out again by row, column > item = tree.itemAt(0, col) > print item.data(0, OBJECT_ROLE) > # <__main__.MyCustomType at 0x103f1d090> Clarification: item.data(col, OBJECT_ROLE) Each item represents the data

Re: [Maya-Python] Accessing pyNode from QtreeWidget

2013-09-24 Thread Justin Israel
Quite welcome. Do you mean the other posts of this same thread? No need. Its a forum and provides a nice context and archive of the conversation :-) Welcome! On Sep 24, 2013, at 9:38 PM, shapeofmotion wrote: > Super!! > Thank you so much! short, sweet and correct :) > > ( being quite new to th

Re: [Maya-Python] Abridged summary of python_inside_maya@googlegroups.com - 2 Messages in 2 Topics

2013-09-25 Thread Justin Israel
mand >> >> >>import maya.cmds as mc >> >>mc.particle(e=True, order=num, >> ...more<http://groups.google.com/group/python_inside_maya/msg/3be32c30bfa060a6> >> >>Back to top. <#1415531fc4e498c1_1414c3dc7deb9c7a_digest_top> >> >

Re: [Maya-Python] Getting the qt designer working with Pyside Maya 2014

2013-09-30 Thread Justin Israel
Not sure off hand why it doesn't work, but as a side note, this is kind of the reason why I always preferred to just use pyside-uic / pyuic to convert the ui files. Then there is no converting and parsing going on at runtime. You would normally do the same thing anyways (at least I do) with resourc

Re: [Maya-Python] Getting the qt designer working with Pyside Maya 2014

2013-09-30 Thread Justin Israel
a simple running example please? > > Thank you > > > On Tue, Oct 1, 2013 at 3:30 PM, Justin Israel wrote: > >> Not sure off hand why it doesn't work, but as a side note, this is kind >> of the reason why I always preferred to just use pyside-uic / pyuic to >> conv

Re: [Maya-Python] Regex help please?

2013-10-01 Thread Justin Israel
You can use a single regular expression, with capture groups: In [1]: import re In [2]: path = r'P:\foo\bar\biz\scene\ch01\seq001\s0090\anim\foo\bar\biz' In [3]: match = re.search(r'(ch\d{2})\\(seq\d{3})\\(s\d{4})', path) In [4]: if match: ...: print match.groups() ...: ('ch01',

[Maya-Python] Group is now Public-Viewable

2013-10-01 Thread Justin Israel
Hi Everyone! I just wanted to let you all know that I have made a change to the group settings, to allow the forum to be public-viewable. There is so much great information collected here that I figured it would be a disservice not to make it available to Google searches and "stumble-upons".

[Maya-Python] Collecting resources for a sticky post

2013-10-05 Thread Justin Israel
There are a ton of great resources that flow through the forum and I thought it would be really helpful to collect them into a sticky post that remains at the top all the time. For instance, most recently mentioned was http://mayamel.tiddlyspot.com/ I figure it could be organized in ways like:

Re: [Maya-Python] Re: Collecting resources for a sticky post

2013-10-06 Thread Justin Israel
It could be part of the same sticky if its just a list with doc links, and a few words describing them. On Oct 7, 2013 8:29 AM, "Ævar Guðmundsson" wrote: > Great idea Justin! > > Just to chip in a couple of pence, initial though was of course no > person should get crackin in python without kno

RE: [Maya-Python] Re: Collecting resources for a sticky post

2013-10-06 Thread Justin Israel
thon.org/2/library/pickle.html > > ** ** > > ** ** > > ** ** > > *From:* python_inside_maya@googlegroups.com [mailto: > python_inside_maya@googlegroups.com] *On Behalf Of *Justin Israel > *Sent:* 06 October 2013 20:51 > *To:* python_inside_maya@googlegroups.com >

Re: [Maya-Python] Re: Collecting resources for a sticky post

2013-10-06 Thread Justin Israel
Not sure its debatable: http://docs.python.org/2/library/commands.html "Deprecated since version 2.6: The commands module has been removed in Python 3. Use the subprocess module instead." subprocess was meant to replace all the other various approaches to spawning (os, commands, ...). Best to adv

[Maya-Python] [Sticky] Links and Resources

2013-10-07 Thread Justin Israel
This post is an ongoing collection of useful information flowing through the forum. - Maya Python Refs - Official Python Command Reference (2014) - Maya Python API 2.0

Re: [Maya-Python] Collecting resources for a sticky post

2013-10-07 Thread Justin Israel
mand your archaic machinery and get some feedback. } > > > > On 6 Oct 2013, at 23:15, Justin Israel wrote: > >> Not sure its debatable: http://docs.python.org/2/library/commands.html >> >> "Deprecated since version 2.6: The commands module has been rem

Re: [Maya-Python] Dynamic Interface not working in PyQt

2013-10-07 Thread Justin Israel
I think the problems you are having are related to the approach you are taking to swap the UIs. What you might find to work much better is to design your modular UIs as complete widgets, and your static method (factory method) would return a new instance of the widget. Instead of trying to set a

Re: [Maya-Python] PySide QListWidget of selection with scriptJob

2013-10-07 Thread Justin Israel
The way you are setting up the layout actually looks fine to me. Passing a widget to the constructor of the layout is effectively the same as called widget.setLayout(layout) later, so it would be redundant to add the setLayout call. I do agree that using the global to store the single window insta

Re: [Maya-Python] Installing pyqtSignal via class builder

2013-10-08 Thread Justin Israel
You are right that you can't just assign a pyqtSignal to an instance. It has to be a class attribute so that the metaclass can create the proper plumbing under the hood. Though i am not exactly sure what you need without seeing a bit more of the examples. Are they always QLineEdit widgets and is co

Re: [Maya-Python] Montage/Layout software(editing) for Videos

2013-10-09 Thread Justin Israel
You might want to try this question on Stackoverflow. All I can think of, off the top of my head, is to use Nuke and its python API. On Oct 9, 2013, at 5:52 PM, DayDreamer wrote: > First Thing First : Following Question is not regarding Maya, but I needed > badly. If doesn't suite the group ma

Re: [Maya-Python] Re: Montage/Layout software(editing) for Videos

2013-10-09 Thread Justin Israel
I suppose it could go either way on SO depending on how you format the question. If you asked it the same way you asked here, verbatim, then I don't doubt they would down vote. It probably would have needed to be formatted in a way where you had some code you were attempting against a specific libr

Re: [Maya-Python] Regex help please?

2013-10-09 Thread Justin Israel
No worries. Hope it helped. On Oct 10, 2013 5:08 AM, "Panupat Chongstitwattana" wrote: > Sorry for the late thank you Justin! > > > > On Tuesday, October 1, 2013 5:43:59 PM UTC+7, Justin Israel wrote: >> >> You can use a single regular expression, with ca

<    1   2   3   4   5   6   7   8   9   10   >