Skip to content

Commit eb40735

Browse files
committed
Merge pull request #455 from andrewkaufman/h15
Houdini 15 Compatibility
2 parents 4ae9e78 + bad6b26 commit eb40735

18 files changed

+219
-36
lines changed

config/ie/options

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ BOOST_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler,
185185
OPENEXR_INCLUDE_PATH = "/software/tools/include/" + platform + "/OpenEXR/" + openEXRVersion
186186
OPENEXR_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion )
187187
ILMBASE_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion )
188-
GLEW_INCLUDE_PATH = "/software/tools/include/" + platform + "/glew/" + glewVersion + "/GL"
188+
GLEW_INCLUDE_PATH = "/software/tools/include/" + platform + "/glew/" + glewVersion
189189
GLEW_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion )
190190
GLEW_LIB_SUFFIX = "-" + glewVersion
191191

@@ -325,7 +325,7 @@ if targetApp=="houdini" :
325325
PNG_INCLUDE_PATH = "/software/tools/include/" + platform + "/png/" + houdiniReg["pngVersion"]
326326

327327
HOUDINI_ROOT = houdiniReg['location']
328-
HOUDINI_CXX_FLAGS = " ".join( CXXFLAGS ) + ' -DVERSION=\"'+houdiniVersion+'\" -DDLLEXPORT= -D_GNU_SOURCE -DLINUX -DAMD64 -m64 -fPIC -DSIZEOF_VOID_P=8 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DGCC4 -DGCC3 -Wno-deprecated -Wno-reorder'
328+
HOUDINI_CXX_FLAGS = " ".join( CXXFLAGS ) + ' -DVERSION=\"'+houdiniVersion+'\" -DDLLEXPORT= -D_GNU_SOURCE -DLINUX -DAMD64 -m64 -fPIC -DSIZEOF_VOID_P=8 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DGCC4 -DGCC3 -Wno-deprecated -Wno-reorder -std=c++11'
329329
INSTALL_HOUDINILIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_MAJOR_VERSION" )
330330
INSTALL_HOUDINIPLUGIN_NAME = os.path.join( appPrefix, "plugins", "$IECORE_NAME" )
331331
INSTALL_HOUDINIOTL_DIR = os.path.join( appPrefix, "otls" )

include/IECoreHoudini/RATDeepImageReader.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
#ifndef IECOREHOUDINI_RATDEEPIMAGEREADER_H
3636
#define IECOREHOUDINI_RATDEEPIMAGEREADER_H
3737

38+
#include "UT/UT_Version.h"
39+
40+
// We haven't updated deep rat support for the changes in Houdini 15,
41+
// since we're considering dropping deep rat support entirely.
42+
#if UT_MAJOR_VERSION_INT < 15
43+
3844
#include "IMG/IMG_DeepShadow.h"
3945

4046
#include "IECore/CompoundObject.h"
@@ -103,4 +109,6 @@ IE_CORE_DECLAREPTR( RATDeepImageReader );
103109

104110
} // namespace IECoreHoudini
105111

112+
#endif // UT_MAJOR_VERSION_INT
113+
106114
#endif // IECOREHOUDINI_RATDEEPIMAGEREADER_H

include/IECoreHoudini/RATDeepImageWriter.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@
3535
#ifndef IECOREHOUDINI_RATDEEPIMAGEWRITER_H
3636
#define IECOREHOUDINI_RATDEEPIMAGEWRITER_H
3737

38-
#include "IMG/IMG_DeepShadow.h"
3938
#include "UT/UT_Version.h"
4039

40+
// We haven't updated deep rat support for the changes in Houdini 15,
41+
// since we're considering dropping deep rat support entirely.
42+
#if UT_MAJOR_VERSION_INT < 15
43+
44+
#include "IMG/IMG_DeepShadow.h"
45+
4146
#include "IECore/DeepImageWriter.h"
4247

4348
#include "IECoreHoudini/TypeIds.h"
@@ -95,4 +100,6 @@ IE_CORE_DECLAREPTR( RATDeepImageWriter );
95100

96101
} // namespace IECoreHoudini
97102

