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

OIIO as plugin for glf #1214

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions pxr/imaging/glf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ if (PXR_ENABLE_PTEX_SUPPORT)
list(APPEND optionalIncludeDirs ${PTEX_INCLUDE_DIR})
endif()

set (optionalCppFiles "")
set (plugInfo plugInfo_NoOIIO.json)
if (PXR_BUILD_OPENIMAGEIO_PLUGIN)
set (plugInfo plugInfo.json)
list(APPEND optionalCppFiles oiioImage.cpp)
list(APPEND optionalLibs ${OIIO_LIBRARIES} ${OPENEXR_LIBRARY})
list(APPEND optionalIncludeDirs ${OIIO_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS})
endif()

if (PXR_ENABLE_OPENVDB_SUPPORT)
list(APPEND optionalPublicClasses vdbTextureData)
list(APPEND optionalLibs ${OPENEXR_Half_LIBRARY} ${OPENVDB_LIBRARY})
Expand Down Expand Up @@ -104,7 +95,6 @@ pxr_library(glf
stb/stb_image_write.h

CPPFILES
${optionalCppFiles}
stbImage.cpp

PYTHON_CPPFILES
Expand All @@ -127,7 +117,7 @@ pxr_library(glf
__init__.py

RESOURCE_FILES
${plugInfo}:plugInfo.json
plugInfo.json
shaders/ptexTexture.glslfx
shaders/pcfShader.glslfx
shaders/simpleLighting.glslfx
Expand Down
7 changes: 1 addition & 6 deletions pxr/imaging/glf/plugInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
{
"Info": {
"ShaderResources": "shaders",
"Types": {
"Glf_OIIOImage" : {
"bases": ["GlfImage"],
"imageTypes": ["exr", "tif", "zfile", "tx"],
"precedence": 0
},
"Types": {
"Glf_StbImage" : {
"bases": ["GlfImage"],
"imageTypes": ["bmp", "jpg", "jpeg", "png", "tga", "hdr"],
Expand Down
31 changes: 0 additions & 31 deletions pxr/imaging/glf/plugInfo_NoOIIO.json

This file was deleted.

3 changes: 3 additions & 0 deletions pxr/imaging/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ endif()
if (${PXR_BUILD_PRMAN_PLUGIN} AND "${RENDERMAN_VERSION_MAJOR}" GREATER "22")
add_subdirectory(hdPrmanLoader)
endif()
if (PXR_BUILD_OPENIMAGEIO_PLUGIN)
add_subdirectory(glfOiio)
endif()
29 changes: 29 additions & 0 deletions pxr/imaging/plugin/glfOiio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
set(PXR_PREFIX pxr/imaging)
set(PXR_PACKAGE glfOiio)

if (NOT ${PXR_ENABLE_GL_SUPPORT})
message(STATUS
"Skipping ${PXR_PACKAGE} because PXR_ENABLE_GL_SUPPORT is OFF")
return()
endif()

pxr_plugin(glfOiio
LIBRARIES
ar
arch
gf
glf
tf
${OIIO_LIBRARIES}
${OPENEXR_LIBRARY}

INCLUDE_DIRS
${OIIO_INCLUDE_DIRS}
${OPENEXR_INCLUDE_DIRS}

CPPFILES
oiioImage.cpp

RESOURCE_FILES
plugInfo.json
)
File renamed without changes.
214 changes: 214 additions & 0 deletions pxr/imaging/plugin/glfOiio/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
//
// Copyright 2017 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
// WARNING: THIS FILE IS GENERATED. DO NOT EDIT.
//

#define TF_MAX_ARITY 7
#include "pxr/pxr.h"
#include "pxr/base/arch/defines.h"
#if defined(ARCH_OS_DARWIN)
#include <glob.h>
#include <limits.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <unistd.h>
#include <mach/mach_time.h>
#endif
#if defined(ARCH_OS_LINUX)
#include <glob.h>
#include <limits.h>
#include <sys/param.h>
#include <sys/statfs.h>
#include <unistd.h>
#include <x86intrin.h>
#endif
#if defined(ARCH_OS_WINDOWS)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#include <Windows.h>
#include <intrin.h>
#include <io.h>
#include <boost/preprocessor/variadic/size.hpp>
#include <boost/vmd/is_empty.hpp>
#include <boost/vmd/is_tuple.hpp>
#endif
#include <algorithm>
#include <atomic>
#include <cassert>
#include <cfloat>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fcntl.h>
#include <functional>
#include <initializer_list>
#include <iosfwd>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <math.h>
#include <memory>
#include <mutex>
#include <new>
#include <set>
#include <sstream>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <thread>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <boost/aligned_storage.hpp>
#include <boost/any.hpp>
#include <boost/call_traits.hpp>
#include <boost/functional/hash.hpp>
#include <boost/functional/hash_fwd.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/noncopyable.hpp>
#include <boost/operators.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/expr_iif.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/facilities/expand.hpp>
#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/logical/and.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/seq/filter.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/tuple/to_list.hpp>
#include <boost/preprocessor/tuple/to_seq.hpp>
#ifdef PXR_PYTHON_SUPPORT_ENABLED
#include <boost/python/bases.hpp>
#include <boost/python/class.hpp>
#include <boost/python/converter/from_python.hpp>
#include <boost/python/converter/registered.hpp>
#include <boost/python/converter/registrations.hpp>
#include <boost/python/converter/registry.hpp>
#include <boost/python/converter/rvalue_from_python_data.hpp>
#include <boost/python/converter/to_python_function_type.hpp>
#include <boost/python/def.hpp>
#include <boost/python/def_visitor.hpp>
#include <boost/python/default_call_policies.hpp>
#include <boost/python/dict.hpp>
#include <boost/python/errors.hpp>
#include <boost/python/extract.hpp>
#include <boost/python/handle.hpp>
#include <boost/python/implicit.hpp>
#include <boost/python/list.hpp>
#include <boost/python/module.hpp>
#include <boost/python/object.hpp>
#include <boost/python/object/iterator.hpp>
#include <boost/python/object_fwd.hpp>
#include <boost/python/object_operators.hpp>
#include <boost/python/operators.hpp>
#include <boost/python/overloads.hpp>
#include <boost/python/raw_function.hpp>
#include <boost/python/refcount.hpp>
#include <boost/python/scope.hpp>
#include <boost/python/to_python_converter.hpp>
#include <boost/python/tuple.hpp>
#include <boost/python/type_id.hpp>
#if defined(__APPLE__) // Fix breakage caused by Python's pyport.h.
#undef tolower
#undef toupper
#endif
#endif // PXR_PYTHON_SUPPORT_ENABLED
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/type_traits/has_trivial_assign.hpp>
#include <boost/type_traits/has_trivial_constructor.hpp>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/type_traits/is_abstract.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/unordered_map.hpp>
#include <boost/utility.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/weak_ptr.hpp>
#include <tbb/atomic.h>
#include <tbb/blocked_range.h>
#include <tbb/cache_aligned_allocator.h>
#include <tbb/concurrent_queue.h>
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_for.h>
#include <tbb/parallel_for_each.h>
#include <tbb/spin_mutex.h>
#include <tbb/spin_rw_mutex.h>
#include <tbb/task.h>
#ifdef PXR_PYTHON_SUPPORT_ENABLED
#include "pxr/base/tf/pySafePython.h"
#endif // PXR_PYTHON_SUPPORT_ENABLED
21 changes: 21 additions & 0 deletions pxr/imaging/plugin/glfOiio/plugInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Plugins": [
{
"Info": {
"ShaderResources": "shaders",
"Types": {
"Glf_OIIOImage" : {
"bases": ["GlfImage"],
"imageTypes": ["exr", "tif", "zfile", "tx"],
"precedence": 0
}
}
},
"LibraryPath": "@PLUG_INFO_LIBRARY_PATH@",
"Name": "glfOiio",
"ResourcePath": "@PLUG_INFO_RESOURCE_PATH@",
"Root": "@PLUG_INFO_ROOT@",
"Type": "library"
}
]
}