Skip to content

Commit e9a3354

Browse files
committed
SceneCache OBJs pass fullPathName through when expanding and pushing.
1 parent f2ec600 commit e9a3354

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

include/IECoreHoudini/OBJ_SceneCacheTransform.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -105,6 +105,7 @@ class OBJ_SceneCacheTransform : public OBJ_SceneCacheNode<OBJ_SubNet>
105105
UT_String shapeFilter;
106106
UT_String tagFilterStr;
107107
UT_StringMMPattern tagFilter;
108+
UT_String fullPathName;
108109
};
109110

110111
/// Called by expandHierarchy() and doExpandChildren() when the SceneCache contains an object.

src/IECoreHoudini/OBJ_SceneCacheGeometry.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -97,11 +97,12 @@ void OBJ_SceneCacheGeometry::expandHierarchy( const SceneInterface *scene )
9797

9898
void OBJ_SceneCacheGeometry::pushToHierarchy()
9999
{
100-
UT_String attribFilter, attribCopy, tagFilter, shapeFilter;
100+
UT_String attribFilter, attribCopy, tagFilter, shapeFilter, fullPathName;
101101
getAttributeFilter( attribFilter );
102102
getAttributeCopy( attribCopy );
103103
getTagFilter( tagFilter );
104104
getShapeFilter( shapeFilter );
105+
getFullPathName( fullPathName );
105106
GeometryType geomType = getGeometryType();
106107

107108
UT_PtrArray<OP_Node*> children;
@@ -113,6 +114,7 @@ void OBJ_SceneCacheGeometry::pushToHierarchy()
113114
sop->setAttributeCopy( attribCopy );
114115
sop->setTagFilter( tagFilter );
115116
sop->setShapeFilter( shapeFilter );
117+
sop->setFullPathName( fullPathName );
116118
sop->setGeometryType( (SOP_SceneCacheSource::GeometryType)geomType );
117119
}
118120
}
@@ -135,7 +137,7 @@ void OBJ_SceneCacheGeometry::doExpandGeometry( const SceneInterface *scene )
135137
sopSpace = SOP_SceneCacheSource::Path;
136138
}
137139

138-
UT_String attribFilter, attribCopy, tagFilter, shapeFilter;
140+
UT_String attribFilter, attribCopy, tagFilter, shapeFilter, fullPathName;
139141
getAttributeFilter( attribFilter );
140142
sop->setAttributeFilter( attribFilter );
141143
getAttributeCopy( attribCopy );
@@ -144,6 +146,8 @@ void OBJ_SceneCacheGeometry::doExpandGeometry( const SceneInterface *scene )
144146
sop->setTagFilter( tagFilter );
145147
getShapeFilter( shapeFilter );
146148
sop->setShapeFilter( shapeFilter );
149+
getFullPathName( fullPathName );
150+
sop->setFullPathName( fullPathName );
147151

148152
sop->setSpace( sopSpace );
149153
sop->setObjectOnly( objectOnly );

src/IECoreHoudini/OBJ_SceneCacheTransform.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -143,6 +143,7 @@ void OBJ_SceneCacheTransform::expandHierarchy( const SceneInterface *scene )
143143
getShapeFilter( params.shapeFilter );
144144
getTagFilter( params.tagFilterStr );
145145
getTagFilter( params.tagFilter );
146+
getFullPathName( params.fullPathName );
146147

