Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IECoreUSD::PointInstancerAlgo : Support inactive / invisible ids #1437

Open
wants to merge 1 commit into
base: RB-10.5
Choose a base branch
from

Conversation

danieldresser-ie
Copy link
Contributor

This is a pretty naive implementation of loading inactiveIds and invisibleIds as prim vars, but everything seems to work.

Haven't yet used this to recreate the correct behaviour in Gaffer, but all the relevant data seems to be coming through.

Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel - couple of small comments inline. We also need to target this to RB-10.5.

}

pxr::SdfInt64ListOp inactiveIdsListOp;
pointInstancer.GetPrim().GetMetadata( pxr::UsdGeomTokens->inactiveIds, &inactiveIdsListOp );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -86,6 +86,19 @@ IECore::ObjectPtr readPointInstancer( pxr::UsdGeomPointInstancer &pointInstancer
Canceller::check( canceller );
PrimitiveAlgo::readPrimitiveVariable( pointInstancer.GetAngularVelocitiesAttr(), time, newPoints.get(), "angularVelocity" );

DataPtr cortexInvisIds = DataAlgo::fromUSD( pointInstancer.GetInvisibleIdsAttr(), time, true );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to account for the loading of this in pointInstancerMightBeTimeVarying() below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


pxr::SdfInt64ListOp inactiveIdsListOp;
pointInstancer.GetPrim().GetMetadata( pxr::UsdGeomTokens->inactiveIds, &inactiveIdsListOp );
newPoints->variables["inactiveIds"] = IECoreScene::PrimitiveVariable(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, should we avoid making this if the list is empty? Or was never authored? I think we're doing the "never authored" thing for invisibleIds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now added a test that we get only the expected primitive variables, which required fixes for both inactiveIds and invisibleIds.

I'm confused by your comment "I think we're doing the "never authored" thing for invisibleIds?", since invisibleIds is just being added - do you mean that you expected fromUSD to return null for attributes that aren't authored? That isn't happening, I had to explicitly add a check for HasAuthoredValue for invisibleIds. It's kind of weird that this isn't needed for other attributes like angularVelocities - I guess the USD schema defines a fallback for invisibleIds but not for things like angularVelocities.

@danieldresser-ie danieldresser-ie changed the base branch from main to RB-10.5 October 9, 2024 22:24
@danieldresser-ie
Copy link
Contributor Author

Addressed comments, squashed, rebased to RB-10.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants