cross3d icon indicating copy to clipboard operation
cross3d copied to clipboard

Maya Installation Guide

Open DJDhrub opened this issue 8 years ago • 17 comments

I am very interested in using cross3d. But It seems I am not that tech savvy like everyone. I brief note about how to get this to work with Maya will be helpful. One more thing to know does this work with Maya 2017? Thanks.

DJDhrub avatar Oct 28 '17 12:10 DJDhrub

You can pip install cross3d, to install it in maya you may need to use the --target option so it's importable in maya. However, the current master branch requires using PyQt4, which is somewhat hard to get installed in most DCC's. I made a branch that uses Qt.py to handle the Qt requirements. I will probably use this to address the #3 pull request.

Manual Install There should be a "Python\Lib\site-packages" folder in your Maya install. For example here is the default location on windows: "C:\Program Files\Autodesk\Maya2017\Python\Lib\site-packages" This is where you will copy the modules listed below. There could be other locations you can copy to, they just need to be importable in Maya's python.

Installing Qt.py You will need Qt.py importable in Maya. Download Qt.py and save it with the filename "Qt.py" in your "Python\Lib\site-packages" folder. The version of Qt.py must be Qt.py 1.1.0.b3 or newer(the link is the latest code).

Installing cross3d Download the zip file for the Qt_py branch of cross3d. Open the zip file and inside the cross3d-Qt_py folder there is a cross3d folder, Extract that folder to your "Python\Lib\site-packages" folder.

You should be able to import cross3d and start using it.

MHendricks avatar Oct 28 '17 22:10 MHendricks

Hello! I have done everything as you have asked. Then after starting Maya 2017 what .py file should I open to get the GUI? When I am importing the init.py file in script editor from C:\Program Files\Autodesk\Maya2017\Python\Lib\site-packages\cross3d\maya It shows me this

Error: line 1: ImportError: file line 11: No module named external

Tell me what am I doing wrong? How do I get the cross3d GUI?

DJDhrub avatar Oct 29 '17 14:10 DJDhrub

This api doesn't currently have any gui examples. It's a api to make writing a tool that works in multiple DCC's easier. https://github.com/blurstudio/cross3d#examples has a few examples of using the api, but we haven't had much time to add to them.

The api is setup so you should never need to import from the maya abstraction layer when making tools, you should only need to import and use the cross3d module(C:\Program Files\Autodesk\Maya2017\Python\Lib\site-packages\cross3d). The correct abstract, maya, motionbuilder, softimage, and studiomax module is automatically imported depending on which software you import cross3d inside of.

For example, if you want to create a camera and set its nearcliping plane

from cross3d import Scene
from cross3d.constants import ObjectType, CameraType
scene = Scene()
# Create a camera with the name of "testCamera". `CameraType.Physical` is not used in maya, but is used in studiomax(In Maya it will be ignored).
t = scene.createCamera('testCamera', type = CameraType.Physical)
# Set the near clipping plane and manually verify that it was correctly set.
t.setNearClippingPlane(1.0)
print t.nearClippingPlane()

MHendricks avatar Oct 30 '17 17:10 MHendricks

Hai can you help ,how to open cross 3d in maya2018, i did all, same as you tell, about manual install inside Maya

anooppc avatar Jul 31 '19 06:07 anooppc

Error: ImportError: file C:\Program Files\Autodesk\Maya2018\bin\cross3d\classes\dispatch.py line 10: DLL load failed: The specified module could not be found. #

anooppc avatar Aug 06 '19 10:08 anooppc

Are you using the Qt_py branch of cross3d? It should be using PySide2 for Maya 2018.

I should probably merge that branch as master is hard coded to import PyQt4 which is hard to install and PyQt5 is the only option for modern installs of Maya.

MHendricks avatar Aug 06 '19 18:08 MHendricks

Thanks,,for reply , Im use both cross3d files, PySide2 and PyQt4,

Still, have some issues in Pyside2 file

Error: AttributeError: file C:\Program

