Notifications
Clear all

[Closed] Python + MXS

Hi together,

please could anyone support the setup with 3dsMax 2012? Tried it a couple of times, changing the path’s and so on without success.
I use the standard installationpaths.

hey guys, i’m trying to set up whats in the op and i’m getting this error in in python when i try to import win32com.client

  File "C:\Python27\lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: No module named win32api

anyone know whats up with this?

it s a python module

http://code.google.com/p/blur-dev/wiki/Installing

How to get pywin32

Some of our tools will use the pywin32 package for Python, which is a 3rd-party package that can be found here:

pywin32

Direct links to the latest Python24 x32 version are here.

Direct links to the latest Python26 x64 version are here

Here are some instructions to get Python up and running in Softimage if you have not already done so:

[ul]
[li] http://xsisupport.wordpress.com/2010/02/22/getting-python-to-show-up-in-softimage/ [/li]> [/ul]

yeah i have the pywin32 module, its just when i try to import win32com.client it fails, are you syaing i need to install all that blur-dev stuff aswell?

it works now, not sure why it wasn’t before, strange

Hi,
I am trying the Py3dsMax python tool.
I took this max script exemple and try to convert it in python.


        macroScript QuickPreview category:"HowTo"
    
    (
     preview_name = (getDir #preview)+"/quickpreview.avi"
     view_size = getViewSize()
     anim_bmp = bitmap view_size.x view_size.y filename:preview_name
      for t = animationrange.start to animationrange.end do
     (
      sliderTime = t
      dib = gw.getViewportDib()
      copy dib anim_bmp
      save anim_bmp
     )
     close anim_bmp
     gc()
     ramplayer preview_name ""
     )
        

I can’t translate these commands

 anim_bmp = bitmap view_size.x view_size.y filename:preview_name
copy dib anim_bmp
save anim_bmp

in a pythonic syntax.

Does anybody have an idea or some code example for Py3dsMax?

Thanks lucas

Most things are accessible via the mxs module, so you should be able to write that code as:

Maxscript:

anim_bmp = bitmap view_size.x view_size.y filename:preview_name
copy dib anim_bmp
save anim_bmp

Python:

anim_bmp = mxs.bitmap( view_size.x, view_size.y, filename = preview_name )
mxs.copy( anim_bmp )
mxs.save( anim_bmp )

I haven’t actually tested that, but that SHOULD work.

My question is basically as it reads in the title. I’m switching from just Maxscript to Python and Maxscript since I understand Python much more. My question is whether or not the built in object sets and arrays like “objects” or “geometry” are still accessible, and if so, what changes in how they are called? Thanks. You guys are very helpful with trying to figure out MaxScript.

Hi all! There is little question:
I need rotate in XForm gizmo. But I can not do that, tell me what the problem is and how to rotate it? Thank you for your attention.

from Py3dsMax import mxs

for obj in mxs.objects:
     XForm = mxs.pyhelper.namify('XForm') #  set flag
     obj.modifiers[XForm].gizmo.rotation += mxs.quat(0.707107, 0, 0, 0.707107) #  rotate 90"

I solved the problem though not completely in Python. I would like to make it completely in Python.

mxs.addModifier(obj, mxs.XForm())
XForm = mxs.pyhelper.namify('XForm') #  set flag
mxs.execute('max modify mode')
mxs.modPanel.setCurrentObject(obj.modifiers[XForm])
mxs.execute('mod_obj = modPanel.getCurrentObject();gizmo_rotation = mod_obj.gizmo.rotation;mod_obj.gizmo.rotation += quat 0.707107 0 0 0.707107') #  rotate 90"


Page 24 / 26