Skip to content

Commit 6ab8218

Browse files
Merge pull request #958 from lucienfostier/houdini17.5
Houdini17.5
2 parents 0d0d3dc + d5c85a8 commit 6ab8218

File tree

7 files changed

+70
-28
lines changed

7 files changed

+70
-28
lines changed

SConstruct

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,10 @@ env.Append(
10311031

10321032
# update the include and lib paths
10331033
dependencyIncludes = [
1034-
"-isystem", "$TBB_INCLUDE_PATH",
10351034
"-isystem", "$BOOST_INCLUDE_PATH",
10361035
"-isystem", "$OPENEXR_INCLUDE_PATH",
10371036
"-isystem", "$ILMBASE_INCLUDE_PATH",
1037+
"-isystem", "$TBB_INCLUDE_PATH",
10381038
"-isystem", "$BLOSC_INCLUDE_PATH",
10391039
# we use "OpenEXR/x.h" and they use "x.h"
10401040
"-isystem", os.path.join( "$OPENEXR_INCLUDE_PATH","OpenEXR" ),
@@ -2964,7 +2964,7 @@ if doConfigure :
29642964
###########################################################################################
29652965

29662966
alembicEnv = coreEnv.Clone( IECORE_NAME = "IECoreAlembic" )
2967-
alembicEnvAppends = {
2967+
alembicEnvPrepends = {
29682968
"CXXFLAGS" : [
29692969
"-isystem", "$ALEMBIC_INCLUDE_PATH",
29702970
"-isystem", "$HDF5_INCLUDE_PATH",
@@ -2980,11 +2980,11 @@ alembicEnvAppends = {
29802980
"hdf5$HDF5_LIB_SUFFIX",
29812981
],
29822982
}
2983-
alembicEnv.Append( **alembicEnvAppends )
2983+
alembicEnv.Prepend( **alembicEnvPrepends )
29842984
alembicEnv.Append( CXXFLAGS = "-DIECoreAlembic_EXPORTS" )
29852985

29862986
alembicPythonModuleEnv = pythonModuleEnv.Clone( IECORE_NAME = "IECoreAlembic" )
2987-
alembicPythonModuleEnv.Append( **alembicEnvAppends )
2987+
alembicPythonModuleEnv.Prepend( **alembicEnvPrepends )
29882988

29892989
if doConfigure :
29902990

config/ie/options

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ BLOSC_LIB_SUFFIX = "-" + bloscVersion
267267
USD_INCLUDE_PATH = None
268268
USD_LIB_PATH = None
269269

270-
if usdVersion :
270+
# we are using Sidefx's usd for houdini so we only want to find usd
271+
# when we are not building for houdini.
272+
if usdVersion and targetApp != "houdini":
271273

272274
usdReg = IEEnv.registry["apps"]["usd"][usdVersion][platform]
273275

@@ -338,6 +340,10 @@ if targetApp=="houdini" :
338340
WITH_USD_MONOLITHIC = True
339341

340342
HOUDINI_CXX_FLAGS = " ".join( CXXFLAGS + houdiniReg['compilerFlags'] )
343+
# houdini 17.5 suffix openEXR with _sidefx
344+
if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("17.5") :
345+
ALEMBIC_LIB_SUFFIX = ""
346+
341347
INSTALL_HOUDINILIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_MAJOR_VERSION" )
342348
INSTALL_HOUDINIPLUGIN_NAME = os.path.join( appPrefix, "plugins", "$IECORE_NAME" )
343349
INSTALL_HOUDINIOTL_DIR = os.path.join( appPrefix, "otls" )

contrib/IECoreUSD/src/IECoreUSD/USDScene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ bool USDScene::hasChild( const SceneInterface::Name &name ) const
20582058
{
20592059
pxr::UsdPrim childPrim = m_location->prim.GetChild( pxr::TfToken( name.string() ) );
20602060

2061-
return childPrim;
2061+
return (bool)childPrim;
20622062
}
20632063

20642064
void USDScene::childNames( SceneInterface::NameList &childNames ) const

src/IECoreHoudini/DetailSplitter.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,15 @@ DetailSplitter::Names getNames( const GU_Detail *detail )
174174
}
175175

176176
const GA_Attribute *nameAttr = nameAttrib.getAttribute();
177+
std::vector<int> indexRemap;
177178
/// \todo: replace with GA_ROHandleS somehow... its not clear how, there don't seem to be iterators.
178179
const GA_AIFSharedStringTuple *tuple = nameAttr->getAIFSharedStringTuple();
179-
for( GA_AIFSharedStringTuple::iterator it = tuple->begin( nameAttr ); !it.atEnd(); ++it )
180+
indexRemap.resize( tuple->getTableEntries( nameAttr ), -1 );
181+
int i = 0;
182+
for( GA_AIFSharedStringTuple::iterator it = tuple->begin( nameAttr ); !it.atEnd(); ++it, ++i )
180183
{
181184
allNames.push_back( it.getString() );
185+
indexRemap[it.getIndex()] = i;
182186
}
183187

184188
GA_Offset start, end;
@@ -192,7 +196,7 @@ DetailSplitter::Names getNames( const GU_Detail *detail )
192196
continue;
193197
}
194198

195-
uniqueNames.insert( allNames[index] );
199+
uniqueNames.insert( allNames[indexRemap[index]] );
196200
}
197201
}
198202

