Notifications
Clear all

[Closed] Python and PyQt in 3dsMax

Right now its all PyQt, quick prototyping, but if at any point we want to make it faster it’ll be easy to port to C++

just wanted to drop a line saying how cool this is. i haven’t had much of a need to learn python since max doesn’t natively support it, but having this is really awesome and opens a lot of doors, very exciting for our pipeline here.

i used to live near you guys in venice and always wondered what was happening upstairs late at night when the lights were on, and now i know. i’m sure the brig loves you guys.

as a question that might actually contribute to the thread – do you guys have any issues distributing to lots of users internally? with 5 seperate installers, i foresee our artists getting easily confused with what to do when things change. i suppose the installers could be packaged up but i was curious to see if you guys had a fancy way to distribute and guarantee everyone is working with latest versions.

We actually use our render farm software to manage our installations.

We send out batch jobs through our job queue that have highest priority over render jobs so that when an artist slaves their box, the installer runs first.

We just make a variety of batch files to say what version of what software upgrade we want to run at any given time, tag whichever hosts we want to install on and ship off a job to get it done.

Since this is involving DLLs that max locks down, it works perfectly, because we don’t allow a Max session to be running when we run our render farm slave, it ensures that the plugins can be properly written and will occur during an artists preferred time.

If we have to force something out through the studio immediately, we just send an email in conjunction with the job asking people to slave their boxes as soon as possible.

Next step we’re working on is a centralized way to update the database on a per box basis to know what version of what software is installed on any given box, so we can see if a user has or has not slaved/been updated easily.

Hi,

I am trying to get Py3dsmax to run, but it fails…
XP32 – 3dsmax 2009

here is what I did:

installed Python 2.4.4 (python-2.4.4.msi)
installed Qt (qt-win-opensource-4.5.3-mingw.exe)
installed Blur Dlls (qt_install_4.5.2-1_win32-msvc2008.exe)
installed Blur PyQt (PyQt4-gpl-snapshot-20090412_win32-msvc2008.exe)
installed Blur Libs (blur_libs_install_8851_win32-msvc2008.exe)
installed Blur Python (blur_pyqt_modules_install_8851_win32-msvc2008.exe)
installed Py3dsMax (Py3dsMax2009_python24_x32_install_8678.exe)

When I launch Max, I get the following error:

MAXScript Mini ListenerTraceback (most recent call last):
    File "D:\3D\3ds Max 2009\scripts\python/__startup__.py", line 12, in ?
  	import blur.wingui
    File "C:\Python24\lib\site-packages\blur\wingui\__init__.py", line 22, in ?
  	from PyQt4.QtCore			import QCoreApplication
  ImportError: DLL load failed: The specified procedure could not be found.
  -- Error occurred in anonymous codeblock; filename: D:\3D\3ds Max 2009\scripts\startup\__init_py__.ms; position: 2473
  --  Frame:
  --   runScriptACT: undefined
  --   newScriptACT: undefined
  --   menuBar: undefined
  --   subMenuIndex: undefined
  --   openScriptACT: undefined
  --   loggerACT: undefined
  --   scriptPath: "D:\3D\3ds Max 2009\scripts\python"
  --   pyMenu: undefined
  --   subMenuACT: undefined
  -- Error occurred during fileIn in <File:D:\3D\3ds Max 2009\scripts\startup\__init_py__.ms>
  >> MAXScript Auto-load Script Error - D:\3D\3ds Max 2009\scripts\startup\__init_py__.ms Exception: -- Runtime error: Python Exception: Traceback printed in listener. <<
  

What Am I doing wrong ?

Just makin’ sure: do you have Pyqt in this folder? C:\Python24\lib\site-packages
Also, If you open python 2.4 (just run python from that python folder) and you type import PyQt4 or import blur does it give you an error?

