39
39
40
40
#include " CH/CH_Manager.h"
41
41
#include " UT/UT_StringMMPattern.h"
42
+ #include " UT/UT_Version.h"
42
43
#include " UT/UT_WorkArgs.h"
43
44
44
45
#include " IECore/CompoundObject.h"
@@ -229,6 +230,9 @@ void FromHoudiniGeometryConverter::transferAttribs(
229
230
PrimitiveVariable::Interpolation detailInterpolation
230
231
) const
231
232
{
233
+
234
+ #if UT_MAJOR_VERSION_INT < 15
235
+
232
236
// add position (this can't be done as a regular attrib because it would be V4fVectorData)
233
237
GA_Range pointRange = geo->getPointRange ();
234
238
std::vector<Imath::V3f> pData ( pointRange.getEntries () );
@@ -239,6 +243,8 @@ void FromHoudiniGeometryConverter::transferAttribs(
239
243
240
244
result->variables [" P" ] = PrimitiveVariable ( PrimitiveVariable::Vertex, new V3fVectorData ( pData, GeometricData::Point ) );
241
245
246
+ #endif
247
+
242
248
// get RI remapping information from the detail
243
249
AttributeMap pointAttributeMap;
244
250
AttributeMap primitiveAttributeMap;
@@ -350,9 +356,9 @@ void FromHoudiniGeometryConverter::transferElementAttribs( const GU_Detail *geo,
350
356
}
351
357
352
358
// check for remapping information for this attribute
353
- if ( attributeMap.count ( attr-> getName () ) == 1 )
359
+ if ( attributeMap.count ( name. buffer () ) == 1 )
354
360
{
355
- std::vector<RemapInfo> &map = attributeMap[attr-> getName ()];
361
+ std::vector<RemapInfo> &map = attributeMap[name. buffer ()];
356
362
for ( std::vector<RemapInfo>::iterator rIt=map.begin (); rIt != map.end (); ++rIt )
357
363
{
358
364
transferAttribData ( result, interpolation, attrRef, range, &*rIt );
@@ -440,6 +446,18 @@ void FromHoudiniGeometryConverter::transferAttribData(
440
446
default :
441
447
{
442
448
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
443
461
break ;
444
462
}
445
463
0 commit comments