Cleanup: spelling in comments, strings

This commit is contained in:
Campbell Barton
2024-08-16 09:10:04 +10:00
parent e48f98efb0
commit d71d325692
4 changed files with 12 additions and 11 deletions

View File

@@ -187,8 +187,8 @@ ccl_device float2 compute_3d_gabor_kernel(float3 position, float frequency, floa
}
/* Identical to compute_2d_gabor_standard_deviation except we do triple integration in 3D. The only
* difference is the denominator in the integral expression, which is 2^{5 / 2} for the 3D case
* instead of 4 for the 2D case. Similarly, the limit evaluates to 1 / (4 * sqrt(2)). */
* difference is the denominator in the integral expression, which is `2^{5 / 2}` for the 3D case
* instead of 4 for the 2D case. Similarly, the limit evaluates to `1 / (4 * sqrt(2))`. */
ccl_device float compute_3d_gabor_standard_deviation()
{
float integral_of_gabor_squared = 1.0f / (4.0f * M_SQRT2_F);

View File

@@ -21,7 +21,7 @@ class AttributeGetterSetter:
elif type in {'FLOAT_COLOR', 'BYTE_COLOR'}:
return attribute.data[self._index].color
else:
raise Exception(f"Unkown type {type}")
raise Exception(f"Unknown type {type}")
return default
def _set_attribute(self, name, type, value):
@@ -33,7 +33,7 @@ class AttributeGetterSetter:
elif type in {'FLOAT_COLOR', 'BYTE_COLOR'}:
attribute.data[self._index].color = value
else:
raise Exception(f"Unkown type {type}")
raise Exception(f"Unknown type {type}")
else:
raise Exception(f"Could not create attribute {name} of type {type}")
@@ -44,11 +44,11 @@ def def_prop_for_attribute(attr_name, type, default, doc):
"""
def fget(self):
# Define getter callback for property.
# Define `getter` callback for property.
return self._get_attribute(attr_name, type, default)
def fset(self, value):
# Define setter callback for property.
# Define `setter` callback for property.
self._set_attribute(attr_name, type, value)
prop = property(fget=fget, fset=fset, doc=doc)
return prop
@@ -56,7 +56,8 @@ def def_prop_for_attribute(attr_name, type, default, doc):
def DefAttributeGetterSetters(attributes_list):
"""
A class decorator that reads a list of attribute infos and creates properties on the class with getters and setters.
A class decorator that reads a list of attribute information &
creates properties on the class with `getters` & `setters`.
"""
def wrapper(cls):
for prop_name, attr_name, type, default, doc in attributes_list:
@@ -68,7 +69,7 @@ def DefAttributeGetterSetters(attributes_list):
# Define the list of attributes that should be exposed as read/write properties on the class.
@DefAttributeGetterSetters([
# Property Name, Attribute Name, Type, Default Value, Docstring
# Property Name, Attribute Name, Type, Default Value, Doc-string.
('position', 'position', 'FLOAT_VECTOR', (0.0, 0.0, 0.0), "The position of the point (in local space)."),
('radius', 'radius', 'FLOAT', 0.01, "The radius of the point."),
('opacity', 'opacity', 'FLOAT', 0.0, "The opacity of the point."),
@@ -135,7 +136,7 @@ class GreasePencilStrokePointSlice:
# Define the list of attributes that should be exposed as read/write properties on the class.
@DefAttributeGetterSetters([
# Property Name, Attribute Name, Type, Default Value, Docstring
# Property Name, Attribute Name, Type, Default Value, Doc-string.
('cyclic', 'cyclic', 'BOOLEAN', False, "The closed state for this stroke."),
('material_index', 'material_index', 'INT', 0, "The index of the material for this stroke."),
('select', '.selection', 'BOOLEAN', True, "The selection state for this stroke."),

View File

@@ -1113,7 +1113,7 @@ void update_normals(const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh)
void update_normals_from_eval(Object &object_eval, Tree &pbvh)
{
/* Updating the original object's mesh normals caches is necessary because we skip dependency
* graph updates for sculpt deformations in some cases (so the evaluated object doesn't containt
* graph updates for sculpt deformations in some cases (so the evaluated object doesn't contain
* their result), and also because (currently) sculpt deformations skip tagging the mesh normals
* caches dirty. */
Object &object_orig = *DEG_get_original_object(&object_eval);

View File

@@ -114,7 +114,7 @@ static eAction_TransformFlags get_item_transform_flags(Object &ob,
return;
}
/* We must add len(basePath) bytes to the match so that we are at the end of the
/* We must add `len(basePath)` bytes to the match so that we are at the end of the
* base path so that we don't get false positives with these strings in the names
*/
bPtr += strlen(basePath->c_str());