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

macOS Sierra 10.12 support, since macOS Sierra supports USD natively it would be great to get this running #60

Closed
CreateTheImaginable opened this issue Sep 18, 2016 · 12 comments

Comments

@CreateTheImaginable
Copy link

macOS Sierra will be released this Tuesday, 9/20 and I have been trying to get this USD build to work with the Golden Master. Since USD is natively supported in macOS Sierra I think it shows tremendous promise. I am already able to do things that I would never be able to do in Collada’s DAE files.

Has anyone gotten this USD build to work in macOS Sierra using the dev branch?

I am stuck on installing and compiling the Qt 4.8 dependancy. I have gotten all the way to Qt 4.8 and tried compiling Qt 4.8.6 with the El Capitan patch here https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch which works but also Apple’s (Quicktime) QTKit framework has been removed in Sierra and I am getting this error…

In file included from ../../../3rdparty/phonon/qt7/quicktimevideoplayer.mm:18:
../../../3rdparty/phonon/qt7/quicktimevideoplayer.h:23:9: fatal error: 'QTKit/QTDataReference.h' file not found

import <QTKit/QTDataReference.h>

    ^

1 error generated.
make[4]: *** [.obj/release-shared/quicktimevideoplayer.o] Error 1
make[3]: *** [release] Error 2
make[2]: *** [sub-qt7-make_default] Error 2
make[1]: *** [sub-phonon-make_default] Error 2
make: *** [sub-plugins-make_default-ordered] Error 2

I should note that both Qt 4.8 and Apple’s (Quicktime) QTKit framework are at end of life and have been deprecated and are no longer being supported. Apple’s QTKit was replaced with AVFoundation. We may have better luck with Qt5 and Pyside2?

There may be other issues here with macOS Sierra? If so, we should track them here and get this USD build working. :-)