Files\Autodesk\Maya2018\Python\lib\site-packages\PySide2_init_.py line 23: type object 'type' has no attribute 'signature' #

Error: RuntimeError: file C:\Program

Files\Autodesk\Maya2018\bin\cross3d\classes\dispatch.py line 88: You can't initialize an object twice! #

[image: site-packages.JPG]

On Wed, Aug 7, 2019 at 2:12 AM Mike Hendricks [email protected] wrote:

Are you using the Qt_py branch of cross3d https://github.com/blurstudio/cross3d/tree/Qt_py? It should be using PySide2 for Maya 2018.

I should probably merge that branch as master is hard coded to import PyQt4 which is hard to install and PyQt5 is the only option for modern installs of Maya.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUFCOMBIMJ2UNYDKDV3QDG5IDA5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3V77HQ#issuecomment-518782878, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUED3WZ6MXTUABQJAFTQDG5IDANCNFSM4EBHWE6A .

anooppc avatar Aug 07 '19 08:08 anooppc

@Annopc you cannot use both. Maya ships with pyside2 but not PyQt by default.

melMass avatar Aug 07 '19 09:08 melMass

@MHendricks I have heard plans on updating this repo to blur's internal cross3d updates? Is this still planned ? Thanks

melMass avatar Aug 07 '19 09:08 melMass

Yes I cant use both, I'm using python 3.5 64bit, its that a problem, im try in 2 computer Dell workstation, PyQt5 file issue

Maya2018\Python\lib\site-packages\cross3d\classes\dispatch.py line 10: DLL load failed: %1 is not a valid Win32 application.

Pyside2 issue

Error: AttributeError: file C:\Program

Files\Autodesk\Maya2018\Python\lib\site-packages\PySide2_init_.py line 23: type object 'type' has no attribute 'signature' #

cross 3d one good production pipeline, it's more helpful for our small production, now we have one that's only for animation but it's not good, what aver Thanks

Thanks anoop.pc

On Wed, Aug 7, 2019 at 5:04 PM Mel Massadian [email protected] wrote:

@MHendricks https://github.com/MHendricks I have heard plans on updating this repo to blur's internal cross3d updates? Is this still planned ? Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUASWDE7KEG63C35J53QDKFZLA5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3XXRKQ#issuecomment-519010474, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUB32GODSVU62G4YC33QDKFZLANCNFSM4EBHWE6A .

anooppc avatar Aug 07 '19 09:08 anooppc

@MHendricks I have heard plans on updating this repo to blur's internal cross3d updates? Is this still planned ?

In the last few months we have started working on updating our code base and installs to pip installs. We are working on updating our code base so all internal development for cross3d will be in this repo. It's a slow process when combined with studio work so I don't know how soon it will happen.

Yes I cant use both, I'm using python 3.5 64bit

I haven't tried to run cross3d in python 3 yet so there could be issues with python 3 compatibility, but that doesn't explain DLL load failed error.

Which Qt.py binding are you using? This code will tell you what Qt binding Qt.py is using.

import Qt
print(Qt.__binding__)

If you have PyQt5 installed for maya Qt is going to default to PySide2 unless you tell it which to use using the QT_PREFERRED_BINDING environment variable. The QT_VERBOSE variable enables printing of lots of debug info on how Qt.py is initialized.

Are you able to import the modules directly? from PyQt5.QtCore import Signal, QObject or from PySide2.QtCore import Signal, QObject

Where did you get a maya compatible PyQt5 build? We compiled our own internally.

MHendricks avatar Aug 07 '19 19:08 MHendricks

i try this Scripts Bouth Computher is fine One PyQt5 qnd onther one Have PySide2

import Qtprint(Qt.binding)

I try this Scripts Bouth Computer is fine One PyQt5 and other one Have PySide2

Are you able to import the modules directly? from PyQt5.QtCore import Signal, QObject or from PySide2.QtCore import Signal, QObject

Yes I can Import from PySide2.QtCore import Signal, QObject have no issue no error coming now