147148
if ( params.hierarchy == FlatGeometry )
148149
{
@@ -216,6 +217,7 @@ OBJ_Node *OBJ_SceneCacheTransform::doExpandObject( const SceneInterface *scene,
216217
geo->setAttributeFilter( params.attributeFilter );
217218
geo->setAttributeCopy( params.attributeCopy );
218219
geo->setShapeFilter( params.shapeFilter );
220+
geo->setFullPathName( params.fullPathName );
219221

220222
bool visible = tagged( scene, params.tagFilter );
221223
if ( visible )
@@ -241,6 +243,7 @@ OBJ_Node *OBJ_SceneCacheTransform::doExpandChild( const SceneInterface *scene, O
241243
xform->setAttributeFilter( params.attributeFilter );
242244
xform->setAttributeCopy( params.attributeCopy );
243245
xform->setShapeFilter( params.shapeFilter );
246+
xform->setFullPathName( params.fullPathName );
244247
xform->setInt( pHierarchy.getToken(), 0, 0, params.hierarchy );
245248
xform->setInt( pDepth.getToken(), 0, 0, params.depth );
246249

@@ -342,10 +345,11 @@ void OBJ_SceneCacheTransform::doExpandChildren( const SceneInterface *scene, OP_
342345

343346
void OBJ_SceneCacheTransform::pushToHierarchy()
344347
{
345-
UT_String attribFilter, attribCopy, shapeFilter;
348+
UT_String attribFilter, attribCopy, shapeFilter, fullPathName;
346349
getAttributeFilter( attribFilter );
347350
getAttributeCopy( attribCopy );
348351
getShapeFilter( shapeFilter );
352+
getFullPathName( fullPathName );
349353
GeometryType geometryType = getGeometryType();
350354

351355
UT_String tagFilterStr;
@@ -361,6 +365,7 @@ void OBJ_SceneCacheTransform::pushToHierarchy()
361365
xform->setAttributeFilter( attribFilter );
362366
xform->setAttributeCopy( attribCopy );
363367
xform->setShapeFilter( shapeFilter );
368+
xform->setFullPathName( fullPathName );
364369
xform->setGeometryType( geometryType );
365370

366371
std::string file;
@@ -387,6 +392,7 @@ void OBJ_SceneCacheTransform::pushToHierarchy()
387392
geo->setAttributeFilter( attribFilter );
388393
geo->setAttributeCopy( attribCopy );
389394
geo->setShapeFilter( shapeFilter );
395+
geo->setFullPathName( fullPathName );
390396
geo->setGeometryType( (OBJ_SceneCacheGeometry::GeometryType)geometryType );
391397

392398
std::string file;
@@ -420,6 +426,7 @@ OBJ_SceneCacheTransform::Parameters::Parameters( const Parameters &other )
420426
shapeFilter = other.shapeFilter;
421427
tagFilterStr = other.tagFilterStr;
422428
tagFilter.compile( tagFilterStr );
429+
fullPathName = other.fullPathName;
423430
}
424431

425432
//////////////////////////////////////////////////////////////////////////////////////////

test/IECoreHoudini/SceneCacheTest.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##########################################################################
22
#
3-
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
3+
# Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions are
@@ -1078,12 +1078,13 @@ def writeDualTaggedSCC( self ) :
10781078

10791079
def testParmTrickleDown( self ) :
10801080

1081-
def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy ) :
1081+
def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy, fullPathName ) :
10821082

10831083
self.assertEqual( node.parm( "geometryType" ).eval(), geoType )
10841084
self.assertEqual( node.parm( "attributeFilter" ).eval(), attribFilter )
10851085
self.assertEqual( node.parm( "attributeCopy" ).eval(), attribCopy )
10861086
self.assertEqual( node.parm( "shapeFilter" ).eval(), shapeFilter )
1087+
self.assertEqual( node.parm( "fullPathName" ).eval(), fullPathName )
10871088
if isinstance( node, hou.ObjNode ) :
10881089
self.assertEqual( node.parm( "expanded" ).eval(), True )
10891090

@@ -1093,40 +1094,44 @@ def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy
10931094
self.assertEqual( node.parm( "tagFilter" ).eval(), "*" )
10941095

10951096
for child in node.children() :
1096-
checkParms( child, geoType, tagFilter, attribFilter, shapeFilter, attribCopy )
1097+
checkParms( child, geoType, tagFilter, attribFilter, shapeFilter, attribCopy, fullPathName )
10971098

10981099
self.writeDualTaggedSCC()
10991100
xform = self.xform()
11001101
xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex )
11011102
xform.parm( "attributeFilter" ).set( "*" )
11021103
xform.parm( "shapeFilter" ).set( "*" )
1104+
xform.parm( "fullPathName" ).set( "fullPath" )
11031105
xform.parm( "expand" ).pressButton()
1104-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "" )
1106+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "", "fullPath" )
11051107