It looks like you can install most of the dependancies in macOS Sierra using brew. For example ( http://macappstore.org/cmake-2/ )

Here is my go at it!

1 - brew install cmake
2 - MacOS Sierra - Python 2.7.10 is already installed
3 - brew install boost
4 - brew install openexr
5 - brew install double-conversion
6 - brew install tbb ( This is Intel TBB )
7 - No brew recipe for opensubdiv so...

git clone https://github.com/PixarAnimationStudios/OpenSubdiv
mkdir build
cd build
cmake -D NO_MAYA=1 -D NO_PTEX=1 -D NO_DOC=1
-D NO_OMP=1 -D NO_TBB=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_CLEW=1
-D GLFW_LOCATION="YOUR GLFW INSTALL LOCATION"
..
make

8 - brew install glew
9 - No elegant brew recipe for Open Image IO (oiio) so...

Install Open Image IO (oiio) dependancies - brew install libjpeg libtiff libpng
Download current stable release of oiio - https://github.com/OpenImageIO/oiio/archive/release.zip
unzip oiio-release.zip
cd oiio-release
make

10 - brew install ptex
11 - brew install qt ( Stuck! brew install qt or qt4 fails, also even after trying to directly compile Qt 4.8.6 with the El Capitan patch https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch which works, but Apple's deprecated (Quicktime) QTKit is removed in macOS Sierra and I get the error above... )

@drwave
Copy link

drwave commented Sep 19, 2016

I’ve been building USD since SIGGRAPH on all the various betas of macOS sierra. Here’s what I do:

mkdir ~/Projects/usd/
cd ~/Projects/usd/
git clone https://github.com/PixarAnimationStudios/USD.git https://github.com/PixarAnimationStudios/USD.git
cd USD
git checkout dev
cd ..
git clone https://github.com/vfxpro99/usd-build-club.git https://github.com/vfxpro99/usd-build-club.git
mkdir stage
cd stage
../usd-build-club/build_prerequisites.sh
../usd-build-club/configure.sh Xcode
cmake --build . --target install --config Release

I make sure my PYTHONPATH looks like this:

PYTHONPATH=~/Projects/usd/stage/local/lib/python

and I then can run a python shell and import all the USD libraries, I can run usdcat. Note I have not tried usdview, but I know others have gotten parts of it to work. I’ve been concentrating more on the SceneKit integration part, and making sure that I can link the open source libraries against Objective-C++ Cocoa apps (which works great).

For building a Objective-C++ Cocoa app in Xcode 8, I link the libraries to a Cocoa app and make C++ USD calls in my code. In the Build Phases tab of my app’s target, it looks like this:

In the Build Setting tab I set:

Runpath Search Options:
$(HOME)/Projects/usd/stage/local/lib

Header Search Paths:
$(HOME)/Projects/usd/stage/local/include/
$(HOME)/Projects/usd/stage/include/
$(HOME)/Projects/usd/stage/local/include/OpenEXR
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7

Library Search Paths:
$(HOME)/Projects/usd/stage/pxr/**
$(HOME)/Projects/usd/stage/local/lib

PreProcessor macros:
BUILD_OPTLEVEL_DEV=1
DEBUG=1
BUILD_COMPONENT_SRC_PREFIX=
TF_NO_GNU_EXT=

I’m hoping next week to release some sample code that has several concrete examples of using USD on macOS both with the built-in support via ModelIO and SceneKit as well as linking to the open source version and calling the C++ API directly.

I’m also working on getting the Maya plug-in to work. I’ve got it compiled, linked, and can load it, but still crash when I invoke usdImport or usdExport. Hoping to make some progress on that next week.

Michael B. Johnson
Pixar Animation Studios

@drwave
Copy link

drwave commented Sep 19, 2016

Sorry, didn't realize that replying by email with an image in the mail wouldn't show up. Let me try again here (of course, if Xcode would just let me drag them as text, but it doesn't...):

usdxcodelibraries

@CreateTheImaginable
Copy link
Author

Awesome drwave! Thanks a million for the build instructions, I will try it and let you know how I make out! I wonder could those dynamic libraries theoretically be used without the pain and suffering of compiling?

Also would love to see your usda examples! A working Maya Plugin would also help a lot too.

Especially interested in learning how to do UVs or texture mapping in USD even if it is for a simple cube! The image attached is the UVs on a simple cube but it is an .obj file, would love to figure out how to do that with USD.

Marcus
imaginable.io

uvs-for-obj-cube

box_material

@drwave
Copy link

drwave commented Sep 19, 2016

I think once sierra is out (and maybe wait for a .1) it would make sense for someone to make the libraries available pre-compiled. I know that I'm hoping we can put them all in an umbrella framework (like Cocoa is) so that we could just have folks download "usd.framework" and link against that single bundle, that would have all the dylibs and all the headers.

It's still early days.

@drwave
Copy link

drwave commented Sep 19, 2016

re: shading (which uv texture mapping is just the teeniest sliver of), I think folks want to get Hydra up and running on all three main platforms (Linux, Mac, and Windows) so we can have a single platform that will take USD files w/shading information and render them consistently.

Folks are making progress on all fronts, so hopefully soon (temporal units left purposely vague :-))

@spiffmon
Copy link
Member

Marcus,
Regarding uv's... uvsets are just primvars of float2-array type in USD. For example, to make a uvset called "uv" for your cube mesh, you mind do something like (where 'mesh' is a UsdGeom.Mesh schema object):
uvs = mesh.CreatePrimvar('uv', Sdf.ValueTypeNames.Float2Array, UsdGeom.Tokens.faceVarying)

The USD maya plugins will export any uvsets you craft, in this manner

@drwave
Copy link

drwave commented Sep 19, 2016

As will the SketchUp exporter, since we’re talking Macintosh…

You can take a look at the USD file, since it writes out the ASCII version.

On Sep 18, 2016, at 9:04 PM, F. Sebastian (spiff) Grassia notifications@github.com wrote:

Marcus,
Regarding uv's... uvsets are just primvars of float2-array type in USD. For example, to make a uvset called "uv" for your cube mesh, you mind do something like (where 'mesh' is a UsdGeom.Mesh schema object):
uvs = mesh.CreatePrimvar('uv', Sdf.ValueTypeNames.Float2Array, UsdGeom.Tokens.faceVarying)

The USD maya plugins will export any uvsets you craft, in this manner


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #60 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABmgOuWW979_jBWd9PjbB-cbwmmi6D8Hks5qrgmwgaJpZM4J_5GJ.

@CreateTheImaginable
Copy link
Author

Yes, I am very curious about the fast Hydra renderer! I think it needs OpenGL 4.4 and Apple tends to lag behind, from what I understand even MacOS Sierra is only OpenGL 4.3. I could be wrong?

Although, I do have usdview working in a Parralles Desktop Virtual Machine (VM) running CentOS 7 and I believe the VM version of CentOS 7 only supports OpenGL 2.1. Alembic animations are working and everything! Of course Hydra shows it is disabled.

[parallels@centos-7-vm-shared USD]$ glxinfo | grep "OpenGL version"
OpenGL version string: 2.1 ATI-1.42.15

box-animation

@jtran56
Copy link

jtran56 commented Sep 19, 2016

Filed as internal issue #137520.

@drwave
Copy link

drwave commented Feb 7, 2017

So the original question here was getting a version of qt4 and PySide on Sierra. I have not found a brew recipe for it, but it does seem that using Mac ports (www.macports.org) you can install qt4 and pyside with:

sudo port install qt4-mac
sudo port install py27-pyside

@meshula
Copy link
Member

meshula commented Feb 8, 2017

Similarly, I've been using brew to install qt and pyside, although it's not an official brew recipe. You have to pay attention to the output of each step because the installation process with brew is not fully automatic, and it'll prompt you to do extra things. The mac ports method seems much simpler.

brew install cartr/qt4/qt
brew install cartr/qt4/pyside
brew install cartr/qt4/pyside-tools  

@sunyab
Copy link
Contributor

sunyab commented May 29, 2018

I've been building USD successfully on macOS Sierra and High Sierra for some time now using the shipped build script.

Regarding the Qt/PySide issues: the PySide folks now publish wheels for PySide2 builds, so installing the 'special' Qt4/PySide build via brew is no longer necessary. I've verified that installing PySide2 via pip per the instructions at https://wiki.qt.io/Qt_for_Python/GettingStarted works great for USD. The build script now directs users towards this method as of commit 65e77fc. Note that there are still pending issues with getting Hydra support on macOS -- see #430.

So, I think the original issue here about getting USD functional on macOS has been resolved. I'm going to close this issue out; please file new issues for any other problems that are encountered. 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

6 participants