Also, if you just type ” python ” into the maxscript listener does that come back with anything? –If not that means the plugin wasn’t copied to the right location (check c:\max2009 or similar (and make sure the plugin is loading) I don’t think it’s this because I think it usually just says Blur Python Not Loaded on startup, not error like that… but thought I’d throw it in anyway.

Hey – that sounds like your setup is not finding the Qt DLLs in your PATH environment variables – you should make sure that c:/blur/common is in your PATH and it comes before any other Qt path information

Hi,

C:\blur\common is 1st in PATH environment variable
(there isn’t any other Qt path information)

in C:\Python24\Lib\site-packages
I have 2 folders
blur
PyQt4

The plugin loads fine

When I type ‘python’ in the listener, I get the struct:
#Struct:python(
run:<fn>,
exec:<fn>,
reload:<fn>,
import:<fn>)

 Directory of C:\Python24\Lib\site-packages
 
 31/10/2009  11:03	<DIR>		  .
 31/10/2009  11:03	<DIR>		  ..
 31/10/2009  11:41	<DIR>		  blur
 31/10/2009  11:10	<DIR>		  PyQt4
 31/10/2009  11:03			48,361 pyqt_uninstall.exe
 28/10/2005  20:15			   121 README.txt
 18/07/2009  00:32			55,808 sip.pyd
 			   3 File(s)		104,290 bytes
 			   4 Dir(s)   2,642,333,696 bytes free
 
 C:\Python24\Lib\site-packages>python
 Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import PyQt4
 >>> import blur

When I type ‘import PyQt4’, no errors show up,
When I type ‘import blur’, I get an error messagebox:
python.exe – Entry Point Not Found
The procedure entry point ??BQByteRef@@QBE?BDXZ could not be located in the dynamic link library QtCore4.dll

Am pretty much lost…

Whenever I try to execute this script, Python closes down without any warnings or errors (came from Blur’s PyQt and 3dsMax tutorials) :

# Use the blur.wingui package vs. the default PyQt4 packages for windows and dialogs
 # because these items contain 3dsMax specific code needed to run
 
 from blur.wingui import Dialog
 from PyQt4.QtGui import QPushButton
 
 # Create the dialog
 dialog = Dialog()
 button = QPushButton( dialog )
 button.setText( 'Test' )
 
 # Launch the dialog
 dialog.show()

I’m using Python 2.6. I’m able to import blur and PyQt4 modules no problem, so not too sure why it’s crashing on me like that. Any ideas?

2 Replies
(@solitude)
Joined: 11 months ago

Posts: 0

How are you trying to exec the script? Just via python.exec() or do you actually have the script editor opening in max? –I’m sure Eric is right, especially since he wrote it, but I’m just thinking that the python logger and script editor inside of max wouldn’t come up if you’re getting those errors anyway, and just wanted to narrow it down.

(@system)
Joined: 11 months ago

Posts: 0

…Farnsworth! shakes fist

I figured it out, it was my mistake. I was executing it from Python’s Idle instead from max :). Actually, should the dialog still show up when executing from Python though?

The python script editor within Max is really cool, Eric! I do get an error message when trying using ‘open script…’, but I’m going to check out the known issues in the blur wiki to see if I can figure it out. The error reads:

Traceback (most recent call last):
    File "<string>", line 1, in ?
    File "C:\Python24\lib\site-packages\blur\wingui\__init__.py", line 83, in openScript
  	fileName = str( QFileDialog.getOpenFileName( PyQWinHook.core, 'Open Script File', LAST_FILENAME, 'Python Files (*.py);;All Files (*.*)' ) )
  NameError: global name 'PyQWinHook' is not defined

Anyhow, this is really cool stuff. Excited to get into it.

EDIT: Did what it said in the known issues document, and presto, it now works.

you guys are all running into the DLLs not loading properlly – whenever you hit a problem like this, could you just create an issue on the blur-dev.googlecode.com website so we have them tracked? You’ll also be asked for OS versions, max versions, python versions etc. so we can debug.

That way we don’t bog down the thread w/ issue requests – thanks guys! Sorry for the errors – we’ll look into them soon as we can.

Labbe!!! Shakes fist back at you

I think the blur module calls specific stuff for 3ds max, but I don’t see why there wouldn’t be a way to get the gui to come up outside of max anyway, but with that, I’m guessing that it might take a little bit of work to get it working outside of max. That should def be an option though, especially for something a little more cross platformish that won’t necessarily run inside of max. I’m sure there’s an easy enough way to code the gui to call blur.wingui if running inside of max, but call regular ol’ pyqt dialogs and windows otherwise. Not sure… Eric is the masta… he’ll know.

Page 7 / 17