mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-09 22:00:06 +00:00
Merge pull request #280 from Nazg-Gul/dev
Return success status from openSubdiv_finishEvaluatorDescr()
This commit is contained in:
commit
d4b85556b8
@ -90,20 +90,23 @@ void openSubdiv_createEvaluatorDescrFace(OpenSubdiv_EvaluatorDescr *evaluator_de
|
||||
}
|
||||
}
|
||||
|
||||
void openSubdiv_finishEvaluatorDescr(OpenSubdiv_EvaluatorDescr *evaluator_descr,
|
||||
int refinementLevel)
|
||||
int openSubdiv_finishEvaluatorDescr(OpenSubdiv_EvaluatorDescr *evaluator_descr,
|
||||
int refinementLevel)
|
||||
{
|
||||
std::string errorMessage;
|
||||
evaluator_descr->topology.refinementLevel = refinementLevel;
|
||||
|
||||
// TODO: Pass the error message to the callee function so it know what's going on.
|
||||
if (not evaluator_descr->topology.IsValid(&errorMessage)) {
|
||||
std::cout <<"OpenSubdiv topology is not valid due to " << errorMessage << std::endl;
|
||||
return 0;
|
||||
} else {
|
||||
if (not evaluator_descr->evaluator.Initialize(
|
||||
evaluator_descr->topology, &errorMessage)) {
|
||||
std::cout <<"OpenSubdiv uniform evaluator initialization failed due to " << errorMessage << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ struct OpenSubdiv_EvaluatorDescr;
|
||||
struct OpenSubdiv_EvaluatorDescr *openSubdiv_createEvaluatorDescr(int numVertices);
|
||||
void openSubdiv_deleteEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr);
|
||||
void openSubdiv_createEvaluatorDescrFace(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int num_vertices, int *indices);
|
||||
void openSubdiv_finishEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int refinementLevel);
|
||||
int openSubdiv_finishEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int refinementLevel);
|
||||
|
||||
/* Set the positions of points on the coarse mesh and refine. This method */
|
||||
/* will perform catmull/clark refinement on the CVs to be ready to call */
|
||||
|
Loading…
Reference in New Issue
Block a user