103+
#endif // UT_MAJOR_VERSION_INT
104+
98105
#endif // IECOREHOUDINI_RATDEEPIMAGEWRITER_H

include/IECoreHoudini/bindings/RATDeepImageReaderBinding.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@
3535
#ifndef IECOREHOUDINI_RATDEEPIMAGEREADERBINDING_H
3636
#define IECOREHOUDINI_RATDEEPIMAGEREADERBINDING_H
3737

38+
#include "UT/UT_Version.h"
39+
40+
#if UT_MAJOR_VERSION_INT < 15
41+
3842
namespace IECoreHoudini
3943
{
4044

4145
void bindRATDeepImageReader();
4246

4347
}
4448

49+
#endif // UT_MAJOR_VERSION_INT
50+
4551
#endif // IECOREHOUDINI_RATDEEPIMAGEREADERBINDING_H

include/IECoreHoudini/bindings/RATDeepImageWriterBinding.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@
3535
#ifndef IECOREHOUDINI_RATDEEPIMAGEWRITERBINDING_H
3636
#define IECOREHOUDINI_RATDEEPIMAGEWRITERBINDING_H
3737

38+
#include "UT/UT_Version.h"
39+
40+
#if UT_MAJOR_VERSION_INT < 15
41+
3842
namespace IECoreHoudini
3943
{
4044

4145
void bindRATDeepImageWriter();
4246

4347
}
4448

49+
#endif // UT_MAJOR_VERSION_INT
50+
4551
#endif // IECOREHOUDINI_RATDEEPIMAGEWRITERBINDING_H

src/IECoreHoudini/FromHoudiniGeometryConverter.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include "CH/CH_Manager.h"
4141
#include "UT/UT_StringMMPattern.h"
42+
#include "UT/UT_Version.h"
4243
#include "UT/UT_WorkArgs.h"
4344

