Cleanup: Improve comments

This commit is contained in:
Hans Goudey 2021-05-15 18:00:20 -05:00
parent 4da16a0707
commit 9dabb342ba
Notes: blender-bot 2023-02-14 00:44:02 +01:00
Referenced by issue #94418, No image.previews for some D.images
Referenced by issue #93995, Cycles: motion blur only applies on Left view
Referenced by issue #90540, NoneType object error with entering grease pencil draw mode
Referenced by issue #89029, Baking to Vertex colors causes Blender shutdown/crash
2 changed files with 10 additions and 12 deletions

View File

@ -235,5 +235,3 @@ std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve)
return curve;
}
/** \} */

View File

@ -447,8 +447,8 @@ template<typename T> class VMutableArray_For_SplinePoints final : public VMutabl
/**
* Virtual array implementation specifically for control point positions. This is only needed for
* Bezier splines, where adjusting the position also needs to adjust handle positions depending on
* the handle types. We pay a small price for this when other spline types are mixed with Bezier.
* Bezier splines, where adjusting the position also requires adjusting handle positions depending
* on handle types. We pay a small price for this when other spline types are mixed with Bezier.
*
* \note There is no need to check the handle type to avoid changing auto handles, since
* retrieving write access to the position data will mark them for recomputation anyway.
@ -534,7 +534,7 @@ class VMutableArray_For_SplinePosition final : public VMutableArray<float3> {
/**
* Provider for any builtin control point attribute that doesn't need
* special handling such as access to other arrays in the spline.
* special handling like access to other arrays in the spline.
*/
template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttributeProvider {
protected:
@ -630,7 +630,7 @@ template<typename T> class BuiltinPointAttributeProvider : public BuiltinAttribu
};
/**
* Special attribute provider for the position attribute. Having this separate means we don't
* Special attribute provider for the position attribute. Keeping this separate means we don't
* need to make #BuiltinPointAttributeProvider overly generic, and the special handling for the
* positions is more clear.
*/
@ -653,8 +653,6 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo
return {};
}
/* Changing the positions requires recalculation of cached evaluated data in many cases.
* This could set more specific flags in the future to avoid unnecessary recomputation. */
bool curve_has_bezier_spline = false;
for (SplinePtr &spline : curve->splines()) {
if (spline->type() == Spline::Type::Bezier) {
@ -663,12 +661,14 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo
}
}
/* Use the regular position virtual array there are any bezier splines to potentially avoid
* using the special position virtual array when there are no Bezier splines anyway. */
/* Use the regular position virtual array when there aren't any Bezier splines
* to avoid the overhead of thecking the spline type for every point. */
if (!curve_has_bezier_spline) {
return BuiltinPointAttributeProvider<float3>::try_get_for_write(component);
}
/* Changing the positions requires recalculation of cached evaluated data in many cases.
* This could set more specific flags in the future to avoid unnecessary recomputation. */
for (SplinePtr &spline : curve->splines()) {
spline->mark_cache_invalid();
}
@ -687,8 +687,8 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvider<flo
* \{ */
/**
* In this function all the attribute providers for a curve component are created. Most data
* in this function is statically allocated, because it does not change over time.
* In this function all the attribute providers for a curve component are created.
* Most data in this function is statically allocated, because it does not change over time.
*/
static ComponentAttributeProviders create_attribute_providers_for_curve()
{