11061108
xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini )
11071109
xform.parm( "attributeFilter" ).set( "P ^N" )
11081110
xform.parm( "attributeCopy" ).set( "P:Pref" )
11091111
xform.parm( "shapeFilter" ).set( "2 ^3" )
1112+
xform.parm( "fullPathName" ).set( "customName" )
11101113
xform.parm( "collapse" ).pressButton()
11111114
xform.parm( "expand" ).pressButton()
1112-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "P:Pref" )
1115+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "P:Pref", "customName" )
11131116

11141117
xform.parm( "hierarchy" ).set( IECoreHoudini.SceneCacheNode.Hierarchy.Parenting )
11151118
xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Cortex )
11161119
xform.parm( "attributeFilter" ).set( "*" )
11171120
xform.parm( "attributeCopy" ).set( "" )
11181121
xform.parm( "shapeFilter" ).set( "*" )
1122+
xform.parm( "fullPathName" ).set( "fullPath" )
11191123
xform.parm( "collapse" ).pressButton()
11201124
xform.parm( "expand" ).pressButton()
1121-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "" )
1125+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "*", "*", "", "fullPath" )
11221126

11231127
xform.parm( "geometryType" ).set( IECoreHoudini.SceneCacheNode.GeometryType.Houdini )
11241128
xform.parm( "attributeFilter" ).set( "P ^N" )
11251129
xform.parm( "attributeCopy" ).set( "v:vIn" )
11261130
xform.parm( "shapeFilter" ).set( "2 ^3" )
1131+
xform.parm( "fullPathName" ).set( "customName" )
11271132
xform.parm( "collapse" ).pressButton()
11281133
xform.parm( "expand" ).pressButton()
1129-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "v:vIn" )
1134+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "*", "P ^N", "2 ^3", "v:vIn", "customName" )
11301135

11311136
# now check just pushing the parms
11321137

@@ -1137,8 +1142,9 @@ def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy
11371142
xform.parm( "attributeFilter" ).set( "P ^N" )
11381143
xform.parm( "attributeCopy" ).set( "P:Pref" )
11391144
xform.parm( "shapeFilter" ).set( "2 ^3" )
1145+
xform.parm( "fullPathName" ).set( "fullPath" )
11401146
xform.parm( "push" ).pressButton()
1141-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "P ^N", "2 ^3", "P:Pref" )
1147+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Cortex, "*", "P ^N", "2 ^3", "P:Pref", "fullPath" )
11421148
self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() )
11431149
self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() )
11441150
self.assertTrue( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() )
@@ -1153,9 +1159,10 @@ def checkParms( node, geoType, tagFilter, attribFilter, shapeFilter, attribCopy
11531159
xform.parm( "attributeFilter" ).set( "P N" )
11541160
xform.parm( "attributeCopy" ).set( "P:Pref v:vIn" )
11551161
xform.parm( "shapeFilter" ).set( "2 3" )
1162+
xform.parm( "fullPathName" ).set( "customName" )
11561163
xform.parm( "tagFilter" ).set( "d" )
11571164
xform.parm( "push" ).pressButton()
1158-
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "d", "P N", "2 3", "P:Pref v:vIn" )
1165+
checkParms( xform, IECoreHoudini.SceneCacheNode.GeometryType.Houdini, "d", "P N", "2 3", "P:Pref v:vIn", "customName" )
11591166
self.assertTrue( hou.node( xform.path()+"/1" ).isObjectDisplayed() )
11601167
self.assertTrue( hou.node( xform.path()+"/1/geo" ).isObjectDisplayed() )
11611168
self.assertFalse( hou.node( xform.path()+"/1/2" ).isObjectDisplayed() )

0 commit comments

Comments
 (0)