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

CurvesAlgo::resamplePrimitiveVariables : Support periodic curves #1429

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

danieldresser-ie
Copy link
Contributor

Not sure how much periodic curves are ever actually used, but as long as our curves type supports them, we probably shouldn't output bogus data for them.

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! I think it's probably worth taking the one-liner approach (see comment inline)?

Comment on lines 203 to 204
size_t varyingSize;
if( m_curves->periodic() )
{
varyingSize = m_curves->numSegments( i );
}
else
{
varyingSize = m_curves->numSegments( i ) + 1;
}

for( size_t j = 0; j < varyingSize; ++j )
Copy link
Member

Choose a reason for hiding this comment

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

Could be a one liner I think :

const size_t varyingSize = m_curves->variableSize( PrimitiveVariable::Varying, i ).

Copy link
Member

Choose a reason for hiding this comment

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

Same applies to the other changes below...

Comment on lines 494 to 498
# Work around weird limitation that for resampling Varying -> Vertex the primvar must be stored on curves
curves["dummy"] = p
Copy link
Member

Choose a reason for hiding this comment

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

I briefly tried to figure out why this might be necessary, but failed. Could you educate me?

@danieldresser-ie
Copy link
Contributor Author

I've switched to using variableSize, and added some more info to the comment ( looks like there isn't any good reason why CurvesAlgo.resamplePrimitiveVariable is doing weird things, but that's a fix for another day ).

Should be good to merge.

@johnhaddon johnhaddon merged commit ac86d9b into ImageEngine:RB-10.5 Aug 30, 2024
5 checks passed
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