Skip to content

Commit 190a2ad

Browse files
committed
Add method for calculating relative path
1 parent fb8905e commit 190a2ad

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Asset.C

+13
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,19 @@ Asset::findObjectById(int id)
608608
return myObjects[id];
609609
}
610610

611+
MString
612+
Asset::getRelativePath(HAPI_NodeId id)
613+
{
614+
HAPI_StringHandle relativePathHandle;
615+
CHECK_HAPI(HAPI_GetNodePath(
616+
Util::theHAPISession.get(),
617+
id,
618+
myNodeInfo.id,
619+
&relativePathHandle
620+
));
621+
return Util::HAPIString(relativePathHandle);
622+
}
623+
611624
void
612625
Asset::resetSimulation()
613626
{

Asset.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Asset {
3333
OutputObject* findObjectById(int id);
3434
HAPI_AssetInfo getAssetInfo() { return myAssetInfo; }
3535
HAPI_NodeInfo getNodeInfo() { return myNodeInfo; }
36+
MString getRelativePath(HAPI_NodeId id);
3637

3738
void resetSimulation();
3839

0 commit comments

Comments
 (0)