src/IECoreHoudini/FromHoudiniGeometryConverter.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,14 @@ DataPtr FromHoudiniGeometryConverter::extractStringVectorData( const GA_Attribut
785785

786786
size_t numStrings = 0;
787787
std::vector<std::string> strings;
788+
std::vector<int> indexRemap;
788789
const GA_AIFSharedStringTuple *tuple = attr->getAIFSharedStringTuple();
789-
for ( GA_AIFSharedStringTuple::iterator it=tuple->begin( attr ); !it.atEnd(); ++it )
790+
indexRemap.resize( tuple->getTableEntries( attr ), -1 );
791+
int i = 0;
792+
for ( GA_AIFSharedStringTuple::iterator it=tuple->begin( attr ); !it.atEnd(); ++it, ++i )
790793
{
791794
strings.push_back( it.getString() );
795+
indexRemap[it.getIndex()] = i;
792796
numStrings++;
793797
}
794798

@@ -800,7 +804,7 @@ DataPtr FromHoudiniGeometryConverter::extractStringVectorData( const GA_Attribut
800804
UT_IntArray handles;
801805
tuple->extractHandles( attr, handles );
802806

803-
size_t i = 0;
807+
i = 0;
804808
bool adjustedDefault = false;
805809

806810
GA_Offset start, end;
@@ -822,7 +826,7 @@ DataPtr FromHoudiniGeometryConverter::extractStringVectorData( const GA_Attribut
822826
}
823827
else
824828
{
825-
indices[i] = index;
829+
indices[i] = indexRemap[index];
826830
}
827831
}
828832
}

test/IECoreHoudini/FromHoudiniPointsConverter.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ def createPoints( self ) :
7575

7676
return points
7777

78+
def createPopNet( self ):
79+
obj = hou.node( '/obj' )
80+
geo = obj.createNode("geo", run_init_scripts=False)
81+
popNet = geo.createNode("dopnet", "popnet" )
82+
popObject = popNet.createNode( "popobject" )
83+
popSolver = popObject.createOutputNode( "popsolver" )
84+
output = popSolver.createOutputNode( "output" )
85+
output.setDisplayFlag( True )
86+
87+
return popNet
88+
7889
# creates a converter
7990
def testCreateConverter( self ) :
8091
box = self.createBox()
@@ -841,8 +852,10 @@ def testObjectWasDeletedFactory( self ) :
841852
def testParticlePrimitive( self ) :
842853
obj = hou.node("/obj")
843854
geo = obj.createNode( "geo", run_init_scripts=False )
844-
popnet = geo.createNode( "popnet" )
845-
location = popnet.createNode( "location" )
855+
popnet = self.createPopNet()
856+
location = popnet.createNode( "poplocation" )
857+
popSolver = popnet.node( "popsolver1" )
858+
popSolver.setInput( 2 , location )
846859
detailAttr = popnet.createOutputNode( "attribcreate", exact_type_name=True )
847860
detailAttr.parm("name").set( "float3detail" )
848861
detailAttr.parm("class").set( 0 ) # detail
@@ -866,7 +879,7 @@ def testParticlePrimitive( self ) :
866879
points = converter.convert()
867880

868881
self.assertEqual( type(points), IECoreScene.PointsPrimitive )
869-
self.assertEqual( points.variableSize( IECoreScene.PrimitiveVariable.Interpolation.Vertex ), 21 )
882+
self.assertEqual( points.variableSize( IECoreScene.PrimitiveVariable.Interpolation.Vertex ), 1043 )
870883
self.assertEqual( points["float3detail"].interpolation, IECoreScene.PrimitiveVariable.Interpolation.Constant )
871884
self.assertEqual( type(points["float3detail"].data), IECore.V3fData )
872885
self.assert_( points["float3detail"].data.value.equalWithRelError( imath.V3f( 1, 2, 3 ), 1e-10 ) )
@@ -882,29 +895,28 @@ def testParticlePrimitive( self ) :
882895