4445
#include "IECore/CompoundObject.h"
@@ -229,6 +230,9 @@ void FromHoudiniGeometryConverter::transferAttribs(
229230
PrimitiveVariable::Interpolation detailInterpolation
230231
) const
231232
{
233+
234+
#if UT_MAJOR_VERSION_INT < 15
235+
232236
// add position (this can't be done as a regular attrib because it would be V4fVectorData)
233237
GA_Range pointRange = geo->getPointRange();
234238
std::vector<Imath::V3f> pData( pointRange.getEntries() );
@@ -239,6 +243,8 @@ void FromHoudiniGeometryConverter::transferAttribs(
239243

240244
result->variables["P"] = PrimitiveVariable( PrimitiveVariable::Vertex, new V3fVectorData( pData, GeometricData::Point ) );
241245

246+
#endif
247+
242248
// get RI remapping information from the detail
243249
AttributeMap pointAttributeMap;
244250
AttributeMap primitiveAttributeMap;
@@ -350,9 +356,9 @@ void FromHoudiniGeometryConverter::transferElementAttribs( const GU_Detail *geo,
350356
}
351357

352358
// check for remapping information for this attribute
353-
if ( attributeMap.count( attr->getName() ) == 1 )
359+
if ( attributeMap.count( name.buffer() ) == 1 )
354360
{
355-
std::vector<RemapInfo> &map = attributeMap[attr->getName()];
361+
std::vector<RemapInfo> &map = attributeMap[name.buffer()];
356362
for ( std::vector<RemapInfo>::iterator rIt=map.begin(); rIt != map.end(); ++rIt )
357363
{
358364
transferAttribData( result, interpolation, attrRef, range, &*rIt );
@@ -440,6 +446,18 @@ void FromHoudiniGeometryConverter::transferAttribData(
440446
default :
441447
{
442448
dataPtr = extractData<V3fVectorData>( attr, range );
449+
450+
#if UT_MAJOR_VERSION_INT >= 15
451+
452+
// special case for rest/Pref since Houdini considers rest Numeric
453+
// but Cortex is expecting it to be Point.
454+
if ( attr->getName().equal( "rest" ) || attr->getName().equal( "Pref" ) )
455+
{
456+
V3fVectorData *restData = IECore::runTimeCast<V3fVectorData>( dataPtr.get() );
457+
restData->setInterpretation( IECore::GeometricData::Point );
458+
}
459+
460+
#endif
443461
break;
444462
}
445463

src/IECoreHoudini/GR_CortexPrimitive.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,27 @@ void GR_CortexPrimitive::resetPrimitives()
129129

130130
void GR_CortexPrimitive::update( RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p )
131131
{
132-
GA_Offset offset = p.geometry.primitiveOffset( m_primId );
133132

134-
const CortexPrimitive *prim = dynamic_cast<const CortexPrimitive *>( p.geometry.getGEOPrimitive( offset ) );
133+
#if UT_MAJOR_VERSION_INT >= 15
135134

135+
GU_DetailHandleAutoReadLock handle( p.geometry );
136+
if ( !handle.isValid() )
137+
{
138+
m_scene = 0;
139+
m_renderable = 0;
140+
return;
141+
}
142+
143+
const GU_Detail *detail = handle.getGdp();
144+
145+
#else
146+
147+
const GU_Detail *detail = &p.geometry;
148+
149+
#endif
150+
151+
GA_Offset offset = detail->primitiveOffset( m_primId );
152+
const CortexPrimitive *prim = dynamic_cast<const CortexPrimitive *>( detail->getGEOPrimitive( offset ) );
136153
if ( !prim )
137154
{
138155
m_scene = 0;

src/IECoreHoudini/RATDeepImageReader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
//
3333
//////////////////////////////////////////////////////////////////////////
3434

35+
#include "UT/UT_Version.h"
36+
37+
#if UT_MAJOR_VERSION_INT < 15
38+
3539
#include "boost/format.hpp"
3640

3741
#include "UT/UT_Matrix.h"
3842
#include "UT/UT_Options.h"
39-
#include "UT/UT_Version.h"
4043

4144
#include "IECore/FileNameParameter.h"
4245

@@ -316,3 +319,5 @@ bool RATDeepImageReader::open( bool throwOnFailure )
316319

317320
return true;
318321
}
322+
323+
#endif // UT_MAJOR_VERSION_INT

src/IECoreHoudini/RATDeepImageWriter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
//
3333
//////////////////////////////////////////////////////////////////////////
3434

35+
#include "UT/UT_Version.h"
36+
37+
#if UT_MAJOR_VERSION_INT < 15
38+
3539
#include "boost/format.hpp"
3640

3741
#include "UT/UT_Matrix.h"
3842
#include "UT/UT_Options.h"
39-
#include "UT/UT_Version.h"
4043

4144
#include "IECore/CompoundParameter.h"
4245
#include "IECore/FileNameParameter.h"
@@ -328,3 +331,5 @@ void RATDeepImageWriter::open()
328331
throw IOException( std::string( "Failed to open file \"" ) + fileName() + "\" for writing." );
329332
}
330333
}
334+
335+
#endif // UT_MAJOR_VERSION_INT

src/IECoreHoudini/ToHoudiniGeometryConverter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,19 @@ void ToHoudiniGeometryConverter::transferAttribValues(
328328
}
329329
else if ( interpolation == pointInterpolation )
330330
{
331+
332+
#if UT_MAJOR_VERSION_INT < 15
333+
331334
// add point attribs
332335
if ( name == "P" )
333336
{
334337
// special case for P
335338
transferP( runTimeCast<const V3fVectorData>( primVar.data.get() ), geo, points );
336339
}
337340
else
341+
342+
#endif
343+
338344
{
339345
try
340346
{
@@ -343,7 +349,17 @@ void ToHoudiniGeometryConverter::transferAttribValues(
343349
// mark rest as non-transforming so it doesn't get manipulated once inside Houdini
344350
if ( name == "rest" || name == "Pref" )
345351
{
352+
353+
#if UT_MAJOR_VERSION_INT >= 15
354+
355+
attrRef.setTypeInfo( GA_TYPE_VOID );
356+
357+
#else
358+
346359
attrRef.getAttribute()->setNonTransforming( true );
360+
361+
#endif
362+
347363
}
348364
}
349365
catch ( std::exception &e )

0 commit comments

Comments
 (0)