PyQt5 installed python3,5 pip install PyQt5 (this PyQt5 I'm used ) here only

Now running the script (cross3d\maya) init inside Script editor no error coming, But noting will open in Maya, no window or box noting.

I have This Confusion, We need to register the symbol

cross3d.registerSymbol('Scene', AbstractScene, ifNotFound=True)

This code is used to store the AbstractScene class(cross3d.abstract.abstractscene.AbstractScene) in the official cross3d name of cross3d.Scene. 'ifNotFound=True' should only be used in the abstract module. It tells registerSymbol to only register this class if a subclass hasn't already registered for that class.

register the symbol

cross3d.registerSymbol('Scene', StudiomaxScene)

This code is used to store the StudiomaxScene class( cross3d.studiomax.studiomaxscene.StudiomaxScene) in the official cross3d name of cross3d.Scene.

Thanks

Anoop

On Thu, Aug 8, 2019 at 3:10 AM Mike Hendricks [email protected] wrote:

@MHendricks https://github.com/MHendricks I have heard plans on updating this repo to blur's internal cross3d updates? Is this still planned ?

In the last few months we have started working on updating our code base and installs to pip installs. We are working on updating our code base so all internal development for cross3d will be in this repo. It's a slow process when combined with studio work so I don't know how soon it will happen.

Yes I cant use both, I'm using python 3.5 64bit

I haven't tried to run cross3d in python 3 yet so there could be issues with python 3 compatibility, but that doesn't explain DLL load failed error.

Which Qt.py binding are you using? This code will tell you what Qt binding Qt.py is using.

import Qtprint(Qt.binding)

If you have PyQt5 installed for maya Qt is going to default to PySide2 unless you tell it which to use using the QT_PREFERRED_BINDING https://github.com/mottosso/Qt.py#environment-variables environment variable. The QT_VERBOSE variable enables printing of lots of debug info on how Qt.py is initialized.

Are you able to import the modules directly? from PyQt5.QtCore import Signal, QObject or from PySide2.QtCore import Signal, QObject

Where did you get a maya compatible PyQt5 build? We compiled our own internally.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUE64ZGGE7NJZSFLZPTQDMM2RA5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3ZNLBQ#issuecomment-519230854, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUBQ2NJSIGFSYRFVH6LQDMM2RANCNFSM4EBHWE6A .

anooppc avatar Aug 08 '19 05:08 anooppc

@anooppc You should format you answers it is quite hard to read... To my knowledge you can't install pyqt5 this way (using pip install) because Maya depends on Qt and you can't mix Qt versions. You instead have to build Qt in a specific way so it matches Maya's dependency version.

Fauvel's blogpost should point you in the right direction: https://around-the-corner.typepad.com/adn/2019/01/how-to-build-pyqt5-for-autodesk-maya-2019.html

May I ask why you want to use PyQt5 specifically in maya ?

melMass avatar Aug 08 '19 13:08 melMass

May I ask why you want to use PyQt5 specifically in maya ?

NO sir I'm not specifically not use PyQt5, Im trying bouth modules, because I need cross3d pipeline any matter. So that last 2 week,I'm trying to install, this, and studying,

On Thu, 8 Aug 2019, 9:38 pm Mel Massadian, [email protected] wrote:

You should format you answers it is quite hard to read... To my knowledge you can't install pyqt5 this way (using pip install) because Maya depends on Qt and you can't mix Qt versions. You instead have to build Qt in a specific way so it matches Maya's dependency version.

Fauvel's blogpost should point you in the right direction:

https://around-the-corner.typepad.com/adn/2019/01/how-to-build-pyqt5-for-autodesk-maya-2019.html

May I ask why you want to use PyQt5 specifically in maya ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUAUYB7XCXIOFYJVZ2TQDQOT3A5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD33UK6I#issuecomment-519521657, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUCKHMPA6U5UDTEP3OTQDQOT3ANCNFSM4EBHWE6A .

anooppc avatar Aug 08 '19 13:08 anooppc

hai , Now scripts all running fine no error coming,

Can you tell how to open cross3d inside the Maya, I try to open Maya __init__py file, but nothing will happen, all Script running without error,

Thanks anoop

On Thu, Aug 8, 2019 at 9:53 PM anoop anu [email protected] wrote:

May I ask why you want to use PyQt5 specifically in maya ?

NO sir I'm not specifically not use PyQt5, Im trying bouth modules, because I need cross3d pipeline any matter. So that last 2 week,I'm trying to install, this, and studying,

On Thu, 8 Aug 2019, 9:38 pm Mel Massadian, [email protected] wrote:

You should format you answers it is quite hard to read... To my knowledge you can't install pyqt5 this way (using pip install) because Maya depends on Qt and you can't mix Qt versions. You instead have to build Qt in a specific way so it matches Maya's dependency version.

Fauvel's blogpost should point you in the right direction:

https://around-the-corner.typepad.com/adn/2019/01/how-to-build-pyqt5-for-autodesk-maya-2019.html

May I ask why you want to use PyQt5 specifically in maya ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUAUYB7XCXIOFYJVZ2TQDQOT3A5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD33UK6I#issuecomment-519521657, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUCKHMPA6U5UDTEP3OTQDQOT3ANCNFSM4EBHWE6A .

anooppc avatar Aug 09 '19 04:08 anooppc

You don't interact with the maya module directly(cross3d\maya\__init__.py). The software implementation modules are handled internally by the api.

Almost everything you use is accessed directly from the cross3d module.

import cross3d
# Create a scene object. Used 
scene = cross3d.Scene()
# iterate over the objects in the scene
for obj in scene.objects():
    print(obj)
# iterate over the selection
for obj in scene.selection():
    print(obj)
# create a new camera and query parameters
cam = scene.createCamera('test')
print(cam.fov())
print(cam.filmWidth())

Info about the application can be gotten from cross3d.application.

# inspect the application info
>>> print(cross3d.application.name())
Maya
>>> print(cross3d.application.year())
2019

There are a few more examples in the readme.

It looks like PySide2 doesn't allow you to override the connect method of a QObject, so the Dispatch and Application class will need modified to use a different method name. When using PyQt this makes it so any time a new scene is opened it will print New Scene in python.

def newScene():
    print('New Scene')
# connect the signal to the function
cross3d.dispatch.connect('sceneInvalidated', newScene)
# To disconnect the signals
cross3d.dispatch.disconnect('sceneInvalidated', newScene)

MHendricks avatar Aug 10 '19 02:08 MHendricks

Ok Thanks,..........

On Sat, Aug 10, 2019 at 10:22 AM Mike Hendricks [email protected] wrote:

You don't interact with the maya module directly(cross3d\maya_init_.py). The software implementation modules are handled internally by the api.

Almost everything you use is accessed directly from the cross3d module.

import cross3d# Create a scene object. Used scene = cross3d.Scene()# iterate over the objects in the scenefor obj in scene.objects(): print(obj)# iterate over the selectionfor obj in scene.selection(): print(obj)# create a new camera and query parameters cam = scene.createCamera('test')print(cam.fov())print(cam.filmWidth())

Info about the application can be gotten from cross3d.application.

inspect the application info>>> print(cross3d.application.name())

Maya>>> print(cross3d.application.year())2019

There are a few more examples in the readme https://github.com/blurstudio/cross3d#examples.

It looks like PySide2 doesn't allow you to override the connect method of a QObject, so the Dispatch and Application class will need modified to use a different method name. When using PyQt this makes it so any time a new scene is opened it will print New Scene in python.

def newScene(): print('New Scene')# connect the signal to the function cross3d.dispatch.connect('sceneInvalidated', newScene)# To disconnect the signals cross3d.dispatch.disconnect('sceneInvalidated', newScene)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blurstudio/cross3d/issues/4?email_source=notifications&email_token=AMYHAUF4OBGDTI52GPM74PTQDYRADA5CNFSM4EBHWE6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4AEB4Q#issuecomment-520110322, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYHAUDFI7CNUXOR3IVPK2TQDYRADANCNFSM4EBHWE6A .

anooppc avatar Aug 13 '19 01:08 anooppc