883896
converter = IECoreHoudini.FromHoudiniPointsConverter( add )
884897
points2 = converter.convert()
885-
del points['generator']
886-
del points['born']
887-
del points['source']
888898
self.assertEqual( points2, points )
889899

890900
def testMultipleParticlePrimitives( self ) :
891901

892902
obj = hou.node("/obj")
893903
geo = obj.createNode( "geo", run_init_scripts=False )
894-
popnet = geo.createNode( "popnet" )
895-
fireworks = popnet.createNode( "fireworks" )
904+
popnet = self.createPopNet()
905+
fireworks = popnet.createNode( "popfireworks" )
906+
popSolver = popnet.node("popsolver1")
907+
popSolver.setInput( 2, fireworks )
896908

897-
hou.setFrame( 15 )
909+
hou.setFrame( 28 )
898910
converter = IECoreHoudini.FromHoudiniPointsConverter( popnet )
899911
points = converter.convert()
900912

901913
self.assertEqual( type(points), IECoreScene.PointsPrimitive )
902914
self.assertEqual( points.variableSize( IECoreScene.PrimitiveVariable.Interpolation.Vertex ), 24 )
903-
self.assertEqual( points["accel"].interpolation, IECoreScene.PrimitiveVariable.Interpolation.Vertex )
904-
self.assertEqual( type(points["accel"].data), IECore.V3fVectorData )
905-
self.assertEqual( points["accel"].data.getInterpretation(), IECore.GeometricData.Interpretation.Vector )
915+
self.assertEqual( points["v"].interpolation, IECoreScene.PrimitiveVariable.Interpolation.Vertex )
916+
self.assertEqual( type(points["v"].data), IECore.V3fVectorData )
917+
self.assertEqual( points["v"].data.getInterpretation(), IECore.GeometricData.Interpretation.Vector )
906918
self.assertEqual( points["nextid"].interpolation, IECoreScene.PrimitiveVariable.Interpolation.Constant )
907-
self.assertEqual( points["nextid"].data, IECore.IntData( 25 ) )
919+
self.assertEqual( points["nextid"].data, IECore.IntData( 24 ) )
908920
self.assertTrue( points.arePrimitiveVariablesValid() )
909921

910922
add = popnet.createOutputNode( "add" )

test/IECoreHoudini/FromHoudiniPolygonsConverter.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ def createPoints( self ) :
7474

7575
return points
7676

77+
def createPopNet( self ):
78+
obj = hou.node( '/obj' )
79+
geo = obj.createNode("geo", run_init_scripts=False)
80+
popNet = geo.createNode("dopnet", "popnet" )
81+
popObject = popNet.createNode( "popobject" )
82+
popSolver = popObject.createOutputNode( "popsolver" )
83+
output = popSolver.createOutputNode( "output" )
84+
output.setDisplayFlag( True )
85+
86+
return popNet
87+
7788
# creates a converter
7889
def testCreateConverter( self ) :
7990
box = self.createBox()
@@ -560,8 +571,10 @@ def testObjectWasDeletedFactory( self ) :
560571
def testParticlePrimitive( self ) :
561572
obj = hou.node("/obj")
562573
geo = obj.createNode( "geo", run_init_scripts=False )
563-
popnet = geo.createNode( "popnet" )
564-
location = popnet.createNode( "location" )
574+
popnet = self.createPopNet()
575+
location = popnet.createNode( "poplocation" )
576+
popSolver = popnet.node( "popsolver1" )
577+
popSolver.setInput( 2, location )
565578
detailAttr = popnet.createOutputNode( "attribcreate", exact_type_name=True )
566579
detailAttr.parm("name").set( "float3detail" )
567580
detailAttr.parm("class").set( 0 ) # detail
@@ -579,11 +592,14 @@ def testParticlePrimitive( self ) :
579592
pointAttr.parm("value2").set( 2 )
580593
pointAttr.parm("value3").set( 3 )
581594

595+
particleSystem = pointAttr.createOutputNode( "add" )
596+
particleSystem.parm( "addparticlesystem" ).set( True )
597+
582598
hou.setFrame( 5 )
583-
converter = IECoreHoudini.FromHoudiniPolygonsConverter( pointAttr )
599+
converter = IECoreHoudini.FromHoudiniPolygonsConverter( particleSystem )
584600
self.assertRaises( RuntimeError, converter.convert )
585601

586-
add = pointAttr.createOutputNode( "add" )
602+
add = particleSystem.createOutputNode( "add" )
587603
add.parm( "keep" ).set( 1 ) # deletes primitive and leaves points
588604

589605
m = IECoreHoudini.FromHoudiniPolygonsConverter( add ).convert()

0 commit comments

Comments
 (0)