Cleanup: spelling in code comments & minor edits

- Use uppercase NOTE: tags.
- Correct bNote -> bNode.
- Use colon after parameters.
- Use doxy-style doc-strings.
This commit is contained in:
Campbell Barton 2024-06-06 09:43:48 +10:00
parent 702948c592
commit 7f7648c6ed
50 changed files with 116 additions and 98 deletions

@ -108,7 +108,7 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences,
/* Default to CPU device. */
DeviceInfo cpu_device = Device::available_devices(DEVICE_MASK_CPU).front();
/* Device, which is choosen in the Blender Preferences. Default to CPU device. */
/* Device, which is chosen in the Blender Preferences. Default to CPU device. */
preferences_device = cpu_device;
/* Test if we are using GPU devices. */

@ -775,7 +775,7 @@ void BlenderDisplayDriver::draw(const Params &params)
const int position_attribute = GPU_vertformat_attr_add(
format, display_shader_->position_attribute_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
/* Note: Shader is bound again through IMM to register this shader with the IMM module
/* NOTE: Shader is bound again through IMM to register this shader with the IMM module
* and perform required setup for IMM rendering. This is required as the IMM module
* needs to be aware of which shader is bound, and the main display shader
* is bound externally. */

@ -85,7 +85,7 @@ unique_ptr<Denoiser> Denoiser::create(Device *denoiser_device,
}
else {
/* Find best device from the ones which are proposed for denoising. */
/* The choise is expected to be between few GPUs, or between GPU and a CPU
/* The choice is expected to be between few GPUs, or between GPU and a CPU
* or between few GPU and a CPU. */
single_denoiser_device = find_best_device(denoiser_device, params.type);
}
@ -113,7 +113,7 @@ unique_ptr<Denoiser> Denoiser::create(Device *denoiser_device,
oidn_params.type = DENOISER_OPENIMAGEDENOISE;
oidn_params.use_gpu = false;
/* Used preference CPU when possible, and fallback on cpu fallback device otherwice. */
/* Used preference CPU when possible, and fallback on CPU fallback device otherwise. */
return make_unique<OIDNDenoiser>(
is_cpu_denoiser_device ? single_denoiser_device : cpu_fallback_device, oidn_params);
}

@ -376,7 +376,7 @@ ccl_device Spectrum fresnel_iridescence(KernelGlobals kg,
* The proper way to do this would be a Von Kries-style transform, but to keep it simple,
* we just multiply by the white point here.
*
* Note: The reference implementation sidesteps all this by just hard-coding a XYZ->CIE RGB
* NOTE: The reference implementation sidesteps all this by just hard-coding a XYZ->CIE RGB
* matrix. Since CIE RGB uses E as its white point, this sidesteps the chromatic adaption
* topic, but the primary colors don't match (unless you happen to actually work in CIE RGB.)
*/

@ -68,9 +68,9 @@ ccl_device_inline bool subsurface_entry_bounce(KernelGlobals kg,
const float nK = (neta * cos_HI) - dnp;
*wo = -(neta * sd->wi) + (nK * H);
return true;
/* Note: For a proper refractive GGX interface, we should be computing lambdaI and lambdaO
/* NOTE: For a proper refractive GGX interface, we should be computing lambdaI and lambdaO
* and multiplying the throughput by BSDF/pdf, which for VNDF sampling works out to
* (1 + lambdaI) / (1 + lambdaI + lambdaO).
* `(1 + lambdaI) / (1 + lambdaI + lambdaO)`.
* However, this causes darkening due to the single-scattering approximation, which we'd
* then have to correct with a lookup table.
* Since we only really care about the directional distribution here, it's much easier to

@ -758,7 +758,7 @@ typedef struct Intersection {
} Intersection;
/* On certain GPUs (Apple Silicon), splitting every integrator state field into its own separate
* array can be detrimental for cache utilisation. By enabling __INTEGRATOR_GPU_PACKED_STATE__, we
* array can be detrimental for cache utilization. By enabling __INTEGRATOR_GPU_PACKED_STATE__, we
* specify that certain fields should be packed together. This improves cache hit ratios in cases
* where fields are often accessed together (e.g. "ray" and "isect").
*/

@ -35,7 +35,7 @@ class SceneParams;
class SessionParams {
public:
/* Device, which is choosen based on Blender Cycles preferences, as well as Scene settings and
/* Device, which is chosen based on Blender Cycles preferences, as well as Scene settings and
* command line arguments. */
DeviceInfo device;
/* Device from Cycles preferences for denoising. */

@ -13,11 +13,11 @@ CCL_NAMESPACE_BEGIN
/* [0, uint_max] -> [0.0, 1.0) */
ccl_device_forceinline float uint_to_float_excl(uint n)
{
// Note: we divide by 4294967808 instead of 2^32 because the latter
// leads to a [0.0, 1.0] mapping instead of [0.0, 1.0) due to floating
// point rounding error. 4294967808 unfortunately leaves (precisely)
// one unused ulp between the max number this outputs and 1.0, but
// that's the best you can do with this construction.
/* NOTE: we divide by 4294967808 instead of 2^32 because the latter
* leads to a [0.0, 1.0] mapping instead of [0.0, 1.0) due to floating
* point rounding error. 4294967808 unfortunately leaves (precisely)
* one unused ULP between the max number this outputs and 1.0, but
* that's the best you can do with this construction. */
return (float)n * (1.0f / 4294967808.0f);
}

@ -213,8 +213,8 @@ type shuffle_neon(const type &a, const type &b)
(i3 * 4) + 2 + 16,
(i3 * 4) + 3 + 16};
// Note: This cannot all be put in a single line due to how MSVC ARM64
// implements the function calls as several layers of macros.
/* NOTE: This cannot all be put in a single line due to how MSVC ARM64
* implements the function calls as several layers of macros. */
int8x16x2_t t = {int8x16_t(a), int8x16_t(b)};
uint8x16_t idx = *(uint8x16_t *)tbl;
return type(vqtbl2q_s8(t, idx));

@ -793,7 +793,7 @@ GHOST_TSuccess GHOST_ContextVK::createSwapchain()
/* Driver can stall if only using minimal image count. */
uint32_t image_count = capabilities.minImageCount + 1;
/* Note: maxImageCount == 0 means no limit. */
/* NOTE: maxImageCount == 0 means no limit. */
if (image_count > capabilities.maxImageCount && capabilities.maxImageCount > 0) {
image_count = capabilities.maxImageCount;
}

@ -2256,7 +2256,7 @@ static int file_descriptor_is_io_ready(int fd, const int flags, const int timeou
GHOST_ASSERT(flags & (GWL_IOR_READ | GWL_IOR_WRITE), "X");
/* Note: We don't bother to account for elapsed time if we get EINTR */
/* NOTE: We don't bother to account for elapsed time if we get #EINTR. */
do {
#ifdef HAVE_POLL
pollfd info;

@ -4,7 +4,7 @@
#pragma once
/* Note: version header included here to enable correct forward declaration of some types. No other
/* NOTE: version header included here to enable correct forward declaration of some types. No other
* OpenVDB headers should be included here, especially openvdb.h, to avoid affecting other
* compilation units. */
#include <openvdb/Types.h>

@ -559,7 +559,7 @@ void unassign_animation(ID &animated_id);
* binding, before un-assigning. This is to ensure that the stored name reflects
* the actual binding that was used, making re-binding trivial.
*
* \param adt the AnimData of the animated ID.
* \param adt: the AnimData of the animated ID.
*
* \note this does not clear the Animation pointer, just the binding handle.
*/

@ -280,7 +280,7 @@ void initialize_bezt(BezTriple *beztr,
* This is a helper function for determining whether to insert a keyframe or not
* when "only insert needed" is enabled.
*
* Note: this does *not* determine whether inserting the keyframe would change
* NOTE: this does *not* determine whether inserting the keyframe would change
* the fcurve at points other than the keyframe itself. For example, even if
* inserting the key wouldn't change the fcurve's value at the time of the
* keyframe, the resulting changes to bezier interpolation could change the

@ -308,7 +308,7 @@ TEST_F(KeyframingTest, insert_key_rna__only_available)
EXPECT_EQ(0, result_1.get_count(SingleKeyingResult::SUCCESS));
/* It's unclear why AnimData and an Action should be created if keying fails
* here. It may even be undesireable. These checks are just here to ensure no
* here. It may even be undesirable. These checks are just here to ensure no
* *unintentional* changes in behavior. */
ASSERT_NE(nullptr, object->adt);
ASSERT_NE(nullptr, object->adt->action);

@ -189,7 +189,7 @@ void BKE_pchan_minmax(const Object *ob,
*
* \note This uses #BKE_pchan_minmax, see its documentation for details on bounds calculation.
*
* \param use_select When true, only consider selected bones. When false, selection state is
* \param use_select: When true, only consider selected bones. When false, selection state is
* ignored and all bones are included in the bounds.
*/
std::optional<blender::Bounds<blender::float3>> BKE_pose_minmax(const Object *ob, bool use_select);

@ -287,12 +287,12 @@ void BKE_lib_query_idpropertiesForeachIDLink_callback(IDProperty *id_prop, void
/**
* Loop over all of the ID's this data-block links to.
*
* \param bmain The Main data-base containing `owner_id`, may be null.
* \param id The ID to process. Note that currently, embedded IDs may also be passed here.
* \param callback The callback processing a given ID usage (i.e. a given ID pointer within the
* \param bmain: The Main data-base containing `owner_id`, may be null.
* \param id: The ID to process. Note that currently, embedded IDs may also be passed here.
* \param callback: The callback processing a given ID usage (i.e. a given ID pointer within the
* given \a id data).
* \param user_data Opaque user data for the callback processing a given ID usage.
* \param flag Flags controlling how/which ID pointers are processed.
* \param user_data: Opaque user data for the callback processing a given ID usage.
* \param flag: Flags controlling how/which ID pointers are processed.
*/
void BKE_library_foreach_ID_link(Main *bmain,
ID *id,
@ -315,17 +315,17 @@ void BKE_library_foreach_ID_link(Main *bmain,
* initializes a #LibraryForeachIDData object with given parameters, and wraps a call to given
* `subdata_foreach_id`.
*
* \param bmain The Main data-base containing `owner_id`, may be null.
* \param owner_id The owner ID, i.e. the data-block owning the given sub-data (may differ from
* \param bmain: The Main data-base containing `owner_id`, may be null.
* \param owner_id: The owner ID, i.e. the data-block owning the given sub-data (may differ from
* `self_id` in case the later is an embedded ID).
* \param self_id Typically the same as `owner_id`, unless it is an embedded ID.
* \param subdata_foreach_id The callback handling which data to process, and iterating over all ID
* usages of this subdata. Typically a lambda capturing that subdata, see comments above for
* \param self_id: Typically the same as `owner_id`, unless it is an embedded ID.
* \param subdata_foreach_id: The callback handling which data to process, and iterating over all
* ID usages of this subdata. Typically a lambda capturing that subdata, see comments above for
* details.
* \param callback The callback processing a given ID usage, see #BKE_library_foreach_ID_link.
* \param user_data Opaque user data for the callback processing a given ID usage, see
* \param callback: The callback processing a given ID usage, see #BKE_library_foreach_ID_link.
* \param user_data: Opaque user data for the callback processing a given ID usage, see
* #BKE_library_foreach_ID_link.
* \param flag Flags controlling the process, see #BKE_library_foreach_ID_link. Note that some
* \param flag: Flags controlling the process, see #BKE_library_foreach_ID_link. Note that some
* flags are not accepted here (#IDWALK_RECURSE, #IDWALK_DO_INTERNAL_RUNTIME_POINTERS,
* #IDWALK_DO_LIBRARY_POINTER, #IDWALK_INCLUDE_UI).
*/

@ -299,7 +299,7 @@ class bNodeRuntime : NonCopyable, NonMovable {
/** Update flags. */
int update = 0;
/** Offset that will be added to #bNote::locx for insert offset animation. */
/** Offset that will be added to #bNode::locx for insert offset animation. */
float anim_ofsx;
/** List of cached internal links (input to output), for muted nodes and operators. */

@ -1032,7 +1032,7 @@ static int foreach_libblock_append_add_dependencies_callback(LibraryIDLinkCallba
const BlendfileLinkAppendContextCallBack *data =
static_cast<BlendfileLinkAppendContextCallBack *>(cb_data->user_data);
/* Note: In append case, all dependencies are needed in the items list, to cover potential
/* NOTE: In append case, all dependencies are needed in the items list, to cover potential
* complex cases (e.g. linked data from another library referencing other IDs from the */
BlendfileLinkAppendContextItem *item = static_cast<BlendfileLinkAppendContextItem *>(

@ -478,8 +478,8 @@ void BKE_gpencil_modifier_copydata_generic(const GpencilModifierData *md_src,
const GpencilModifierTypeInfo *mti = BKE_gpencil_modifier_get_info(
GpencilModifierType(md_src->type));
/* md_dst may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid memleak. */
/* `md_dst` may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid a memory leak. */
if (mti->free_data) {
mti->free_data(md_dst);
}

@ -159,8 +159,8 @@ void BKE_shaderfx_copydata_generic(const ShaderFxData *fx_src, ShaderFxData *fx_
{
const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info(ShaderFxType(fx_src->type));
/* fx_dst may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid memleak. */
/* `fx_dst` may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid a memory leak. */
if (fxi->free_data) {
fxi->free_data(fx_dst);
}

@ -41,7 +41,7 @@ namespace blender {
* Creates a subprocess of the current Blender executable.
* WARNING: This class doesn't handle subprocess destruction.
* On Windows, subprocesses are closed automatically when the parent process finishes.
* On Linux, subprocesses become children of init or systemd when the parent process finishes.
* On Linux, subprocesses become children of init or SYSTEMD when the parent process finishes.
*/
class BlenderSubprocess : NonCopyable {
private:
@ -89,7 +89,7 @@ class SharedMemory : NonCopyable {
public:
/**
* WARNING: The name should be unique a unique identifier accross all processes (including
* WARNING: The name should be unique a unique identifier across all processes (including
* multiple Blender instances). You should include the PID of the "owner" process in the name to
* prevent name collisions.
* `is_owner` should only be true for the first process that creates a SharedMemory with a given
@ -116,7 +116,7 @@ class SharedMemory : NonCopyable {
};
/**
* Creates or get access to a semaphore that can be used accros multiple processes.
* Creates or get access to a semaphore that can be used across multiple processes.
*/
class SharedSemaphore : NonCopyable {
private:
@ -130,7 +130,7 @@ class SharedSemaphore : NonCopyable {
public:
/**
* WARNING: The name should be unique a unique identifier accross all processes (including
* WARNING: The name should be unique a unique identifier across all processes (including
* multiple Blender instances). You should include the PID of the "owner" process in the name to
* prevent name collisions.
* `is_owner` should only be true for the last process that needs to read it (It's ok if the

@ -6,7 +6,7 @@
#if BLI_SUBPROCESS_SUPPORT
/* Based on https://github.com/jarikomppa/ipc (Unlicense) */
/* Based on https://github.com/jarikomppa/ipc (Unlicensed) */
# include "BLI_assert.h"
# include "BLI_path_util.h"

@ -861,7 +861,7 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
/* No need to match the surface since shadows are disabled. */
}
else if (material->blend_shadow == MA_BS_SOLID) {
/* This is already versionned an transfered to `transparent_shadows`. */
/* This is already versioned an transferred to `transparent_shadows`. */
}
else if ((material->blend_shadow == MA_BS_CLIP && material->blend_method != MA_BM_CLIP) ||
(material->blend_shadow == MA_BS_HASHED))
@ -874,7 +874,7 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
continue;
}
/* TODO(fclem): Check if theshold is driven or has animation. Bail out if needed? */
/* TODO(fclem): Check if threshold is driven or has animation. Bail out if needed? */
float threshold = (material->blend_method == MA_BM_CLIP) ? material->alpha_threshold :
2.0f;

@ -61,9 +61,9 @@ void TranslateOperation::get_area_of_interest(const int input_idx,
}
else if (x_extend_mode_ == MemoryBufferExtend::Repeat) {
/* The region of interest should consider the whole input image to avoid cropping effects,
* e.g. by prior scaling or rotating. Note: this is still consistent with immediate
* realization of transform nodes in GPU compositor, where nodes are to be evaluated from
* left to right. */
* e.g. by prior scaling or rotating.
* NOTE: this is still consistent with immediate realization of transform nodes in GPU
* compositor, where nodes are to be evaluated from left to right. */
const int in_width = get_width();
BLI_rcti_resize_x(&r_input_area, in_width);
}

@ -218,7 +218,7 @@ CocTile dof_coc_tile_unpack(vec3 fg, vec3 bg)
return tile;
}
/* WORKAROUND(fclem): GLSL compilers differs in what qualifiers are requires to pass images as
/* WORKAROUND(@fclem): GLSL compilers differs in what qualifiers are requires to pass images as
* parameters. Workaround by using defines. */
#define dof_coc_tile_load(tiles_fg_img_, tiles_bg_img_, texel_) \
dof_coc_tile_unpack( \

@ -155,7 +155,7 @@ void main()
for (int i = 1; i < max_view_per_tilemap; i++) {
max_lod = findMSB(levels_rendered & ~(~0u << max_lod));
}
/* Note: Concurent writting of the same value to the same data. */
/* NOTE: Concurrent writing of the same value to the same data. */
tilemaps_buf[tilemap_index].effective_lod_min = max_lod;
/* Collapse all bits to highest level. */
for (int lod = 0; lod < max_lod; lod++) {
@ -177,11 +177,11 @@ void main()
}
}
else {
/* Note: Concurent writting of the same value to the same data. */
/* NOTE: Concurrent writing of the same value to the same data. */
tilemaps_buf[tilemap_index].effective_lod_min = 0;
}
#else
/* Note: Concurent writting of the same value to the same data. */
/* NOTE: Concurrent writing of the same value to the same data. */
tilemaps_buf[tilemap_index].effective_lod_min = 0;
#endif

@ -71,7 +71,7 @@ void GPENCIL_engine_init(void *ved)
GPENCIL_ViewLayerData *vldata = GPENCIL_view_layer_data_ensure();
/* Resize and reset memblocks. */
/* Resize and reset memory-blocks. */
BLI_memblock_clear(vldata->gp_light_pool, gpencil_light_pool_free);
BLI_memblock_clear(vldata->gp_material_pool, gpencil_material_pool_free);
BLI_memblock_clear(vldata->gp_object_pool, nullptr);

@ -5,6 +5,6 @@
void main()
{
fragColor = gl_FrontFacing ? colorFaceFront : colorFaceBack;
/* Pre-multiply the output as we do not do any blending in the framebuffer. */
/* Pre-multiply the output as we do not do any blending in the frame-buffer. */
fragColor.rgb *= fragColor.a;
}

@ -99,7 +99,7 @@ void main()
* - IF PrimType == LineList: base_vertex_id = quad_id*2
* - IF PrimType == LineStrip: base_vertex_id = quad_id
*
* Note: Primitive is LineStrip for this shader. */
* NOTE: Primitive is LineStrip for this shader. */
int base_vertex_id = quad_id;
/* Fetch attributes for self and neighboring vertex. */

@ -1203,7 +1203,7 @@ void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, const in
Layer &layer_lines = grease_pencil.add_layer(DATA_("Lines"));
grease_pencil.set_active_layer(&layer_lines);
/* Note: We assume that this keyframe insertion can't fail. */
/* NOTE: We assume that this keyframe insertion can't fail. */
Drawing &drawing_lines = *grease_pencil.insert_frame(layer_lines, frame_number);
grease_pencil.insert_frame(layer_color, frame_number);

@ -359,7 +359,7 @@ bool ensure_active_keyframe(const Scene &scene,
{
/* For additive drawing, we duplicate the frame that's currently visible and insert it at the
* current frame.
* Note: Also duplicate the frame when erasing, Otherwise empty drawing is added, see
* NOTE: Also duplicate the frame when erasing, Otherwise empty drawing is added, see
* !119051.
*/
grease_pencil.insert_duplicate_frame(

@ -361,7 +361,7 @@ void draw_dots(const IndexRange indices,
const float thickness = radii[point_i] * radius_scale * radius_to_pixel_factor;
immAttr4fv(attr_color, colors[point_i]);
/* Note: extra factor 0.5 for point size to match rendering. */
/* NOTE: extra factor 0.5 for point size to match rendering. */
immAttr1f(attr_size, std::max(thickness, min_stroke_thickness) * 0.5f);
immVertex3fv(attr_pos, math::transform_point(layer_to_world, positions[point_i]));
}
@ -441,7 +441,7 @@ void draw_grease_pencil_strokes(const RegionView3D &rv3d,
break;
case GP_MATERIAL_MODE_DOT:
case GP_MATERIAL_MODE_SQUARE:
/* Note: Squares don't have their own shader, render as dots too. */
/* NOTE: Squares don't have their own shader, render as dots too. */
draw_dots(
points_by_curve[stroke_i], positions, radii, colors, layer_to_world, radius_scale);
break;

@ -1043,7 +1043,7 @@ void ANIM_center_frame(bContext *C, int smooth_viewtx);
/**
* Add horizontal margin to the rectangle.
*
* This function assumes that the xmin/xmax are set to a frame range to show.
* This function assumes that the X-min/X-max are set to a frame range to show.
*
* \return The new rectangle with horizontal margin added, for visual comfort.
*/

@ -416,7 +416,7 @@ void clipboard_free();
const bke::CurvesGeometry &clipboard_curves();
/**
* Paste curves from the clipboard into the drawing.
* \param paste_back Render behind existing curves by inserting curves at the front.
* \param paste_back: Render behind existing curves by inserting curves at the front.
* \return Index range of the new curves in the drawing after pasting.
*/
IndexRange clipboard_paste_strokes(Main &bmain,

@ -1226,7 +1226,7 @@ static void ui_apply_but_TEX(bContext *C, uiBut *but, uiHandleButtonData *data)
* feature used for bone renaming, channels, etc.
* afterfunc frees rename_orig */
if (data->text_edit.original_string && (but->flag & UI_BUT_TEXTEDIT_UPDATE)) {
/* In this case, we need to keep origstr available,
/* In this case, we need to keep `original_string` available,
* to restore real org string in case we cancel after having typed something already. */
but->rename_orig = BLI_strdup(data->text_edit.original_string);
}

@ -1711,9 +1711,9 @@ int paste_property_drivers(blender::Span<FCurve *> src_drivers,
* bool to switch between exec and poll behavior. This isn't great, but seems
* like the lesser evil under the circumstances.
*
* \param copy_entire_array If true, copies drivers of all elements of an array
* \param copy_entire_array: If true, copies drivers of all elements of an array
* property. Otherwise only copies one specific element.
* \param poll If true, only checks if the driver(s) could be copied rather than
* \param poll: If true, only checks if the driver(s) could be copied rather than
* actually performing the copy.
*
* \returns true in exec mode if any copies were successfully made, and false

@ -204,7 +204,7 @@ struct PaintOperationExecutor {
/**
* Creates a new curve with one point at the beginning or end.
* Note: Does not initialize the new curve or points.
* \note Does not initialize the new curve or points.
*/
static void create_blank_curve(bke::CurvesGeometry &curves, const bool on_back)
{
@ -248,7 +248,7 @@ struct PaintOperationExecutor {
/**
* Extends the first or last curve by `new_points_num` number of points.
* Note: Does not initialize the new points.
* \note Does not initialize the new points.
*/
static void extend_curve(bke::CurvesGeometry &curves,
const bool on_back,

@ -461,7 +461,10 @@ struct StrokeCache {
float4x4 symm_rot_mat;
float4x4 symm_rot_mat_inv;
/* Accumulate mode. Note: inverted for SCULPT_TOOL_DRAW_SHARP. */
/**
* Accumulate mode.
* \note inverted for #SCULPT_TOOL_DRAW_SHARP.
*/
bool accum;
float3 anchored_location;

@ -358,8 +358,7 @@ static void seq_view_collection_rect_timeline(const bContext *C,
if (orig_height > timeline_ymax - timeline_ymin) {
/* Do nothing, we can't align the viewport any better if we
* are zoomed out futher than the current timeline bounds.
*/
* are zoomed out further than the current timeline bounds. */
return;
}

@ -184,7 +184,7 @@ void MTLImmediate::end()
* - Converting from a normalized short2 format to float2
* - Type truncation e.g. Float4 to Float2.
* - Type expansion from Float3 to Float4.
* - Note: extra components are filled with the corresponding components of (0,0,0,1).
* - NOTE: extra components are filled with the corresponding components of (0,0,0,1).
* (See
* https://developer.apple.com/documentation/metal/mtlvertexattributedescriptor/1516081-format)
*/

@ -137,7 +137,7 @@ void main()
}
}
/* Outside of strip rounded rect? */
/* Outside of strip rounded rectangle? */
if (sdf > 0.0) {
col = vec4(0.0);
}
@ -147,7 +147,7 @@ void main()
bool selected = (strip.flags & GPU_SEQ_FLAG_SELECTED) != 0;
vec4 col_outline = unpackUnorm4x8(strip.col_outline);
if (selected) {
/* Inset 1px line with backround color. */
/* Inset 1px line with background color. */
col = add_outline(sdf, 0.0, 1.0, col, unpackUnorm4x8(context_data.col_back));
/* 2x wide outline. */
col = add_outline(sdf, 0.5, -0.5, col, col_outline);

@ -297,7 +297,8 @@ static void process_scanlines(const TransformContext &ctx, IndexRange y_range)
}
}
else {
/* One sample per pixel. Note: sample at pixel center for proper filtering. */
/* One sample per pixel.
* NOTE: sample at pixel center for proper filtering. */
float2 uv_start = ctx.start_uv + ctx.add_x * 0.5f + ctx.add_y * 0.5f;
for (int yi : y_range) {
T *output = init_pixel_pointer<T>(ctx.dst, ctx.dst_region_x_range.first(), yi);

@ -42,12 +42,13 @@ static const pxr::TfToken texture_file("texture:file", pxr::TfToken::Immortal);
namespace {
/* If the given attribute has an authored value, return its value in the r_value
/**
* If the given attribute has an authored value, return its value in the r_value
* out parameter.
*
* We wish to support older UsdLux APIs in older versions of USD. For example,
* in previous versions of the API, shader input attibutes did not have the
* "inputs:" prefix. One can provide the older input attibute name in the
* in previous versions of the API, shader input attributes did not have the
* "inputs:" prefix. One can provide the older input attribute name in the
* 'fallback_attr_name' argument, and that attribute will be queried if 'attr'
* doesn't exist or doesn't have an authored value.
*/
@ -74,8 +75,10 @@ bool get_authored_value(const pxr::UsdAttribute &attr,
return false;
}
/* Helper struct for retrieving shader information when traversing a world material
* node chain, provided as user data for bke::nodeChainIter(). */
/**
* Helper struct for retrieving shader information when traversing a world material
* node chain, provided as user data for #bke::nodeChainIter().
*/
struct WorldNtreeSearchResults {
const blender::io::usd::USDExportParams &params;
pxr::UsdStageRefPtr stage;
@ -102,9 +105,11 @@ struct WorldNtreeSearchResults {
namespace blender::io::usd {
/* If the given path already exists on the given stage, return the path with
* a numerical suffix appende to the name that ensures the path is unique. If
* the path does not exist on the stage, it will be returned unchanged. */
/**
* If the given path already exists on the given stage, return the path with
* a numerical suffix appended to the name that ensures the path is unique. If
* the path does not exist on the stage, it will be returned unchanged.
*/
static pxr::SdfPath get_unique_path(pxr::UsdStageRefPtr stage, const std::string &path)
{
std::string unique_path = path;
@ -115,8 +120,10 @@ static pxr::SdfPath get_unique_path(pxr::UsdStageRefPtr stage, const std::string
return pxr::SdfPath(unique_path);
}
/* Load the image at the given path. Handle packing and copying based in the import options.
* Return the opened image on succsss or a nullptr on failure. */
/**
* Load the image at the given path. Handle packing and copying based in the import options.
* Return the opened image on success or a nullptr on failure.
*/
static Image *load_image(std::string tex_path, Main *bmain, const USDImportParams &params)
{
/* Optionally copy the asset if it's inside a USDZ package. */
@ -181,9 +188,11 @@ static bNode *append_node(bNode *dst_node,
return src_node;
}
/* Callback function for iterating over a shader node chain to retrieve data
/**
* Callback function for iterating over a shader node chain to retrieve data
* necessary for converting a world material to a USD dome light. It also
* handles copying textures, if required. */
* handles copying textures, if required.
*/
static bool node_search(bNode *fromnode,
bNode * /* tonode */,
void *userdata,
@ -247,8 +256,10 @@ static bool node_search(bNode *fromnode,
return true;
}
/* If the Blender scene has an environment texture,
* export it as a USD dome light. */
/**
* If the Blender scene has an environment texture,
* export it as a USD dome light.
*/
void world_material_to_dome_light(const USDExportParams &params,
const Scene *scene,
pxr::UsdStageRefPtr stage)

@ -1164,7 +1164,7 @@ static pxr::SdfPath reflow_materialx_paths(pxr::SdfPath input_path,
return input_path.ReplacePrefix(temp_path, target_path);
}
/* Exports the material as a MaterialX nodegraph within the USD layer. */
/* Exports the material as a MaterialX node-graph within the USD layer. */
static void create_usd_materialx_material(const USDExporterContext &usd_export_context,
pxr::SdfPath usd_path,
Material *material,

@ -437,7 +437,7 @@ typedef struct ObHook {
/**
* This is used as a flag for many kinds of data that use selections, examples include:
* - #BezTriple.f1, #BezTriple.f2, #BezTriple.f3
* - #bNote.flag
* - #bNode.flag
* - #MovieTrackingTrack.flag
* And more, ideally this would have a generic location.
*/

@ -764,8 +764,8 @@ NodeItem NodeItem::create_node(const std::string &category, Type type) const
std::string type_str = this->type(type);
CLOG_INFO(LOG_MATERIALX_SHADER, 2, "<%s type=%s>", category.c_str(), type_str.c_str());
NodeItem res = empty();
/* Surfaceshader nodes and materials are added directly to the document,
* otherwise to thenodegraph */
/* Surface-shader nodes and materials are added directly to the document,
* otherwise to the node-graph. */
if (type == Type::SurfaceShader || type == Type::Material) {
res.node = graph_->getDocument()->addNode(category, MaterialX::EMPTY_STRING, type_str);
}

@ -477,7 +477,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject * /*args*/)
BlendfileLinkAppendContext *lapp_context = BKE_blendfile_link_append_context_new(
&liblink_params);
/* Note: Transfers the ownership of the `blo_handle` to the `lapp_context`. */
/* NOTE: Transfers the ownership of the `blo_handle` to the `lapp_context`. */
BKE_blendfile_link_append_context_library_add(lapp_context, self->abspath, self->blo_handle);
self->blo_handle = nullptr;

@ -63,8 +63,8 @@ namespace blender::seq {
* Results of the query for this strip will be cached into #MediaPresence cache. The cache
* will be created on demand.
*
* \param scene Scene to query.
* \param seq Sequencer strip.
* \param scene: Scene to query.
* \param seq: Sequencer strip.
* \return True if media file is missing.
*/
bool media_presence_is_missing(Scene *scene, const Sequence *seq);

@ -48,6 +48,7 @@ dict_custom = {
"atomicity",
"attachmentless",
"attenuations",
"backends",
"backlit",
"bindless",
"bitwise",
@ -345,6 +346,7 @@ dict_custom = {
"resyncing",
"retarget",
"retiming",
"reupload",
"reusability",
"rotationally",
"saveable",
@ -372,6 +374,8 @@ dict_custom = {
"submenu",
"submenus",
"suboptimally",
"subprocess",
"subprocesses",
"subrange",
"subtractive",
"subtype",