-
Notifications
You must be signed in to change notification settings - Fork 124
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
CurvesAlgo::resamplePrimitiveVariables : Support periodic curves #1429
Conversation
There was a problem hiding this 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)?
src/IECoreScene/CurvesAlgo.cpp
Outdated
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 ) |
There was a problem hiding this comment.
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 )
.
There was a problem hiding this comment.
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...
test/IECoreScene/CurvesAlgoTest.py
Outdated
# Work around weird limitation that for resampling Varying -> Vertex the primvar must be stored on curves | ||
curves["dummy"] = p |
There was a problem hiding this comment.
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?
9e6aca8
to
2c37ad1
Compare
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. |
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.