Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mayaplugin: maya 2018 needs namespace #265

Closed
takahito-tejima opened this issue Aug 12, 2017 · 5 comments
Closed

mayaplugin: maya 2018 needs namespace #265

takahito-tejima opened this issue Aug 12, 2017 · 5 comments

Comments

@takahito-tejima
Copy link
Contributor

Description of Issue

since maya 2018, OpenMaya API classes have a namespace prefixed such as OpenMaya20180000::MFnMesh
which results in a build error when compiling maya plugin.

Steps to Reproduce

  1. build usd with maya support using maya 2018 or later

System Information (OS, Hardware)

windows, linux

Package Versions

Build Flags

--maya

modifying forward declarations in usdMaya/meshUtil.h as

#include <maya/MTypes.h>
#if MAYA_API_VERSION >= 20180000
OPENMAYA_MAJOR_NAMESPACE_BEGIN
class MFnMesh;
class MString;
OPENMAYA_NAMESPACE_CLOSE
#else
class MFnMesh;
class MString;
#endif

fixes for me.

thanks!

@jtran56
Copy link

jtran56 commented Aug 14, 2017

Filed as internal issue #149756.

@bfloch
Copy link

bfloch commented Aug 26, 2017

Thanks for the hint, @takahito-tejima

For us the compiler was not quite happy until we did this:

#include <maya/MTypes.h>                 
#if MAYA_API_VERSION >= 20180000         
#include <maya/MApiNamespace.h>          
#else                        
class MFnMesh;                           
class MString;                           
#endif      

At least in the current devkit their namespace header does declare all classes with the proper namespaces. This seems to be the preferred way according to the docs:

http://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=__files_GUID_C122F8DA_431C_4094_BA54_60B80495A734_htm


In case someone is doing the build and has issues with Ptex:
Before 2018 we used to link against maya's ptex but now they introduce a namespace like:

Ptex::v2_2::PtexTexture::open(char const*, std::string&, bool) 

We do not have matching headers and since it probably is not a version usd expects we ended up rebuilding Ptex statically with -fPIC and linking the maya variant against the static lib.

Other then this pxrUsd seems to run fine.

Hope someone might find this helpful.

@mattyjams
Copy link
Contributor

Hi all,

@mrawde took care of this with commit af3c97b which is available in the dev branch now. It should be in the next release on master soon.

Let us know if you have any more trouble here. Thanks!

-Matt

@bfloch
Copy link

bfloch commented Sep 20, 2017

Thanks for taking care.

I would like to add some info to Ptex issue:

It seems that the v2_2 namespace was introduced with Ptex 2.1.28.
In their 2018.1 changelog Autodesk mentions this update explicitly, but to our best knowledge it already is included in Maya 2018.

So as long as usd can be build with Ptex 2.1.28 you will be able to use Maya's PTex library.

@sunyab
Copy link
Contributor

sunyab commented Oct 3, 2017

Commit af3c97b was just released in USD 0.8.1, closing this out. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants