Cleanup: full sentences in comments, improve comment formatting

This commit is contained in:
Campbell Barton 2021-06-26 21:35:18 +10:00
parent fae5a907d4
commit f1e4903854
366 changed files with 1125 additions and 1097 deletions

@ -51,12 +51,12 @@ CCL_NAMESPACE_BEGIN
/* XML reading state */ /* XML reading state */
struct XMLReadState : public XMLReader { struct XMLReadState : public XMLReader {
Scene *scene; /* scene pointer */ Scene *scene; /* Scene pointer. */
Transform tfm; /* current transform state */ Transform tfm; /* Current transform state. */
bool smooth; /* smooth normal state */ bool smooth; /* Smooth normal state. */
Shader *shader; /* current shader */ Shader *shader; /* Current shader. */
string base; /* base path to current file*/ string base; /* Base path to current file. */
float dicing_rate; /* current dicing rate */ float dicing_rate; /* Current dicing rate. */
XMLReadState() : scene(NULL), smooth(false), shader(NULL), dicing_rate(1.0f) XMLReadState() : scene(NULL), smooth(false), shader(NULL), dicing_rate(1.0f)
{ {
@ -385,7 +385,7 @@ static Mesh *xml_add_mesh(Scene *scene, const Transform &tfm)
Mesh *mesh = new Mesh(); Mesh *mesh = new Mesh();
scene->geometry.push_back(mesh); scene->geometry.push_back(mesh);
/* create object*/ /* Create object. */
Object *object = new Object(); Object *object = new Object();
object->set_geometry(mesh); object->set_geometry(mesh);
object->set_tfm(tfm); object->set_tfm(tfm);

@ -533,7 +533,7 @@ void BlenderSync::sync_particle_hair(
return; return;
} }
/* extract particle hair data - should be combined with connecting to mesh later*/ /* Extract particle hair data - should be combined with connecting to mesh later. */
ParticleCurveData CData; ParticleCurveData CData;

@ -388,7 +388,7 @@ void BVHSpatialSplit::split_curve_primitive(const Hair *hair,
BoundBox &left_bounds, BoundBox &left_bounds,
BoundBox &right_bounds) BoundBox &right_bounds)
{ {
/* curve split: NOTE - Currently ignores curve width and needs to be fixed.*/ /* curve split: NOTE - Currently ignores curve width and needs to be fixed. */
Hair::Curve curve = hair->get_curve(prim_index); Hair::Curve curve = hair->get_curve(prim_index);
const int k0 = curve.first_key + segment_index; const int k0 = curve.first_key + segment_index;
const int k1 = k0 + 1; const int k1 = k0 + 1;

@ -1186,7 +1186,7 @@ bool OpenCLInfo::get_device_extensions(cl_device_id device_id,
{ {
size_t extension_length = 0; size_t extension_length = 0;
cl_int err; cl_int err;
/* Determine the size of the extension string*/ /* Determine the size of the extension string. */
if ((err = clGetDeviceInfo(device_id, CL_DEVICE_EXTENSIONS, 0, 0, &extension_length)) != if ((err = clGetDeviceInfo(device_id, CL_DEVICE_EXTENSIONS, 0, 0, &extension_length)) !=
CL_SUCCESS) { CL_SUCCESS) {
if (error != NULL) { if (error != NULL) {

@ -66,7 +66,7 @@ ccl_device_noinline void motion_triangle_shader_setup(
sd->P = motion_triangle_refine_local(kg, sd, isect, ray, verts); sd->P = motion_triangle_refine_local(kg, sd, isect, ray, verts);
} }
else else
#endif /* __BVH_LOCAL__*/ #endif /* __BVH_LOCAL__*/
{ {
sd->P = motion_triangle_refine(kg, sd, isect, ray, verts); sd->P = motion_triangle_refine(kg, sd, isect, ray, verts);
} }

@ -274,7 +274,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
/* primitive */ /* primitive */
sd->object = object; sd->object = object;
sd->lamp = LAMP_NONE; sd->lamp = LAMP_NONE;
/* currently no access to bvh prim index for strand sd->prim*/ /* Currently no access to bvh prim index for strand sd->prim. */
sd->prim = prim; sd->prim = prim;
sd->u = u; sd->u = u;
sd->v = v; sd->v = v;

@ -409,7 +409,7 @@ ccl_device void subsurface_random_walk_coefficients(const ShaderClosure *sc,
ccl_device_forceinline float eval_phase_dwivedi(float v, float phase_log, float cos_theta) ccl_device_forceinline float eval_phase_dwivedi(float v, float phase_log, float cos_theta)
{ {
/* Eq. 9 from [2] using precomputed log((v + 1) / (v - 1))*/ /* Eq. 9 from [2] using precomputed log((v + 1) / (v - 1)) */
return 1.0f / ((v - cos_theta) * phase_log); return 1.0f / ((v - cos_theta) * phase_log);
} }

@ -49,7 +49,7 @@ void OSLShader::thread_init(KernelGlobals *kg,
return; return;
} }
/* per thread kernel data init*/ /* Per thread kernel data init. */
kg->osl = osl_globals; kg->osl = osl_globals;
OSL::ShadingSystem *ss = kg->osl->ss; OSL::ShadingSystem *ss = kg->osl->ss;

@ -68,7 +68,7 @@ typedef ccl_global struct SplitBranchedState {
uint lcg_state; uint lcg_state;
LocalIntersection ss_isect; LocalIntersection ss_isect;
# endif /*__SUBSURFACE__ */ # endif /* __SUBSURFACE__ */
int shared_sample_count; /* number of branched samples shared with other threads */ int shared_sample_count; /* number of branched samples shared with other threads */
int original_ray; /* index of original ray when sharing branched samples */ int original_ray; /* index of original ray when sharing branched samples */

@ -182,7 +182,7 @@ ccl_device void svm_node_tex_image_box(KernelGlobals *kg, ShaderData *sd, float
} }
} }
else { else {
/* Desperate mode, no valid choice anyway, fallback to one side.*/ /* Desperate mode, no valid choice anyway, fallback to one side. */
weight.x = 1.0f; weight.x = 1.0f;
} }

@ -676,8 +676,8 @@ void GeometryManager::update_attribute_element_offset(Geometry *geom,
Mesh *mesh = static_cast<Mesh *>(geom); Mesh *mesh = static_cast<Mesh *>(geom);
if (mesh->subdivision_type == Mesh::SUBDIVISION_CATMULL_CLARK && if (mesh->subdivision_type == Mesh::SUBDIVISION_CATMULL_CLARK &&
desc.flags & ATTR_SUBDIVIDED) { desc.flags & ATTR_SUBDIVIDED) {
/* indices for subdivided attributes are retrieved /* Indices for subdivided attributes are retrieved
* from patch table so no need for correction here*/ * from patch table so no need for correction here. */
} }
else if (element == ATTR_ELEMENT_VERTEX) else if (element == ATTR_ELEMENT_VERTEX)
offset -= mesh->vert_offset; offset -= mesh->vert_offset;

@ -4374,7 +4374,7 @@ NODE_DEFINE(HairInfoNode)
SOCKET_OUT_FLOAT(intercept, "Intercept"); SOCKET_OUT_FLOAT(intercept, "Intercept");
SOCKET_OUT_FLOAT(thickness, "Thickness"); SOCKET_OUT_FLOAT(thickness, "Thickness");
SOCKET_OUT_NORMAL(tangent_normal, "Tangent Normal"); SOCKET_OUT_NORMAL(tangent_normal, "Tangent Normal");
#if 0 /*output for minimum hair width transparency - deactivated */ #if 0 /* Output for minimum hair width transparency - deactivated. */
SOCKET_OUT_FLOAT(fade, "Fade"); SOCKET_OUT_FLOAT(fade, "Fade");
#endif #endif
SOCKET_OUT_FLOAT(index, "Random"); SOCKET_OUT_FLOAT(index, "Random");

@ -95,7 +95,7 @@ class GHOST_ISystemPaths {
virtual void addToSystemRecentFiles(const char *filename) const = 0; virtual void addToSystemRecentFiles(const char *filename) const = 0;
private: private:
/** The one and only system paths*/ /** The one and only system paths. */
static GHOST_ISystemPaths *m_systemPaths; static GHOST_ISystemPaths *m_systemPaths;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC

@ -328,8 +328,8 @@ class GHOST_System : public GHOST_ISystem {
*/ */
virtual GHOST_TSuccess showMessageBox(const char * /*title*/, virtual GHOST_TSuccess showMessageBox(const char * /*title*/,
const char * /*message*/, const char * /*message*/,
const char * /*help_label */, const char * /*help_label*/,
const char * /*continue_label */, const char * /*continue_label*/,
const char * /*link*/, const char * /*link*/,
GHOST_DialogOptions /*dialog_options*/) const GHOST_DialogOptions /*dialog_options*/) const
{ {

@ -86,7 +86,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
{ {
// printf("\nrecvchar %c 0x%x",recvChar,recvChar); // printf("\nrecvchar %c 0x%x",recvChar,recvChar);
switch (rawCode) { switch (rawCode) {
/*Physical keycodes not used due to map changes in int'l keyboards /* Physical key-codes: (not used due to map changes in int'l keyboards). */
#if 0
case kVK_ANSI_A: return GHOST_kKeyA; case kVK_ANSI_A: return GHOST_kKeyA;
case kVK_ANSI_B: return GHOST_kKeyB; case kVK_ANSI_B: return GHOST_kKeyB;
case kVK_ANSI_C: return GHOST_kKeyC; case kVK_ANSI_C: return GHOST_kKeyC;
@ -112,9 +113,9 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
case kVK_ANSI_W: return GHOST_kKeyW; case kVK_ANSI_W: return GHOST_kKeyW;
case kVK_ANSI_X: return GHOST_kKeyX; case kVK_ANSI_X: return GHOST_kKeyX;
case kVK_ANSI_Y: return GHOST_kKeyY; case kVK_ANSI_Y: return GHOST_kKeyY;
case kVK_ANSI_Z: return GHOST_kKeyZ;*/ case kVK_ANSI_Z: return GHOST_kKeyZ;
#endif
/* Numbers keys mapped to handle some int'l keyboard (e.g. French)*/ /* Numbers keys: mapped to handle some int'l keyboard (e.g. French). */
case kVK_ISO_Section: case kVK_ISO_Section:
return GHOST_kKeyUnknown; return GHOST_kKeyUnknown;
case kVK_ANSI_1: case kVK_ANSI_1:
@ -244,8 +245,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
return GHOST_kKeyUpPage; return GHOST_kKeyUpPage;
case kVK_PageDown: case kVK_PageDown:
return GHOST_kKeyDownPage; return GHOST_kKeyDownPage;
#if 0 /* TODO: why are these commented? */
/*case kVK_ANSI_Minus: return GHOST_kKeyMinus; case kVK_ANSI_Minus: return GHOST_kKeyMinus;
case kVK_ANSI_Equal: return GHOST_kKeyEqual; case kVK_ANSI_Equal: return GHOST_kKeyEqual;
case kVK_ANSI_Comma: return GHOST_kKeyComma; case kVK_ANSI_Comma: return GHOST_kKeyComma;
case kVK_ANSI_Period: return GHOST_kKeyPeriod; case kVK_ANSI_Period: return GHOST_kKeyPeriod;
@ -255,15 +256,15 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
case kVK_ANSI_Backslash: return GHOST_kKeyBackslash; case kVK_ANSI_Backslash: return GHOST_kKeyBackslash;
case kVK_ANSI_LeftBracket: return GHOST_kKeyLeftBracket; case kVK_ANSI_LeftBracket: return GHOST_kKeyLeftBracket;
case kVK_ANSI_RightBracket: return GHOST_kKeyRightBracket; case kVK_ANSI_RightBracket: return GHOST_kKeyRightBracket;
case kVK_ANSI_Grave: return GHOST_kKeyAccentGrave;*/ case kVK_ANSI_Grave: return GHOST_kKeyAccentGrave;
#endif
case kVK_VolumeUp: case kVK_VolumeUp:
case kVK_VolumeDown: case kVK_VolumeDown:
case kVK_Mute: case kVK_Mute:
return GHOST_kKeyUnknown; return GHOST_kKeyUnknown;
default: { default: {
/* alphanumerical or punctuation key that is remappable in int'l keyboards */ /* Alphanumerical or punctuation key that is remappable in int'l keyboards. */
if ((recvChar >= 'A') && (recvChar <= 'Z')) { if ((recvChar >= 'A') && (recvChar <= 'Z')) {
return (GHOST_TKey)(recvChar - 'A' + GHOST_kKeyA); return (GHOST_TKey)(recvChar - 'A' + GHOST_kKeyA);
} }
@ -271,8 +272,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
return (GHOST_TKey)(recvChar - 'a' + GHOST_kKeyA); return (GHOST_TKey)(recvChar - 'a' + GHOST_kKeyA);
} }
else { else {
/* Leopard and Snow Leopard 64bit compatible API*/ /* Leopard and Snow Leopard 64bit compatible API. */
CFDataRef uchrHandle; /*the keyboard layout*/ CFDataRef uchrHandle; /* The keyboard layout. */
TISInputSourceRef kbdTISHandle; TISInputSourceRef kbdTISHandle;
kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource(); kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource();
@ -280,9 +281,9 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
kTISPropertyUnicodeKeyLayoutData); kTISPropertyUnicodeKeyLayoutData);
CFRelease(kbdTISHandle); CFRelease(kbdTISHandle);
/*get actual character value of the "remappable" keys in int'l keyboards, /* Get actual character value of the "remappable" keys in int'l keyboards,
if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger), * if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger),
then fallback on using the received charactersIgnoringModifiers */ * then fallback on using the received #charactersIgnoringModifiers. */
if (uchrHandle) { if (uchrHandle) {
UInt32 deadKeyState = 0; UInt32 deadKeyState = 0;
UniCharCount actualStrLength = 0; UniCharCount actualStrLength = 0;
@ -433,8 +434,10 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
// So WM_exit needs to be called directly, as the event loop will never run before termination // So WM_exit needs to be called directly, as the event loop will never run before termination
- (void)applicationWillTerminate:(NSNotification *)aNotification - (void)applicationWillTerminate:(NSNotification *)aNotification
{ {
/*G.is_break = FALSE; //Let Cocoa perform the termination at the end #if 0
WM_exit(C);*/ G.is_break = false; /* Let Cocoa perform the termination at the end. */
WM_exit(C);
#endif
} }
- (void)applicationWillBecomeActive:(NSNotification *)aNotification - (void)applicationWillBecomeActive:(NSNotification *)aNotification
@ -1215,7 +1218,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
return GHOST_kFailure; return GHOST_kFailure;
} }
/*Get the bitmap of the image*/ /* Get the bitmap of the image. */
enumerator = [[droppedImg representations] objectEnumerator]; enumerator = [[droppedImg representations] objectEnumerator];
while ((representation = [enumerator nextObject])) { while ((representation = [enumerator nextObject])) {
if ([representation isKindOfClass:[NSBitmapImageRep class]]) { if ([representation isKindOfClass:[NSBitmapImageRep class]]) {
@ -1228,7 +1231,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) && if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) &&
![bitmapImage isPlanar]) { ![bitmapImage isPlanar]) {
/* Try a fast copy if the image is a meshed RGBA 32bit bitmap*/ /* Try a fast copy if the image is a meshed RGBA 32bit bitmap. */
toIBuf = (GHOST_TUns8 *)ibuf->rect; toIBuf = (GHOST_TUns8 *)ibuf->rect;
rasterRGB = (GHOST_TUns8 *)[bitmapImage bitmapData]; rasterRGB = (GHOST_TUns8 *)[bitmapImage bitmapData];
for (y = 0; y < imgSize.height; y++) { for (y = 0; y < imgSize.height; y++) {
@ -1258,7 +1261,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
colorSpaceName:NSDeviceRGBColorSpace colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:(NSBitmapFormat)0 bitmapFormat:(NSBitmapFormat)0
bytesPerRow:4 * imgSize.width bytesPerRow:4 * imgSize.width
bitsPerPixel:32 /*RGB format padded to 32bits*/]; bitsPerPixel:32 /* RGB format padded to 32bits. */];
[NSGraphicsContext saveGraphicsState]; [NSGraphicsContext saveGraphicsState];
[NSGraphicsContext [NSGraphicsContext
@ -1305,7 +1308,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
return GHOST_kFailure; return GHOST_kFailure;
} }
/*Copy the image to ibuf, flipping it vertically*/ /* Copy the image to ibuf, flipping it vertically. */
toIBuf = (GHOST_TUns8 *)ibuf->rect; toIBuf = (GHOST_TUns8 *)ibuf->rect;
for (y = 0; y < imgSize.height; y++) { for (y = 0; y < imgSize.height; y++) {
for (x = 0; x < imgSize.width; x++) { for (x = 0; x < imgSize.width; x++) {

@ -1503,7 +1503,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
case WM_KEYUP: case WM_KEYUP:
case WM_SYSKEYUP: case WM_SYSKEYUP:
/* These functions were replaced by WM_INPUT*/ /* These functions were replaced by #WM_INPUT. */
case WM_CHAR: case WM_CHAR:
/* The WM_CHAR message is posted to the window with the keyboard focus when /* The WM_CHAR message is posted to the window with the keyboard focus when
* a WM_KEYDOWN message is translated by the TranslateMessage function. WM_CHAR * a WM_KEYDOWN message is translated by the TranslateMessage function. WM_CHAR
@ -1851,7 +1851,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
* to perform any move or size change processing during the WM_WINDOWPOSCHANGED * to perform any move or size change processing during the WM_WINDOWPOSCHANGED
* message without calling DefWindowProc. * message without calling DefWindowProc.
*/ */
/* see WM_SIZE comment*/ /* See #WM_SIZE comment. */
if (window->m_inLiveResize) { if (window->m_inLiveResize) {
system->pushEvent(processWindowEvent(GHOST_kEventWindowMove, window)); system->pushEvent(processWindowEvent(GHOST_kEventWindowMove, window));
system->dispatchEvents(); system->dispatchEvents();

@ -365,7 +365,7 @@ class GHOST_Window : public GHOST_IWindow {
/** The current grabbed state of the cursor */ /** The current grabbed state of the cursor */
GHOST_TGrabCursorMode m_cursorGrab; GHOST_TGrabCursorMode m_cursorGrab;
/** Grab cursor axis.*/ /** Grab cursor axis. */
GHOST_TAxisFlag m_cursorGrabAxis; GHOST_TAxisFlag m_cursorGrabAxis;
/** Initial grab location. */ /** Initial grab location. */

@ -287,7 +287,7 @@ void GHOST_WindowWin32::setTitle(const char *title)
std::string GHOST_WindowWin32::getTitle() const std::string GHOST_WindowWin32::getTitle() const
{ {
char buf[s_maxTitleLength]; /*CHANGE + never used yet*/ char buf[s_maxTitleLength]; /* CHANGE + never used yet. */
::GetWindowText(m_hWnd, buf, s_maxTitleLength); ::GetWindowText(m_hWnd, buf, s_maxTitleLength);
return std::string(buf); return std::string(buf);
} }

@ -1241,7 +1241,7 @@ GHOST_WindowX11::~GHOST_WindowX11()
if (m_valid_setup) { if (m_valid_setup) {
static Atom Primary_atom, Clipboard_atom; static Atom Primary_atom, Clipboard_atom;
Window p_owner, c_owner; Window p_owner, c_owner;
/*Change the owner of the Atoms to None if we are the owner*/ /* Change the owner of the Atoms to None if we are the owner. */
Primary_atom = XInternAtom(m_display, "PRIMARY", False); Primary_atom = XInternAtom(m_display, "PRIMARY", False);
Clipboard_atom = XInternAtom(m_display, "CLIPBOARD", False); Clipboard_atom = XInternAtom(m_display, "CLIPBOARD", False);

@ -115,7 +115,7 @@ int main(int argc, char *argv[])
p[i] = MEM_callocN(blocksize, strdup(tagstring)); p[i] = MEM_callocN(blocksize, strdup(tagstring));
} }
/* now corrupt a few blocks...*/ /* Now corrupt a few blocks. */
ip = (int *)p[5] - 50; ip = (int *)p[5] - 50;
for (i = 0; i < 1000; i++, ip++) for (i = 0; i < 1000; i++, ip++)
*ip = i + 1; *ip = i + 1;

@ -85,7 +85,7 @@ struct OpenVDBRemeshData {
int out_tottris; int out_tottris;
int filter_type; int filter_type;
enum OpenVDBLevelSet_FilterType filter_bias; enum OpenVDBLevelSet_FilterType filter_bias;
enum OpenVDBLevelSet_FilterBias filter_width; /* Parameter for gaussian, median, mean*/ enum OpenVDBLevelSet_FilterBias filter_width; /* Parameter for gaussian, median, mean. */
float voxel_size; float voxel_size;
float isovalue; float isovalue;

@ -206,7 +206,7 @@ int BLF_load_mem(const char *name, const unsigned char *mem, int mem_size)
{ {
int i = blf_search(name); int i = blf_search(name);
if (i >= 0) { if (i >= 0) {
/*font = global_font[i];*/ /*UNUSED*/ // font = global_font[i]; /* UNUSED */
return i; return i;
} }
return BLF_load_mem_unique(name, mem, mem_size); return BLF_load_mem_unique(name, mem, mem_size);

@ -329,7 +329,7 @@ void DM_copy_vert_data(struct DerivedMesh *source,
int dest_index, int dest_index,
int count); int count);
/*sets up mpolys for a DM based on face iterators in source*/ /* Sets up mpolys for a DM based on face iterators in source. */
void DM_DupPolys(DerivedMesh *source, DerivedMesh *target); void DM_DupPolys(DerivedMesh *source, DerivedMesh *target);
void DM_ensure_normals(DerivedMesh *dm); void DM_ensure_normals(DerivedMesh *dm);

@ -49,24 +49,30 @@ typedef struct EditBone {
struct EditBone *next, *prev; struct EditBone *next, *prev;
/** User-Defined Properties on this Bone */ /** User-Defined Properties on this Bone */
struct IDProperty *prop; struct IDProperty *prop;
/** Editbones have a one-way link (i.e. children refer /**
* Editbones have a one-way link (i.e. children refer
* to parents. This is converted to a two-way link for * to parents. This is converted to a two-way link for
* normal bones when leaving editmode. */ * normal bones when leaving editmode.
*/
struct EditBone *parent; struct EditBone *parent;
/** (64 == MAXBONENAME) */ /** (64 == MAXBONENAME) */
char name[64]; char name[64];
/** Roll along axis. We'll ultimately use the axis/angle method /**
* Roll along axis. We'll ultimately use the axis/angle method
* for determining the transformation matrix of the bone. The axis * for determining the transformation matrix of the bone. The axis
* is tail-head while roll provides the angle. Refer to Graphics * is tail-head while roll provides the angle. Refer to Graphics
* Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/ * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere.
*/
float roll; float roll;
/** Orientation and length is implicit during editing */ /** Orientation and length is implicit during editing */
float head[3]; float head[3];
float tail[3]; float tail[3];
/** All joints are considered to have zero rotation with respect to /**
* All joints are considered to have zero rotation with respect to
* their parents. Therefore any rotations specified during the * their parents. Therefore any rotations specified during the
* animation are automatically relative to the bones' rest positions*/ * animation are automatically relative to the bones' rest positions.
*/
int flag; int flag;
int layer; int layer;
char inherit_scale_mode; char inherit_scale_mode;

@ -107,7 +107,7 @@ typedef struct ClothVertex {
float v[3]; /* The velocity of the point. */ float v[3]; /* The velocity of the point. */
float xconst[3]; /* constrained position */ float xconst[3]; /* constrained position */
float x[3]; /* The current position of this vertex. */ float x[3]; /* The current position of this vertex. */
float xold[3]; /* The previous position of this vertex.*/ float xold[3]; /* The previous position of this vertex. */
float tx[3]; /* temporary position */ float tx[3]; /* temporary position */
float txold[3]; /* temporary old position */ float txold[3]; /* temporary old position */
float tv[3]; /* temporary "velocity", mostly used as tv = tx-txold */ float tv[3]; /* temporary "velocity", mostly used as tv = tx-txold */
@ -194,7 +194,7 @@ typedef struct ClothSpring {
} \ } \
((void)0) ((void)0)
/* Spring types as defined in the paper.*/ /* Spring types as defined in the paper. */
typedef enum { typedef enum {
CLOTH_SPRING_TYPE_STRUCTURAL = (1 << 1), CLOTH_SPRING_TYPE_STRUCTURAL = (1 << 1),
CLOTH_SPRING_TYPE_SHEAR = (1 << 2), CLOTH_SPRING_TYPE_SHEAR = (1 << 2),

@ -63,7 +63,7 @@ typedef struct CollPair {
float time; /* collision time, from 0 up to 1 */ float time; /* collision time, from 0 up to 1 */
/* mesh-mesh collision */ /* mesh-mesh collision */
#ifdef WITH_ELTOPO /*either ap* or bp* can be set, but not both*/ #ifdef WITH_ELTOPO /* Either ap* or bp* can be set, but not both. */
float bary[3]; float bary[3];
int ap1, ap2, ap3, collp, bp1, bp2, bp3; int ap1, ap2, ap3, collp, bp1, bp2, bp3;
int collface; int collface;

@ -41,7 +41,7 @@ struct CustomData_MeshMasks;
struct ID; struct ID;
typedef uint64_t CustomDataMask; typedef uint64_t CustomDataMask;
/*a data type large enough to hold 1 element from any customdata layer type*/ /* A data type large enough to hold 1 element from any custom-data layer type. */
typedef struct { typedef struct {
unsigned char data[64]; unsigned char data[64];
} CDBlockBytes; } CDBlockBytes;
@ -109,9 +109,9 @@ bool CustomData_bmesh_has_free(const struct CustomData *data);
*/ */
bool CustomData_has_referenced(const struct CustomData *data); bool CustomData_has_referenced(const struct CustomData *data);
/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to /* Copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
* another, while not overwriting anything else (e.g. flags). probably only * another, while not overwriting anything else (e.g. flags). probably only
* implemented for mloopuv/mloopcol, for now.*/ * implemented for mloopuv/mloopcol, for now. */
void CustomData_data_copy_value(int type, const void *source, void *dest); void CustomData_data_copy_value(int type, const void *source, void *dest);
/* Same as above, but doing advanced mixing. /* Same as above, but doing advanced mixing.
@ -121,7 +121,7 @@ void CustomData_data_mix_value(
/* compares if data1 is equal to data2. type is a valid CustomData type /* compares if data1 is equal to data2. type is a valid CustomData type
* enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare * enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare
* the data, if it exists, otherwise memcmp is used.*/ * the data, if it exists, otherwise memcmp is used. */
bool CustomData_data_equals(int type, const void *data1, const void *data2); bool CustomData_data_equals(int type, const void *data1, const void *data2);
void CustomData_data_initminmax(int type, void *min, void *max); void CustomData_data_initminmax(int type, void *min, void *max);
void CustomData_data_dominmax(int type, const void *data, void *min, void *max); void CustomData_data_dominmax(int type, const void *data, void *min, void *max);
@ -158,7 +158,7 @@ void CustomData_realloc(struct CustomData *data, int totelem);
/* bmesh version of CustomData_merge; merges the layouts of source and dest, /* bmesh version of CustomData_merge; merges the layouts of source and dest,
* then goes through the mesh and makes sure all the customdata blocks are * then goes through the mesh and makes sure all the customdata blocks are
* consistent with the new layout.*/ * consistent with the new layout. */
bool CustomData_bmesh_merge(const struct CustomData *source, bool CustomData_bmesh_merge(const struct CustomData *source,
struct CustomData *dest, struct CustomData *dest,
CustomDataMask mask, CustomDataMask mask,
@ -186,7 +186,7 @@ void CustomData_free_temporary(struct CustomData *data, int totelem);
*/ */
void *CustomData_add_layer( void *CustomData_add_layer(
struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem); struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem);
/*same as above but accepts a name */ /* Same as above but accepts a name. */
void *CustomData_add_layer_named(struct CustomData *data, void *CustomData_add_layer_named(struct CustomData *data,
int type, int type,
eCDAllocType alloctype, eCDAllocType alloctype,
@ -446,7 +446,7 @@ void CustomData_validate_layer_name(const struct CustomData *data,
* only after this test passes, layer->data should be assigned */ * only after this test passes, layer->data should be assigned */
bool CustomData_verify_versions(struct CustomData *data, int index); bool CustomData_verify_versions(struct CustomData *data, int index);
/*BMesh specific customdata stuff*/ /* BMesh specific custom-data stuff. */
void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int totloop); void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int totloop);
void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int total); void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int total);
void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *ldata); void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *ldata);

@ -53,12 +53,12 @@ struct Scene;
typedef struct BMEditMesh { typedef struct BMEditMesh {
struct BMesh *bm; struct BMesh *bm;
/*this is for undoing failed operations*/ /* This is for undoing failed operations. */
struct BMEditMesh *emcopy; struct BMEditMesh *emcopy;
int emcopyusers; int emcopyusers;
/* we store tessellations as triplets of three loops, /* we store tessellations as triplets of three loops,
* which each define a triangle.*/ * which each define a triangle. */
struct BMLoop *(*looptris)[3]; struct BMLoop *(*looptris)[3];
int tottri; int tottri;
@ -67,14 +67,14 @@ typedef struct BMEditMesh {
/** Cached cage bounding box for selection. */ /** Cached cage bounding box for selection. */
struct BoundBox *bb_cage; struct BoundBox *bb_cage;
/*derivedmesh stuff*/ /** Evaluated mesh data-mask. */
CustomData_MeshMasks lastDataMask; CustomData_MeshMasks lastDataMask;
/*selection mode*/ /* Selection mode. */
short selectmode; short selectmode;
short mat_nr; short mat_nr;
/*temp variables for x-mirror editing*/ /* Temp variables for x-mirror editing. */
int mirror_cdlayer; /* -1 is invalid */ int mirror_cdlayer; /* -1 is invalid */
/** /**

@ -179,7 +179,7 @@ unsigned int BKE_sim_debug_data_hash(int i);
unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky); unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky);
/* _VA_SIM_DEBUG_HASH#(i, ...): combined hash value of multiple integers */ /* _VA_SIM_DEBUG_HASH#(i, ...): combined hash value of multiple integers */
/* internal helpers*/ /* Internal helpers. */
#define _VA_SIM_DEBUG_HASH1(a) (BKE_sim_debug_data_hash(a)) #define _VA_SIM_DEBUG_HASH1(a) (BKE_sim_debug_data_hash(a))
#define _VA_SIM_DEBUG_HASH2(a, b) \ #define _VA_SIM_DEBUG_HASH2(a, b) \
(BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b))) (BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b)))

@ -149,7 +149,7 @@ enum {
G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID), G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID),
G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */ G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
G_DEBUG_GPU = (1 << 16), /* gpu debug */ G_DEBUG_GPU = (1 << 16), /* gpu debug */
G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...)*/ G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */ G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
G_DEBUG_XR = (1 << 19), /* XR/OpenXR messages */ G_DEBUG_XR = (1 << 19), /* XR/OpenXR messages */
G_DEBUG_XR_TIME = (1 << 20), /* XR/OpenXR timing messages */ G_DEBUG_XR_TIME = (1 << 20), /* XR/OpenXR timing messages */

@ -67,7 +67,7 @@ void IDP_AppendArray(struct IDProperty *prop, struct IDProperty *item);
void IDP_ResizeIDPArray(struct IDProperty *prop, int len); void IDP_ResizeIDPArray(struct IDProperty *prop, int len);
/* ----------- Numeric Array Type ----------- */ /* ----------- Numeric Array Type ----------- */
/*this function works for strings too!*/ /* This function works for strings too! */
void IDP_ResizeArray(struct IDProperty *prop, int newlen); void IDP_ResizeArray(struct IDProperty *prop, int newlen);
void IDP_FreeArray(struct IDProperty *prop); void IDP_FreeArray(struct IDProperty *prop);

@ -36,7 +36,7 @@ typedef struct MeshPairRemapItem {
int sources_num; int sources_num;
int *indices_src; /* NULL if no source found. */ int *indices_src; /* NULL if no source found. */
float *weights_src; /* NULL if no source found, else, always normalized! */ float *weights_src; /* NULL if no source found, else, always normalized! */
/* UNUSED (at the moment)*/ /* UNUSED (at the moment). */
// float hit_dist; /* FLT_MAX if irrelevant or no source found. */ // float hit_dist; /* FLT_MAX if irrelevant or no source found. */
int island; /* For loops only. */ int island; /* For loops only. */
} MeshPairRemapItem; } MeshPairRemapItem;

@ -382,14 +382,13 @@ void BKE_object_data_batch_cache_dirty_tag(struct ID *object_data);
/* this function returns a superset of the scenes selection based on relationships */ /* this function returns a superset of the scenes selection based on relationships */
typedef enum eObRelationTypes { typedef enum eObRelationTypes {
OB_REL_NONE = 0, /* just the selection as is */ OB_REL_NONE = 0, /* Just the selection as is. */
OB_REL_PARENT = (1 << 0), /* immediate parent */ OB_REL_PARENT = (1 << 0), /* Immediate parent. */
OB_REL_PARENT_RECURSIVE = (1 << 1), /* parents up to root of selection tree*/ OB_REL_PARENT_RECURSIVE = (1 << 1), /* Parents up to root of selection tree. */
OB_REL_CHILDREN = (1 << 2), /* immediate children */ OB_REL_CHILDREN = (1 << 2), /* Immediate children. */
OB_REL_CHILDREN_RECURSIVE = (1 << 3), /* All children */ OB_REL_CHILDREN_RECURSIVE = (1 << 3), /* All children. */
OB_REL_MOD_ARMATURE = (1 << 4), /* Armatures related to the selected objects */ OB_REL_MOD_ARMATURE = (1 << 4), /* Armatures related to the selected objects. */
/* OB_REL_SCENE_CAMERA = (1 << 5), */ /* you might want the scene camera too even if unselected? // OB_REL_SCENE_CAMERA = (1 << 5), /* You might want the scene camera too even if unselected? */
*/
} eObRelationTypes; } eObRelationTypes;
typedef enum eObjectSet { typedef enum eObjectSet {

@ -78,7 +78,7 @@ struct Scene;
for (p = 0; p < psys->totpart; p++) \ for (p = 0; p < psys->totpart; p++) \
if ((pa = psys->particles + p)->state.time > 0.0f) if ((pa = psys->particles + p)->state.time > 0.0f)
/* fast but sure way to get the modifier*/ /* Fast but sure way to get the modifier. */
#define PARTICLE_PSMD \ #define PARTICLE_PSMD \
ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys) ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
@ -190,7 +190,7 @@ typedef struct ParticleCollisionElement {
/* pointers to original data */ /* pointers to original data */
float *x[3], *v[3]; float *x[3], *v[3];
/* values interpolated from original data*/ /* Values interpolated from original data. */
float x0[3], x1[3], x2[3], p[3]; float x0[3], x1[3], x2[3], p[3];
/* results for found intersection point */ /* results for found intersection point */

@ -1856,7 +1856,7 @@ void BKE_pose_blend_write(BlendWriter *writer, bPose *pose, bArmature *arm)
/* Write channels */ /* Write channels */
LISTBASE_FOREACH (bPoseChannel *, chan, &pose->chanbase) { LISTBASE_FOREACH (bPoseChannel *, chan, &pose->chanbase) {
/* Write ID Properties -- and copy this comment EXACTLY for easy finding /* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/ * of library blocks that implement this. */
if (chan->prop) { if (chan->prop) {
IDP_BlendWrite(writer, chan->prop); IDP_BlendWrite(writer, chan->prop);
} }

@ -200,7 +200,7 @@ bool BKE_appdir_folder_documents(char *dir)
return true; return true;
} }
/* Ghost couldn't give us a documents path, let's try if we can find it ourselves.*/ /* Ghost couldn't give us a documents path, let's try if we can find it ourselves. */
const char *home_path = BKE_appdir_folder_home(); const char *home_path = BKE_appdir_folder_home();
if (!home_path || !BLI_is_dir(home_path)) { if (!home_path || !BLI_is_dir(home_path)) {

@ -198,7 +198,7 @@ static void write_bone(BlendWriter *writer, Bone *bone)
BLO_write_struct(writer, Bone, bone); BLO_write_struct(writer, Bone, bone);
/* Write ID Properties -- and copy this comment EXACTLY for easy finding /* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/ * of library blocks that implement this. */
if (bone->prop) { if (bone->prop) {
IDP_BlendWrite(writer, bone->prop); IDP_BlendWrite(writer, bone->prop);
} }

@ -272,7 +272,7 @@ static void setup_app_data(bContext *C,
/* We need to tag this here because events may be handled immediately after. /* We need to tag this here because events may be handled immediately after.
* only the current screen is important because we won't have to handle * only the current screen is important because we won't have to handle
* events from multiple screens at once.*/ * events from multiple screens at once. */
if (curscreen) { if (curscreen) {
BKE_screen_gizmo_tag_refresh(curscreen); BKE_screen_gizmo_tag_refresh(curscreen);
} }

@ -1143,7 +1143,7 @@ static BVHTree *bvhtree_from_editmesh_looptri_create_tree(float epsilon,
bool insert = looptri_mask ? BLI_BITMAP_TEST_BOOL(looptri_mask, i) : true; bool insert = looptri_mask ? BLI_BITMAP_TEST_BOOL(looptri_mask, i) : true;
if (insert) { if (insert) {
/* No reason found to block hit-testing the triangle for snap, so insert it now.*/ /* No reason found to block hit-testing the triangle for snap, so insert it now. */
float co[3][3]; float co[3][3];
copy_v3_v3(co[0], ltri[0]->v->co); copy_v3_v3(co[0], ltri[0]->v->co);
copy_v3_v3(co[1], ltri[1]->v->co); copy_v3_v3(co[1], ltri[1]->v->co);

@ -710,7 +710,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
* unless its duplication is a sub-process of another one. */ * unless its duplication is a sub-process of another one. */
collection_new->id.tag &= ~LIB_TAG_NEW; collection_new->id.tag &= ~LIB_TAG_NEW;
/* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&collection_new->id); BKE_libblock_relink_to_newid(&collection_new->id);
#ifndef NDEBUG #ifndef NDEBUG

@ -1280,12 +1280,12 @@ static void save_sample_line(
{ {
float yuv[3]; float yuv[3];
/* vectorscope*/ /* Vector-scope. */
rgb_to_yuv(rgb[0], rgb[1], rgb[2], &yuv[0], &yuv[1], &yuv[2], BLI_YUV_ITU_BT709); rgb_to_yuv(rgb[0], rgb[1], rgb[2], &yuv[0], &yuv[1], &yuv[2], BLI_YUV_ITU_BT709);
scopes->vecscope[idx + 0] = yuv[1]; scopes->vecscope[idx + 0] = yuv[1];
scopes->vecscope[idx + 1] = yuv[2]; scopes->vecscope[idx + 1] = yuv[2];
/* waveform */ /* Waveform. */
switch (scopes->wavefrm_mode) { switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB: case SCOPES_WAVEFRM_RGB:
case SCOPES_WAVEFRM_RGB_PARADE: case SCOPES_WAVEFRM_RGB_PARADE:
@ -1497,7 +1497,7 @@ static void scopes_update_cb(void *__restrict userdata,
mul_v3_fl(ycc, INV_255); mul_v3_fl(ycc, INV_255);
minmax_v3v3_v3(min, max, ycc); minmax_v3v3_v3(min, max, ycc);
} }
/* increment count for histo*/ /* Increment count for histo. */
bin_lum[get_bin_float(luma)]++; bin_lum[get_bin_float(luma)]++;
bin_r[get_bin_float(rgba[0])]++; bin_r[get_bin_float(rgba[0])]++;
bin_g[get_bin_float(rgba[1])]++; bin_g[get_bin_float(rgba[1])]++;

@ -222,7 +222,7 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
/* XXX This would seem to be in wrong order. However, it does not work in 'right' order - /* XXX This would seem to be in wrong order. However, it does not work in 'right' order -
* would be nice to understand why premul is needed here instead of usual postmul? * would be nice to understand why premul is needed here instead of usual postmul?
* In any case, we **do not get a delta** here (e.g. startmat & matrix having same location, * In any case, we **do not get a delta** here (e.g. startmat & matrix having same location,
* still gives a 'delta' with non-null translation component :/ ).*/ * still gives a 'delta' with non-null translation component :/ ). */
mul_m4_m4m4(delta, cob->matrix, imat); mul_m4_m4m4(delta, cob->matrix, imat);
/* copy matrices back to source */ /* copy matrices back to source */
@ -1491,7 +1491,7 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
dir, dir,
(data->followflag & FOLLOWPATH_FOLLOW) ? quat : NULL, (data->followflag & FOLLOWPATH_FOLLOW) ? quat : NULL,
&radius, &radius,
NULL)) { /* quat_pt is quat or NULL*/ NULL)) { /* quat_pt is quat or NULL. */
float totmat[4][4]; float totmat[4][4];
unit_m4(totmat); unit_m4(totmat);
@ -2361,7 +2361,7 @@ static void pycon_new_data(void *cdata)
{ {
bPythonConstraint *data = (bPythonConstraint *)cdata; bPythonConstraint *data = (bPythonConstraint *)cdata;
/* everything should be set correctly by calloc, except for the prop->type constant.*/ /* Everything should be set correctly by calloc, except for the prop->type constant. */
data->prop = MEM_callocN(sizeof(IDProperty), "PyConstraintProps"); data->prop = MEM_callocN(sizeof(IDProperty), "PyConstraintProps");
data->prop->type = IDP_GROUP; data->prop->type = IDP_GROUP;
} }
@ -3523,7 +3523,7 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
scale[0] = 1.0; scale[0] = 1.0;
scale[2] = 1.0; scale[2] = 1.0;
break; break;
default: /* should not happen, but in case*/ default: /* Should not happen, but in case. */
return; return;
} /* switch (data->volmode) */ } /* switch (data->volmode) */
@ -6297,7 +6297,7 @@ void BKE_constraint_blend_write(BlendWriter *writer, ListBase *conlist)
} }
/* Write ID Properties -- and copy this comment EXACTLY for easy finding /* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/ * of library blocks that implement this. */
IDP_BlendWrite(writer, data->prop); IDP_BlendWrite(writer, data->prop);
break; break;

@ -32,8 +32,8 @@
struct Knot { struct Knot {
struct Knot *next, *prev; struct Knot *next, *prev;
uint point_index; /* index in point array */ uint point_index; /* Index in point array. */
uint knot_index; /* index in knot array*/ uint knot_index; /* Index in knot array. */
float tan[2][3]; float tan[2][3];
float handles[2]; float handles[2];

@ -2099,7 +2099,7 @@ bool CustomData_merge(const struct CustomData *source,
eCDAllocType alloctype, eCDAllocType alloctype,
int totelem) int totelem)
{ {
/*const LayerTypeInfo *typeInfo;*/ // const LayerTypeInfo *typeInfo;
CustomDataLayer *layer, *newlayer; CustomDataLayer *layer, *newlayer;
int lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0; int lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0;
int number = 0, maxnumber = -1; int number = 0, maxnumber = -1;
@ -2107,7 +2107,7 @@ bool CustomData_merge(const struct CustomData *source,
for (int i = 0; i < source->totlayer; i++) { for (int i = 0; i < source->totlayer; i++) {
layer = &source->layers[i]; layer = &source->layers[i];
/*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/ // typeInfo = layerType_getInfo(layer->type); /* UNUSED */
int type = layer->type; int type = layer->type;
int flag = layer->flag; int flag = layer->flag;
@ -2631,7 +2631,7 @@ void *CustomData_add_layer(
return NULL; return NULL;
} }
/*same as above but accepts a name*/ /* Same as above but accepts a name. */
void *CustomData_add_layer_named(CustomData *data, void *CustomData_add_layer_named(CustomData *data,
int type, int type,
eCDAllocType alloctype, eCDAllocType alloctype,
@ -3567,7 +3567,7 @@ bool CustomData_bmesh_merge(const CustomData *source,
if (iter_type != BM_LOOPS_OF_FACE) { if (iter_type != BM_LOOPS_OF_FACE) {
BMHeader *h; BMHeader *h;
BMIter iter; BMIter iter;
/*ensure all current elements follow new customdata layout*/ /* Ensure all current elements follow new customdata layout. */
BM_ITER_MESH (h, &iter, bm, iter_type) { BM_ITER_MESH (h, &iter, bm, iter_type) {
void *tmp = NULL; void *tmp = NULL;
CustomData_bmesh_copy_data(&destold, dest, h->data, &tmp); CustomData_bmesh_copy_data(&destold, dest, h->data, &tmp);
@ -3581,7 +3581,7 @@ bool CustomData_bmesh_merge(const CustomData *source,
BMIter iter; BMIter iter;
BMIter liter; BMIter liter;
/*ensure all current elements follow new customdata layout*/ /* Ensure all current elements follow new customdata layout. */
BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) { BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
void *tmp = NULL; void *tmp = NULL;
@ -3805,7 +3805,7 @@ void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int
return POINTER_OFFSET(block, data->layers[layer_index + n].offset); return POINTER_OFFSET(block, data->layers[layer_index + n].offset);
} }
/*gets from the layer at physical index n, note: doesn't check type.*/ /* Gets from the layer at physical index n, note: doesn't check type. */
void *CustomData_bmesh_get_layer_n(const CustomData *data, void *block, int n) void *CustomData_bmesh_get_layer_n(const CustomData *data, void *block, int n)
{ {
if (n < 0 || n >= data->totlayer) { if (n < 0 || n >= data->totlayer) {
@ -3887,7 +3887,7 @@ bool CustomData_has_referenced(const struct CustomData *data)
} }
/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to /* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
* another, while not overwriting anything else (e.g. flags)*/ * another, while not overwriting anything else (e.g. flags). */
void CustomData_data_copy_value(int type, const void *source, void *dest) void CustomData_data_copy_value(int type, const void *source, void *dest)
{ {
const LayerTypeInfo *typeInfo = layerType_getInfo(type); const LayerTypeInfo *typeInfo = layerType_getInfo(type);
@ -3905,7 +3905,7 @@ void CustomData_data_copy_value(int type, const void *source, void *dest)
} }
/* Mixes the "value" (e.g. mloopuv uv or mloopcol colors) from one block into /* Mixes the "value" (e.g. mloopuv uv or mloopcol colors) from one block into
* another, while not overwriting anything else (e.g. flags)*/ * another, while not overwriting anything else (e.g. flags). */
void CustomData_data_mix_value( void CustomData_data_mix_value(
int type, const void *source, void *dest, const int mixmode, const float mixfactor) int type, const void *source, void *dest, const int mixmode, const float mixfactor)
{ {

@ -1260,7 +1260,7 @@ void BKE_object_data_transfer_layout(struct Depsgraph *depsgraph,
me_dst = ob_dst->data; me_dst = ob_dst->data;
/* Get source evaluated mesh.*/ /* Get source evaluated mesh. */
BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask); BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask);
me_src = mesh_get_eval_final(depsgraph, scene, ob_src, &me_src_mask); me_src = mesh_get_eval_final(depsgraph, scene, ob_src, &me_src_mask);
if (!me_src) { if (!me_src) {
@ -1441,7 +1441,7 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph,
} }
} }
/* Get source evaluated mesh.*/ /* Get source evaluated mesh. */
BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask); BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask);
BKE_mesh_remap_calc_source_cddata_masks_from_map_modes( BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(
map_vert_mode, map_edge_mode, map_loop_mode, map_poly_mode, &me_src_mask); map_vert_mode, map_edge_mode, map_loop_mode, map_poly_mode, &me_src_mask);

@ -1757,7 +1757,7 @@ void dynamicPaint_clearSurface(const Scene *scene, DynamicPaintSurface *surface)
} }
} }
/* completely (re)initializes surface (only for point cache types)*/ /* Completely (re)initializes surface (only for point cache types). */
bool dynamicPaint_resetSurface(const Scene *scene, DynamicPaintSurface *surface) bool dynamicPaint_resetSurface(const Scene *scene, DynamicPaintSurface *surface)
{ {
int numOfPoints = dynamicPaint_surfaceNumOfPoints(surface); int numOfPoints = dynamicPaint_surfaceNumOfPoints(surface);
@ -4145,7 +4145,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
/* mix final sample strength depending on brush settings */ /* mix final sample strength depending on brush settings */
if (hit_found) { if (hit_found) {
/* if "negate volume" enabled, negate all factors within volume*/ /* If "negate volume" enabled, negate all factors within volume. */
if (brush->collision == MOD_DPAINT_COL_VOLDIST && brush->flags & MOD_DPAINT_NEGATE_VOLUME) { if (brush->collision == MOD_DPAINT_COL_VOLDIST && brush->flags & MOD_DPAINT_NEGATE_VOLUME) {
volume_factor = 1.0f - volume_factor; volume_factor = 1.0f - volume_factor;
if (inner_proximity) { if (inner_proximity) {

@ -222,7 +222,7 @@ void BKE_editmesh_free_derivedmesh(BMEditMesh *em)
MEM_SAFE_FREE(em->bb_cage); MEM_SAFE_FREE(em->bb_cage);
} }
/*does not free the BMEditMesh struct itself*/ /* Does not free the #BMEditMesh struct itself. */
void BKE_editmesh_free(BMEditMesh *em) void BKE_editmesh_free(BMEditMesh *em)
{ {
BKE_editmesh_free_derivedmesh(em); BKE_editmesh_free_derivedmesh(em);

@ -773,7 +773,7 @@ int get_effector_data(EffectorCache *eff,
/* use center of object for distance calculus */ /* use center of object for distance calculus */
const Object *ob = eff->ob; const Object *ob = eff->ob;
/* use z-axis as normal*/ /* Use z-axis as normal. */
normalize_v3_v3(efd->nor, ob->obmat[2]); normalize_v3_v3(efd->nor, ob->obmat[2]);
if (eff->pd && ELEM(eff->pd->shape, PFIELD_SHAPE_PLANE, PFIELD_SHAPE_LINE)) { if (eff->pd && ELEM(eff->pd->shape, PFIELD_SHAPE_PLANE, PFIELD_SHAPE_LINE)) {

@ -1309,7 +1309,7 @@ void calchandles_fcurve_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
* - Need bezier keys. * - Need bezier keys.
* - Only bezier-interpolation has handles (for now). * - Only bezier-interpolation has handles (for now).
*/ */
if (ELEM(NULL, fcu, fcu->bezt) || (a < 2) /*|| ELEM(fcu->ipo, BEZT_IPO_CONST, BEZT_IPO_LIN)*/) { if (ELEM(NULL, fcu, fcu->bezt) || (a < 2) /*|| ELEM(fcu->ipo, BEZT_IPO_CONST, BEZT_IPO_LIN) */) {
return; return;
} }
@ -2322,7 +2322,7 @@ void BKE_fmodifiers_blend_write(BlendWriter *writer, ListBase *fmodifiers)
FMod_Python *data = fcm->data; FMod_Python *data = fcm->data;
/* Write ID Properties -- and copy this comment EXACTLY for easy finding /* Write ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/ * of library blocks that implement this. */
IDP_BlendWrite(writer, data->prop); IDP_BlendWrite(writer, data->prop);
break; break;

@ -4395,7 +4395,7 @@ static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *v
int cell[3]; int cell[3];
float t_ray = 1.0; float t_ray = 1.0;
/* Reset shadow value.*/ /* Reset shadow value. */
shadow[index] = -1.0f; shadow[index] = -1.0f;
voxel_center[0] = (float)x; voxel_center[0] = (float)x;
@ -5023,7 +5023,7 @@ void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd,
/* viscosity options */ /* viscosity options */
tfds->viscosity_value = fds->viscosity_value; tfds->viscosity_value = fds->viscosity_value;
/* diffusion options*/ /* Diffusion options. */
tfds->surface_tension = fds->surface_tension; tfds->surface_tension = fds->surface_tension;
tfds->viscosity_base = fds->viscosity_base; tfds->viscosity_base = fds->viscosity_base;
tfds->viscosity_exponent = fds->viscosity_exponent; tfds->viscosity_exponent = fds->viscosity_exponent;

@ -875,7 +875,7 @@ static void fcm_python_new_data(void *mdata)
{ {
FMod_Python *data = (FMod_Python *)mdata; FMod_Python *data = (FMod_Python *)mdata;
/* everything should be set correctly by calloc, except for the prop->type constant.*/ /* Everything should be set correctly by calloc, except for the prop->type constant. */
data->prop = MEM_callocN(sizeof(IDProperty), "PyFModifierProps"); data->prop = MEM_callocN(sizeof(IDProperty), "PyFModifierProps");
data->prop->type = IDP_GROUP; data->prop->type = IDP_GROUP;
} }

@ -1746,7 +1746,7 @@ void BKE_vfont_clipboard_set(const char32_t *text_buf, const CharInfo *info_buf,
char32_t *text; char32_t *text;
CharInfo *info; CharInfo *info;
/* clean previous buffers*/ /* Clean previous buffers. */
BKE_vfont_clipboard_free(); BKE_vfont_clipboard_free();
text = MEM_malloc_arrayN((len + 1), sizeof(*text), __func__); text = MEM_malloc_arrayN((len + 1), sizeof(*text), __func__);

@ -195,12 +195,12 @@ static void greasepencil_blend_write(BlendWriter *writer, ID *id, const void *id
void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd) void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
{ {
/* we must firstly have some grease-pencil data to link! */ /* We must firstly have some grease-pencil data to link! */
if (gpd == NULL) { if (gpd == NULL) {
return; return;
} }
/* relink animdata */ /* Relink anim-data. */
BLO_read_data_address(reader, &gpd->adt); BLO_read_data_address(reader, &gpd->adt);
BKE_animdata_blend_read_data(reader, gpd->adt); BKE_animdata_blend_read_data(reader, gpd->adt);
@ -219,7 +219,7 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
gpd->runtime.sbuffer_size = 0; gpd->runtime.sbuffer_size = 0;
gpd->runtime.tot_cp_points = 0; gpd->runtime.tot_cp_points = 0;
/* relink palettes (old palettes deprecated, only to convert old files) */ /* Relink palettes (old palettes deprecated, only to convert old files). */
BLO_read_list(reader, &gpd->palettes); BLO_read_list(reader, &gpd->palettes);
if (gpd->palettes.first != NULL) { if (gpd->palettes.first != NULL) {
LISTBASE_FOREACH (bGPDpalette *, palette, &gpd->palettes) { LISTBASE_FOREACH (bGPDpalette *, palette, &gpd->palettes) {
@ -227,14 +227,14 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
} }
} }
/* materials */ /* Materials. */
BLO_read_pointer_array(reader, (void **)&gpd->mat); BLO_read_pointer_array(reader, (void **)&gpd->mat);
/* relink layers */ /* Relink layers. */
BLO_read_list(reader, &gpd->layers); BLO_read_list(reader, &gpd->layers);
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
/* relink frames */ /* Relink frames. */
BLO_read_list(reader, &gpl->frames); BLO_read_list(reader, &gpl->frames);
BLO_read_data_address(reader, &gpl->actframe); BLO_read_data_address(reader, &gpl->actframe);
@ -245,23 +245,23 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
BLO_read_list(reader, &gpl->mask_layers); BLO_read_list(reader, &gpl->mask_layers);
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
/* relink strokes (and their points) */ /* Relink strokes (and their points). */
BLO_read_list(reader, &gpf->strokes); BLO_read_list(reader, &gpf->strokes);
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
/* relink stroke points array */ /* Relink stroke points array. */
BLO_read_data_address(reader, &gps->points); BLO_read_data_address(reader, &gps->points);
/* Relink geometry*/ /* Relink geometry. */
BLO_read_data_address(reader, &gps->triangles); BLO_read_data_address(reader, &gps->triangles);
/* relink stroke edit curve. */ /* Relink stroke edit curve. */
BLO_read_data_address(reader, &gps->editcurve); BLO_read_data_address(reader, &gps->editcurve);
if (gps->editcurve != NULL) { if (gps->editcurve != NULL) {
/* relink curve point array */ /* Relink curve point array. */
BLO_read_data_address(reader, &gps->editcurve->curve_points); BLO_read_data_address(reader, &gps->editcurve->curve_points);
} }
/* relink weight data */ /* Relink weight data. */
if (gps->dvert) { if (gps->dvert) {
BLO_read_data_address(reader, &gps->dvert); BLO_read_data_address(reader, &gps->dvert);
BKE_defvert_blend_read(reader, gps->totpoints, gps->dvert); BKE_defvert_blend_read(reader, gps->totpoints, gps->dvert);
@ -458,7 +458,7 @@ void BKE_gpencil_free_frames(bGPDlayer *gpl)
void BKE_gpencil_free_layer_masks(bGPDlayer *gpl) void BKE_gpencil_free_layer_masks(bGPDlayer *gpl)
{ {
/* Free masks.*/ /* Free masks. */
bGPDlayer_Mask *mask_next = NULL; bGPDlayer_Mask *mask_next = NULL;
for (bGPDlayer_Mask *mask = gpl->mask_layers.first; mask; mask = mask_next) { for (bGPDlayer_Mask *mask = gpl->mask_layers.first; mask; mask = mask_next) {
mask_next = mask->next; mask_next = mask->next;
@ -482,7 +482,7 @@ void BKE_gpencil_free_layers(ListBase *list)
/* free layers and their data */ /* free layers and their data */
BKE_gpencil_free_frames(gpl); BKE_gpencil_free_frames(gpl);
/* Free masks.*/ /* Free masks. */
BKE_gpencil_free_layer_masks(gpl); BKE_gpencil_free_layer_masks(gpl);
BLI_freelinkN(list, gpl); BLI_freelinkN(list, gpl);

@ -243,7 +243,7 @@ static int gpencil_get_stroke_material_fromcurve(
/* If the curve has 2 materials, the first is considered as Fill and the second as Stroke. /* If the curve has 2 materials, the first is considered as Fill and the second as Stroke.
* If the has only one material, if the name contains _stroke, the is used * If the has only one material, if the name contains _stroke, the is used
* as stroke, else as fill.*/ * as stroke, else as fill. */
if (ob_cu->totcol >= 2) { if (ob_cu->totcol >= 2) {
*do_stroke = true; *do_stroke = true;
*do_fill = true; *do_fill = true;
@ -350,7 +350,7 @@ static void gpencil_convert_spline(Main *bmain,
/* Assign material index to stroke. */ /* Assign material index to stroke. */
gps->mat_nr = r_idx; gps->mat_nr = r_idx;
/* Add stroke to frame.*/ /* Add stroke to frame. */
BLI_addtail(&gpf->strokes, gps); BLI_addtail(&gpf->strokes, gps);
float *coord_array = NULL; float *coord_array = NULL;

@ -2050,7 +2050,7 @@ void BKE_gpencil_stroke_subdivide(bGPdata *gpd, bGPDstroke *gps, int level, int
MEM_SAFE_FREE(temp_points); MEM_SAFE_FREE(temp_points);
MEM_SAFE_FREE(temp_dverts); MEM_SAFE_FREE(temp_dverts);
/* move points to smooth stroke (not simple type )*/ /* Move points to smooth stroke (not simple type). */
if (type != GP_SUBDIV_SIMPLE) { if (type != GP_SUBDIV_SIMPLE) {
/* duplicate points in a temp area with the new subdivide data */ /* duplicate points in a temp area with the new subdivide data */
temp_points = MEM_dupallocN(gps->points); temp_points = MEM_dupallocN(gps->points);
@ -2133,7 +2133,7 @@ void BKE_gpencil_stroke_merge_distance(bGPdata *gpd,
else { else {
pt->flag |= GP_SPOINT_TAG; pt->flag |= GP_SPOINT_TAG;
} }
/* Jump to next pair of points, keeping first point segment equals.*/ /* Jump to next pair of points, keeping first point segment equals. */
step++; step++;
} }
else { else {
@ -2868,7 +2868,7 @@ static void gpencil_stroke_join_islands(bGPdata *gpd,
MDeformVert *dvert_src = NULL; MDeformVert *dvert_src = NULL;
MDeformVert *dvert_dst = NULL; MDeformVert *dvert_dst = NULL;
/* Copy weights (last before)*/ /* Copy weights (last before). */
e1 = 0; e1 = 0;
e2 = 0; e2 = 0;
for (int i = 0; i < totpoints; i++) { for (int i = 0; i < totpoints; i++) {

@ -54,15 +54,15 @@
static CLG_LogRef LOG = {"bke.idprop"}; static CLG_LogRef LOG = {"bke.idprop"};
/*local size table.*/ /* Local size table. */
static size_t idp_size_table[] = { static size_t idp_size_table[] = {
1, /*strings*/ 1, /*strings*/
sizeof(int), sizeof(int),
sizeof(float), sizeof(float),
sizeof(float[3]), /*Vector type, deprecated*/ sizeof(float[3]), /* Vector type, deprecated. */
sizeof(float[16]), /*Matrix type, deprecated*/ sizeof(float[16]), /* Matrix type, deprecated. */
0, /*arrays don't have a fixed size*/ 0, /* Arrays don't have a fixed size. */
sizeof(ListBase), /*Group type*/ sizeof(ListBase), /* Group type. */
sizeof(void *), sizeof(void *),
sizeof(double), sizeof(double),
}; };
@ -99,12 +99,12 @@ IDProperty *IDP_CopyIDPArray(const IDProperty *array, const int flag)
narray->data.pointer = MEM_dupallocN(array->data.pointer); narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (int i = 0; i < narray->len; i++) { for (int i = 0; i < narray->len; i++) {
/* ok, the copy functions always allocate a new structure, /* OK, the copy functions always allocate a new structure,
* which doesn't work here. instead, simply copy the * which doesn't work here. instead, simply copy the
* contents of the new structure into the array cell, * contents of the new structure into the array cell,
* then free it. this makes for more maintainable * then free it. this makes for more maintainable
* code than simply re-implementing the copy functions * code than simply re-implementing the copy functions
* in this loop.*/ * in this loop. */
IDProperty *tmp = IDP_CopyProperty_ex(GETPROP(narray, i), flag); IDProperty *tmp = IDP_CopyProperty_ex(GETPROP(narray, i), flag);
memcpy(GETPROP(narray, i), tmp, sizeof(IDProperty)); memcpy(GETPROP(narray, i), tmp, sizeof(IDProperty));
MEM_freeN(tmp); MEM_freeN(tmp);
@ -228,7 +228,7 @@ static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
} }
} }
/*this function works for strings too!*/ /* This function works for strings too! */
void IDP_ResizeArray(IDProperty *prop, int newlen) void IDP_ResizeArray(IDProperty *prop, int newlen)
{ {
const bool is_grow = newlen >= prop->len; const bool is_grow = newlen >= prop->len;
@ -390,8 +390,8 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st)
BLI_assert(prop->type == IDP_STRING); BLI_assert(prop->type == IDP_STRING);
int newlen = prop->len + (int)strlen(st); int newlen = prop->len + (int)strlen(st);
/* we have to remember that prop->len includes the null byte for strings. /* We have to remember that prop->len includes the null byte for strings.
* so there's no need to add +1 to the resize function.*/ * so there's no need to add +1 to the resize function. */
IDP_ResizeArray(prop, newlen); IDP_ResizeArray(prop, newlen);
strcat(prop->data.pointer, st); strcat(prop->data.pointer, st);
} }
@ -400,8 +400,8 @@ void IDP_ConcatString(IDProperty *str1, IDProperty *append)
{ {
BLI_assert(append->type == IDP_STRING); BLI_assert(append->type == IDP_STRING);
/* since ->len for strings includes the NULL byte, we have to subtract one or /* Since ->len for strings includes the NULL byte, we have to subtract one or
* we'll get an extra null byte after each concatenation operation.*/ * we'll get an extra null byte after each concatenation operation. */
int newlen = str1->len + append->len - 1; int newlen = str1->len + append->len - 1;
IDP_ResizeArray(str1, newlen); IDP_ResizeArray(str1, newlen);
strcat(str1->data.pointer, append->data.pointer); strcat(str1->data.pointer, append->data.pointer);
@ -775,10 +775,10 @@ IDProperty *IDP_GetProperties(ID *id, const bool create_if_needed)
if (create_if_needed) { if (create_if_needed) {
id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty"); id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty");
id->properties->type = IDP_GROUP; id->properties->type = IDP_GROUP;
/* don't overwrite the data's name and type /* NOTE(campbell): Don't overwrite the data's name and type
* some functions might need this if they * some functions might need this if they
* don't have a real ID, should be named elsewhere - Campbell */ * don't have a real ID, should be named elsewhere. */
/* strcpy(id->name, "top_level_group");*/ // strcpy(id->name, "top_level_group");
} }
return id->properties; return id->properties;
} }
@ -1219,7 +1219,7 @@ static void IDP_DirectLinkArray(IDProperty *prop, BlendDataReader *reader)
static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader) static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader)
{ {
/*since we didn't save the extra string buffer, set totallen to len.*/ /* Since we didn't save the extra string buffer, set totallen to len. */
prop->totallen = prop->len; prop->totallen = prop->len;
BLO_read_data_address(reader, &prop->data.pointer); BLO_read_data_address(reader, &prop->data.pointer);
} }
@ -1230,7 +1230,7 @@ static void IDP_DirectLinkGroup(IDProperty *prop, BlendDataReader *reader)
BLO_read_list(reader, lb); BLO_read_list(reader, lb);
/*Link child id properties now*/ /* Link child id properties now. */
LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) { LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) {
IDP_DirectLinkProperty(loop, reader); IDP_DirectLinkProperty(loop, reader);
} }

@ -3208,7 +3208,7 @@ Image *BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
ima = image_alloc(bmain, name, IMA_SRC_VIEWER, type); ima = image_alloc(bmain, name, IMA_SRC_VIEWER, type);
} }
/* happens on reload, imagewindow cannot be image user when hidden*/ /* Happens on reload, imagewindow cannot be image user when hidden. */
if (ima->id.us == 0) { if (ima->id.us == 0) {
id_us_ensure_real(&ima->id); id_us_ensure_real(&ima->id);
} }
@ -4349,7 +4349,7 @@ static ImBuf *load_movie_single(Image *ima, ImageUser *iuser, int frame, const i
BKE_image_user_file_path(&iuser_t, ima, str); BKE_image_user_file_path(&iuser_t, ima, str);
/* FIXME: make several stream accessible in image editor, too*/ /* FIXME: make several stream accessible in image editor, too. */
ia->anim = openanim(str, flags, 0, ima->colorspace_settings.name); ia->anim = openanim(str, flags, 0, ima->colorspace_settings.name);
/* let's initialize this user */ /* let's initialize this user */

@ -207,7 +207,7 @@ static bool image_save_single(ReportList *reports,
goto cleanup; goto cleanup;
} }
/* it shouldn't ever happen*/ /* It shouldn't ever happen. */
if ((BLI_findstring(&rr->views, STEREO_LEFT_NAME, offsetof(RenderView, name)) == NULL) || if ((BLI_findstring(&rr->views, STEREO_LEFT_NAME, offsetof(RenderView, name)) == NULL) ||
(BLI_findstring(&rr->views, STEREO_RIGHT_NAME, offsetof(RenderView, name)) == NULL)) { (BLI_findstring(&rr->views, STEREO_RIGHT_NAME, offsetof(RenderView, name)) == NULL)) {
BKE_reportf(reports, BKE_reportf(reports,

@ -819,7 +819,7 @@ static void layer_collection_sync(ViewLayer *view_layer,
} }
/* We separate restrict viewport and visible view layer because a layer collection can be /* We separate restrict viewport and visible view layer because a layer collection can be
* hidden in the view layer yet (locally) visible in a viewport (if it is not restricted).*/ * hidden in the view layer yet (locally) visible in a viewport (if it is not restricted). */
if (child_restrict & COLLECTION_RESTRICT_VIEWPORT) { if (child_restrict & COLLECTION_RESTRICT_VIEWPORT) {
lc->runtime_flag |= LAYER_COLLECTION_RESTRICT_VIEWPORT; lc->runtime_flag |= LAYER_COLLECTION_RESTRICT_VIEWPORT;
} }

@ -158,7 +158,7 @@ static void metaball_blend_read_data(BlendDataReader *reader, ID *id)
mb->editelems = NULL; mb->editelems = NULL;
/* Must always be cleared (meta's don't have their own edit-data). */ /* Must always be cleared (meta's don't have their own edit-data). */
mb->needs_flush_to_id = 0; mb->needs_flush_to_id = 0;
/* mb->edit_elems.first= mb->edit_elems.last= NULL;*/ // mb->edit_elems.first = mb->edit_elems.last = NULL;
mb->lastelem = NULL; mb->lastelem = NULL;
mb->batch_cache = NULL; mb->batch_cache = NULL;
} }

@ -413,8 +413,7 @@ static const char *cmpcode_to_str(int code)
} }
} }
/* thresh is threshold for comparing vertices, uvs, vertex colors, /** Thresh is threshold for comparing vertices, UV's, vertex colors, weights, etc. */
* weights, etc.*/
static int customdata_compare( static int customdata_compare(
CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, const float thresh) CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, const float thresh)
{ {
@ -479,11 +478,11 @@ static int customdata_compare(
if (len_squared_v3v3(v1->co, v2->co) > thresh_sq) { if (len_squared_v3v3(v1->co, v2->co) > thresh_sq) {
return MESHCMP_VERTCOMISMATCH; return MESHCMP_VERTCOMISMATCH;
} }
/* I don't care about normals, let's just do coordinates */ /* I don't care about normals, let's just do coordinates. */
} }
} }
/*we're order-agnostic for edges here*/ /* We're order-agnostic for edges here. */
if (l1->type == CD_MEDGE) { if (l1->type == CD_MEDGE) {
MEdge *e1 = l1->data; MEdge *e1 = l1->data;
MEdge *e2 = l2->data; MEdge *e2 = l2->data;
@ -748,12 +747,14 @@ bool BKE_mesh_clear_facemap_customdata(struct Mesh *me)
return changed; return changed;
} }
/* this ensures grouped customdata (e.g. mtexpoly and mloopuv and mtface, or /**
* This ensures grouped customdata (e.g. mtexpoly and mloopuv and mtface, or
* mloopcol and mcol) have the same relative active/render/clone/mask indices. * mloopcol and mcol) have the same relative active/render/clone/mask indices.
* *
* note that for undo mesh data we want to skip 'ensure_tess_cd' call since * NOTE(campbell): that for undo mesh data we want to skip 'ensure_tess_cd' call since
* we don't want to store memory for tessface when its only used for older * we don't want to store memory for tessface when its only used for older
* versions of the mesh. - campbell*/ * Versions of the mesh.
*/
static void mesh_update_linked_customdata(Mesh *me, const bool do_ensure_tess_cd) static void mesh_update_linked_customdata(Mesh *me, const bool do_ensure_tess_cd)
{ {
if (do_ensure_tess_cd) { if (do_ensure_tess_cd) {
@ -811,7 +812,7 @@ static void mesh_clear_geometry(Mesh *mesh)
/* Note that materials and shape keys are not freed here. This is intentional, as freeing /* Note that materials and shape keys are not freed here. This is intentional, as freeing
* shape keys requires tagging the depsgraph for updated relations, which is expensive. * shape keys requires tagging the depsgraph for updated relations, which is expensive.
* Material slots should be kept in sync with the object.*/ * Material slots should be kept in sync with the object. */
mesh->totvert = 0; mesh->totvert = 0;
mesh->totedge = 0; mesh->totedge = 0;

@ -304,7 +304,7 @@ static IMesh meshes_to_imesh(Span<const Mesh *> meshes,
r_info->mesh_edge_offset[mi] = e; r_info->mesh_edge_offset[mi] = e;
r_info->mesh_poly_offset[mi] = f; r_info->mesh_poly_offset[mi] = f;
/* Get matrix that transforms a coordinate in objects[mi]'s local space /* Get matrix that transforms a coordinate in objects[mi]'s local space
* to the target space space.*/ * to the target space space. */
const float4x4 objn_mat = (obmats[mi] == nullptr) ? float4x4::identity() : const float4x4 objn_mat = (obmats[mi] == nullptr) ? float4x4::identity() :
clean_obmat(*obmats[mi]); clean_obmat(*obmats[mi]);
r_info->to_target_transform[mi] = inv_target_mat * objn_mat; r_info->to_target_transform[mi] = inv_target_mat * objn_mat;

@ -3280,8 +3280,8 @@ void BKE_mesh_flush_select_from_polys_ex(MVert *mvert,
i = totpoly; i = totpoly;
for (mp = mpoly; i--; mp++) { for (mp = mpoly; i--; mp++) {
/* assume if its selected its not hidden and none of its verts/edges are hidden /* Assume if its selected its not hidden and none of its verts/edges are hidden
* (a common assumption)*/ * (a common assumption). */
if (mp->flag & ME_FACE_SEL) { if (mp->flag & ME_FACE_SEL) {
const MLoop *ml; const MLoop *ml;
int j; int j;

@ -606,11 +606,11 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
MEM_freeN(poly_keys); MEM_freeN(poly_keys);
} }
/*create new cddm*/ /* Create new cddm. */
result = BKE_mesh_new_nomain_from_template( result = BKE_mesh_new_nomain_from_template(
mesh, STACK_SIZE(mvert), STACK_SIZE(medge), 0, STACK_SIZE(mloop), STACK_SIZE(mpoly)); mesh, STACK_SIZE(mvert), STACK_SIZE(medge), 0, STACK_SIZE(mloop), STACK_SIZE(mpoly));
/*update edge indices and copy customdata*/ /* Update edge indices and copy customdata. */
med = medge; med = medge;
for (i = 0; i < result->totedge; i++, med++) { for (i = 0; i < result->totedge; i++, med++) {
BLI_assert(newv[med->v1] != -1); BLI_assert(newv[med->v1] != -1);
@ -624,7 +624,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
CustomData_copy_data(&mesh->edata, &result->edata, olde[i], i, 1); CustomData_copy_data(&mesh->edata, &result->edata, olde[i], i, 1);
} }
/*update loop indices and copy customdata*/ /* Update loop indices and copy customdata. */
ml = mloop; ml = mloop;
for (i = 0; i < result->totloop; i++, ml++) { for (i = 0; i < result->totloop; i++, ml++) {
/* Edge remapping has already be done in main loop handling part above. */ /* Edge remapping has already be done in main loop handling part above. */
@ -634,19 +634,19 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
CustomData_copy_data(&mesh->ldata, &result->ldata, oldl[i], i, 1); CustomData_copy_data(&mesh->ldata, &result->ldata, oldl[i], i, 1);
} }
/*copy vertex customdata*/ /* Copy vertex customdata. */
mv = mvert; mv = mvert;
for (i = 0; i < result->totvert; i++, mv++) { for (i = 0; i < result->totvert; i++, mv++) {
CustomData_copy_data(&mesh->vdata, &result->vdata, oldv[i], i, 1); CustomData_copy_data(&mesh->vdata, &result->vdata, oldv[i], i, 1);
} }
/*copy poly customdata*/ /* Copy poly customdata. */
mp = mpoly; mp = mpoly;
for (i = 0; i < result->totpoly; i++, mp++) { for (i = 0; i < result->totpoly; i++, mp++) {
CustomData_copy_data(&mesh->pdata, &result->pdata, oldp[i], i, 1); CustomData_copy_data(&mesh->pdata, &result->pdata, oldp[i], i, 1);
} }
/*copy over data. CustomData_add_layer can do this, need to look it up.*/ /* Copy over data. #CustomData_add_layer can do this, need to look it up. */
memcpy(result->mvert, mvert, sizeof(MVert) * STACK_SIZE(mvert)); memcpy(result->mvert, mvert, sizeof(MVert) * STACK_SIZE(mvert));
memcpy(result->medge, medge, sizeof(MEdge) * STACK_SIZE(medge)); memcpy(result->medge, medge, sizeof(MEdge) * STACK_SIZE(medge));
memcpy(result->mloop, mloop, sizeof(MLoop) * STACK_SIZE(mloop)); memcpy(result->mloop, mloop, sizeof(MLoop) * STACK_SIZE(mloop));

@ -1320,7 +1320,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(
clip->lastframe = framenr; clip->lastframe = framenr;
real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]); real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]);
/* postprocess frame and put to cache if needed*/ /* Post-process frame and put to cache if needed. */
if (need_postprocess) { if (need_postprocess) {
ImBuf *tmpibuf = ibuf; ImBuf *tmpibuf = ibuf;
ibuf = postprocess_frame(clip, user, tmpibuf, flag, postprocess_flag); ibuf = postprocess_frame(clip, user, tmpibuf, flag, postprocess_flag);
@ -2128,9 +2128,9 @@ GPUTexture *BKE_movieclip_get_gpu_texture(MovieClip *clip, MovieClipUser *cuser)
void BKE_movieclip_free_gputexture(struct MovieClip *clip) void BKE_movieclip_free_gputexture(struct MovieClip *clip)
{ {
/* number of gpu textures to keep around as cache /* Number of gpu textures to keep around as cache.
* We don't want to keep too many GPU textures for * We don't want to keep too many GPU textures for
* movie clips around, as they can be large.*/ * movie clips around, as they can be large. */
const int MOVIECLIP_NUM_GPUTEXTURES = 1; const int MOVIECLIP_NUM_GPUTEXTURES = 1;
while (BLI_listbase_count(&clip->runtime.gputextures) > MOVIECLIP_NUM_GPUTEXTURES) { while (BLI_listbase_count(&clip->runtime.gputextures) > MOVIECLIP_NUM_GPUTEXTURES) {

@ -994,7 +994,7 @@ static void multiresModifier_disp_run(
} }
} }
/*numGrids = dm->getNumGrids(dm);*/ /*UNUSED*/ // numGrids = dm->getNumGrids(dm); /* UNUSED */
gridSize = dm->getGridSize(dm); gridSize = dm->getGridSize(dm);
gridData = dm->getGridData(dm); gridData = dm->getGridData(dm);
gridOffset = dm->getGridOffset(dm); gridOffset = dm->getGridOffset(dm);
@ -1285,7 +1285,7 @@ DerivedMesh *multires_make_derived_from_derived(
multires_set_tot_mdisps(me, mmd->totlvl); multires_set_tot_mdisps(me, mmd->totlvl);
multiresModifier_ensure_external_read(me, mmd); multiresModifier_ensure_external_read(me, mmd);
/*run displacement*/ /* Run displacement. */
multiresModifier_disp_run(result, ob->data, dm, APPLY_DISPLACEMENTS, subGridData, mmd->totlvl); multiresModifier_disp_run(result, ob->data, dm, APPLY_DISPLACEMENTS, subGridData, mmd->totlvl);
/* copy hidden elements for this level */ /* copy hidden elements for this level */

@ -235,7 +235,7 @@ void multiresModifier_subdivide_to_level(struct Object *object,
/* Free original grids which makes it so smoothing with details thinks all the details were /* Free original grids which makes it so smoothing with details thinks all the details were
* added against base mesh's limit surface. This is similar behavior to as if we've done all * added against base mesh's limit surface. This is similar behavior to as if we've done all
* displacement in sculpt mode at the old top level and then propagated to the new top level.*/ * displacement in sculpt mode at the old top level and then propagated to the new top level. */
multires_reshape_free_original_grids(&reshape_context); multires_reshape_free_original_grids(&reshape_context);
if (ELEM(mode, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE)) { if (ELEM(mode, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE)) {

@ -312,7 +312,7 @@ static bool unsubdivide_tag_disconnected_mesh_element(BMesh *bm, int *elem_id, i
/* Also try from the different 4 vertices of a quad in the current /* Also try from the different 4 vertices of a quad in the current
* disconnected element ID. If a solution exists the search should return a valid solution from * disconnected element ID. If a solution exists the search should return a valid solution from
* one of these vertices.*/ * one of these vertices. */
BMFace *f, *init_face = NULL; BMFace *f, *init_face = NULL;
BMVert *v; BMVert *v;
BMIter iter_a, iter_b; BMIter iter_a, iter_b;

@ -1289,7 +1289,7 @@ void BKE_nlastrip_set_active(AnimData *adt, NlaStrip *strip)
return; return;
} }
/* loop over tracks, deactivating*/ /* Loop over tracks, deactivating. */
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) { for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
for (nls = nlt->strips.first; nls; nls = nls->next) { for (nls = nlt->strips.first; nls; nls = nls->next) {
if (nls != strip) { if (nls != strip) {
@ -1560,7 +1560,7 @@ bool BKE_nlatracks_have_animated_strips(ListBase *tracks)
return false; return false;
} }
/* Validate the NLA-Strips 'control' F-Curves based on the flags set*/ /* Validate the NLA-Strips 'control' F-Curves based on the flags set. */
void BKE_nlastrip_validate_fcurves(NlaStrip *strip) void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
{ {
FCurve *fcu; FCurve *fcu;

@ -875,7 +875,7 @@ void ntreeBlendReadLib(struct BlendLibReader *reader, struct bNodeTree *ntree)
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
/* Link ID Properties -- and copy this comment EXACTLY for easy finding /* Link ID Properties -- and copy this comment EXACTLY for easy finding
* of library blocks that implement this.*/ * of library blocks that implement this. */
IDP_BlendReadLib(reader, node->prop); IDP_BlendReadLib(reader, node->prop);
BLO_read_id_address(reader, lib, &node->id); BLO_read_id_address(reader, lib, &node->id);
@ -2365,7 +2365,7 @@ static void nodeUnMuteLink(bNodeLink *link)
link->tosock->flag |= SOCK_IN_USE; link->tosock->flag |= SOCK_IN_USE;
} }
/* Upstream muting. Always happens when unmuting but checks when muting. O(n^2) algorithm.*/ /* Upstream muting. Always happens when unmuting but checks when muting. O(n^2) algorithm. */
static void nodeMuteRerouteInputLinks(bNodeTree *ntree, bNode *node, const bool mute) static void nodeMuteRerouteInputLinks(bNodeTree *ntree, bNode *node, const bool mute)
{ {
if (node->type != NODE_REROUTE) { if (node->type != NODE_REROUTE) {
@ -2388,7 +2388,7 @@ static void nodeMuteRerouteInputLinks(bNodeTree *ntree, bNode *node, const bool
} }
} }
/* Downstream muting propagates when reaching reroute nodes. O(n^2) algorithm.*/ /* Downstream muting propagates when reaching reroute nodes. O(n^2) algorithm. */
static void nodeMuteRerouteOutputLinks(bNodeTree *ntree, bNode *node, const bool mute) static void nodeMuteRerouteOutputLinks(bNodeTree *ntree, bNode *node, const bool mute)
{ {
if (node->type != NODE_REROUTE) { if (node->type != NODE_REROUTE) {

@ -2759,7 +2759,7 @@ Object *BKE_object_duplicate(Main *bmain,
} }
if (!is_subprocess) { if (!is_subprocess) {
/* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&obn->id); BKE_libblock_relink_to_newid(&obn->id);
#ifndef NDEBUG #ifndef NDEBUG

@ -248,7 +248,7 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u, float
if (oc->_do_normals) { if (oc->_do_normals) {
ocr->normal[0] = BILERP(oc->_N_x); ocr->normal[0] = BILERP(oc->_N_x);
ocr->normal[1] = oc->_N_y /*BILERP(oc->_N_y) (MEM01)*/; ocr->normal[1] = oc->_N_y /* BILERP(oc->_N_y) (MEM01) */;
ocr->normal[2] = BILERP(oc->_N_z); ocr->normal[2] = BILERP(oc->_N_z);
} }
@ -347,7 +347,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
} }
if (oc->_do_normals) { if (oc->_do_normals) {
ocr->normal[0] = INTERP(oc->_N_x); ocr->normal[0] = INTERP(oc->_N_x);
ocr->normal[1] = oc->_N_y /*INTERP(oc->_N_y) (MEM01)*/; ocr->normal[1] = oc->_N_y /* INTERP(oc->_N_y) (MEM01) */;
ocr->normal[2] = INTERP(oc->_N_z); ocr->normal[2] = INTERP(oc->_N_z);
} }
if (oc->_do_chop) { if (oc->_do_chop) {
@ -1052,7 +1052,7 @@ void BKE_ocean_free_data(struct Ocean *oc)
fftw_destroy_plan(oc->_N_x_plan); fftw_destroy_plan(oc->_N_x_plan);
fftw_destroy_plan(oc->_N_z_plan); fftw_destroy_plan(oc->_N_z_plan);
MEM_freeN(oc->_N_x); MEM_freeN(oc->_N_x);
/*fftwf_free(oc->_N_y); (MEM01)*/ /* fftwf_free(oc->_N_y); (MEM01) */
MEM_freeN(oc->_N_z); MEM_freeN(oc->_N_z);
} }
@ -1437,9 +1437,9 @@ void BKE_ocean_bake(struct Ocean *o,
rgb_to_rgba_unit_alpha(&ibuf_disp->rect_float[4 * (res_x * y + x)], ocr.disp); rgb_to_rgba_unit_alpha(&ibuf_disp->rect_float[4 * (res_x * y + x)], ocr.disp);
if (o->_do_jacobian) { if (o->_do_jacobian) {
/* TODO, cleanup unused code - campbell */ /* TODO: cleanup unused code - campbell */
float /*r, */ /* UNUSED */ pr = 0.0f, foam_result; float /* r, */ /* UNUSED */ pr = 0.0f, foam_result;
float neg_disp, neg_eplus; float neg_disp, neg_eplus;
ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, och->foam_coverage); ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, och->foam_coverage);
@ -1449,9 +1449,9 @@ void BKE_ocean_bake(struct Ocean *o,
pr = prev_foam[res_x * y + x]; pr = prev_foam[res_x * y + x];
} }
/* r = BLI_rng_get_float(rng); */ /* UNUSED */ /* randomly reduce foam */ // r = BLI_rng_get_float(rng); /* UNUSED */ /* randomly reduce foam */
/* pr = pr * och->foam_fade; */ /* overall fade */ // pr = pr * och->foam_fade; /* overall fade */
/* Remember ocean coord sys is Y up! /* Remember ocean coord sys is Y up!
* break up the foam where height (Y) is low (wave valley), * break up the foam where height (Y) is low (wave valley),
@ -1475,7 +1475,7 @@ void BKE_ocean_bake(struct Ocean *o,
prev_foam[res_x * y + x] = foam_result; prev_foam[res_x * y + x] = foam_result;
/*foam_result = min_ff(foam_result, 1.0f); */ // foam_result = min_ff(foam_result, 1.0f);
value_to_rgba_unit_alpha(&ibuf_foam->rect_float[4 * (res_x * y + x)], foam_result); value_to_rgba_unit_alpha(&ibuf_foam->rect_float[4 * (res_x * y + x)], foam_result);

@ -99,7 +99,7 @@ typedef struct Ocean {
double *_N_x; /* init w sim w via plan? */ double *_N_x; /* init w sim w via plan? */
/* all member of this array has same values, /* all member of this array has same values,
* so convert this array to a float to reduce memory usage (MEM01). */ * so convert this array to a float to reduce memory usage (MEM01). */
/*float * _N_y; */ // float * _N_y;
double _N_y; /* sim w ********* can be rearranged? */ double _N_y; /* sim w ********* can be rearranged? */
double *_N_z; /* init w sim w via plan? */ double *_N_z; /* init w sim w via plan? */
double *_disp_x; /* init w sim w via plan? */ double *_disp_x; /* init w sim w via plan? */

@ -2462,7 +2462,7 @@ int do_guides(Depsgraph *depsgraph,
(int)(data->strength * guidetime * 100.0f), (int)(data->strength * guidetime * 100.0f),
100)); 100));
} }
else { /* curve size*/ else { /* Curve size. */
if (cu->flag & CU_PATH_RADIUS) { if (cu->flag & CU_PATH_RADIUS) {
mul_v3_fl(vec_to_point, radius); mul_v3_fl(vec_to_point, radius);
} }

@ -250,7 +250,7 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
if (psys->particles) { if (psys->particles) {
totsaved = MIN2(psys->totpart, totpart); totsaved = MIN2(psys->totpart, totpart);
/*save old pars*/ /* Save old pars. */
if (totsaved) { if (totsaved) {
memcpy(newpars, psys->particles, totsaved * sizeof(ParticleData)); memcpy(newpars, psys->particles, totsaved * sizeof(ParticleData));
@ -607,8 +607,8 @@ void init_particle(ParticleSimulationData *sim, ParticleData *pa)
pa->time = part->sta + (part->end - part->sta) * birth_time; pa->time = part->sta + (part->end - part->sta) * birth_time;
pa->hair_index = 0; pa->hair_index = 0;
/* we can't reset to -1 anymore since we've figured out correct index in distribute_particles */ /* We can't reset to -1 anymore since we've figured out correct index in #distribute_particles
/* usage other than straight after distribute has to handle this index by itself - jahka*/ * usage other than straight after distribute has to handle this index by itself - jahka. */
// pa->num_dmcache = DMCACHE_NOTFOUND; /* assume we don't have a derived mesh face */ // pa->num_dmcache = DMCACHE_NOTFOUND; /* assume we don't have a derived mesh face */
} }
@ -1473,7 +1473,7 @@ static void integrate_particle(
force_func(forcedata, states + i, force, impulse); force_func(forcedata, states + i, force, impulse);
/* force to acceleration*/ /* Force to acceleration. */
mul_v3_v3fl(acceleration, force, 1.0f / pa_mass); mul_v3_v3fl(acceleration, force, 1.0f / pa_mass);
if (external_acceleration) { if (external_acceleration) {
@ -2226,7 +2226,7 @@ static void sph_integrate(ParticleSimulationData *sim,
sphdata->pass = 0; sphdata->pass = 0;
// sphdata.element_size and sphdata.flow are set in the callback. // sphdata.element_size and sphdata.flow are set in the callback.
/* restore previous state and treat gravity & effectors as external acceleration*/ /* Restore previous state and treat gravity & effectors as external acceleration. */
sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel); sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel);
mul_v3_fl(effector_acceleration, 1.0f / dtime); mul_v3_fl(effector_acceleration, 1.0f / dtime);
@ -3001,7 +3001,7 @@ static int collision_response(ParticleSimulationData *sim,
/* get back to global coordinates */ /* get back to global coordinates */
add_v3_v3(v1_tan, vc_tan); add_v3_v3(v1_tan, vc_tan);
/* convert to angular velocity*/ /* Convert to angular velocity. */
cross_v3_v3v3(ave, vr_tan, pce->nor); cross_v3_v3v3(ave, vr_tan, pce->nor);
mul_v3_fl(ave, 1.0f / MAX2(pa->size, 0.001f)); mul_v3_fl(ave, 1.0f / MAX2(pa->size, 0.001f));
@ -3927,7 +3927,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
pa->alive = PARS_DYING; pa->alive = PARS_DYING;
} }
else if (birthtime <= cfra && birthtime >= psys->cfra) { else if (birthtime <= cfra && birthtime >= psys->cfra) {
/* particle is born some time between this and last step*/ /* Particle is born some time between this and last step. */
reset_particle(sim, pa, dfra * timestep, cfra); reset_particle(sim, pa, dfra * timestep, cfra);
pa->alive = PARS_ALIVE; pa->alive = PARS_ALIVE;
pa->state.time = cfra - birthtime; pa->state.time = cfra - birthtime;
@ -3936,7 +3936,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* nothing to be done when particle is dead */ /* nothing to be done when particle is dead */
} }
/* only reset unborn particles if they're shown or if the particle is born soon*/ /* Only reset unborn particles if they're shown or if the particle is born soon. */
if (pa->alive == PARS_UNBORN && if (pa->alive == PARS_UNBORN &&
(part->flag & PART_UNBORN || (cfra + psys->pointcache->step > pa->time))) { (part->flag & PART_UNBORN || (cfra + psys->pointcache->step > pa->time))) {
reset_particle(sim, pa, dtime, cfra); reset_particle(sim, pa, dtime, cfra);
@ -4104,7 +4104,7 @@ static void update_children(ParticleSimulationData *sim, const bool use_render_p
psys_free_children(sim->psys); psys_free_children(sim->psys);
} }
} }
/* updates cached particles' alive & other flags etc..*/ /* Updates cached particles' alive & other flags etc. */
static void cached_step(ParticleSimulationData *sim, float cfra, const bool use_render_params) static void cached_step(ParticleSimulationData *sim, float cfra, const bool use_render_params)
{ {
ParticleSystem *psys = sim->psys; ParticleSystem *psys = sim->psys;

@ -180,7 +180,7 @@ static BMVert *bm_vert_hash_lookup_chain(GHash *deleted_verts, BMVert *v)
while (true) { while (true) {
BMVert **v_next_p = (BMVert **)BLI_ghash_lookup_p(deleted_verts, v); BMVert **v_next_p = (BMVert **)BLI_ghash_lookup_p(deleted_verts, v);
if (v_next_p == NULL) { if (v_next_p == NULL) {
/* not remapped*/ /* Not remapped. */
return v; return v;
} }
if (*v_next_p == NULL) { if (*v_next_p == NULL) {

@ -2632,7 +2632,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
} }
#endif #endif
/*if (!G.relbase_valid) return; */ /* save blend file before using pointcache */ // if (!G.relbase_valid) return; /* Save blend file before using pointcache. */
/* clear all files in the temp dir with the prefix of the ID and the ".bphys" suffix */ /* clear all files in the temp dir with the prefix of the ID and the ".bphys" suffix */
switch (mode) { switch (mode) {
@ -2659,8 +2659,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
ptcache_filename_ext_append(pid, ext, 0, false, 0); ptcache_filename_ext_append(pid, ext, 0, false, 0);
while ((de = readdir(dir)) != NULL) { while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
if (mode == PTCACHE_CLEAR_ALL) { if (mode == PTCACHE_CLEAR_ALL) {
pid->cache->last_exact = MIN2(pid->cache->startframe, 0); pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name); BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
@ -2695,7 +2695,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
PTCacheMem *link = NULL; PTCacheMem *link = NULL;
if (mode == PTCACHE_CLEAR_ALL) { if (mode == PTCACHE_CLEAR_ALL) {
/*we want startframe if the cache starts before zero*/ /* We want startframe if the cache starts before zero. */
pid->cache->last_exact = MIN2(pid->cache->startframe, 0); pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
for (; pm; pm = pm->next) { for (; pm; pm = pm->next) {
ptcache_mem_clear(pm); ptcache_mem_clear(pm);
@ -2856,8 +2856,8 @@ void BKE_ptcache_id_time(
ptcache_filename_ext_append(pid, ext, 0, false, 0); ptcache_filename_ext_append(pid, ext, 0, false, 0);
while ((de = readdir(dir)) != NULL) { while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */ /* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext); const int frame = ptcache_frame_from_filename(de->d_name, ext);
@ -3038,7 +3038,7 @@ void BKE_ptcache_remove(void)
if (FILENAME_IS_CURRPAR(de->d_name)) { if (FILENAME_IS_CURRPAR(de->d_name)) {
/* do nothing */ /* do nothing */
} }
else if (strstr(de->d_name, PTCACHE_EXT)) { /* do we have the right extension?*/ else if (strstr(de->d_name, PTCACHE_EXT)) { /* Do we have the right extension? */
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name); BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, false, false); BLI_delete(path_full, false, false);
} }
@ -3569,8 +3569,8 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
BLI_strncpy(pid->cache->name, name_dst, sizeof(pid->cache->name)); BLI_strncpy(pid->cache->name, name_dst, sizeof(pid->cache->name));
while ((de = readdir(dir)) != NULL) { while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
if (STREQLEN(old_filename, de->d_name, len)) { /* do we have the right prefix */ if (STREQLEN(old_filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */ /* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext); const int frame = ptcache_frame_from_filename(de->d_name, ext);
@ -3589,7 +3589,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
void BKE_ptcache_load_external(PTCacheID *pid) void BKE_ptcache_load_external(PTCacheID *pid)
{ {
/*todo*/ /* TODO: */
PointCache *cache = pid->cache; PointCache *cache = pid->cache;
int len; /* store the length of the string */ int len; /* store the length of the string */
int info = 0; int info = 0;
@ -3626,8 +3626,8 @@ void BKE_ptcache_load_external(PTCacheID *pid)
} }
while ((de = readdir(dir)) != NULL) { while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */ /* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext); const int frame = ptcache_frame_from_filename(de->d_name, ext);

@ -2013,7 +2013,7 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
bmain, NULL, sce_copy->master_collection, duplicate_flags, LIB_ID_DUPLICATE_IS_SUBPROCESS); bmain, NULL, sce_copy->master_collection, duplicate_flags, LIB_ID_DUPLICATE_IS_SUBPROCESS);
if (!is_subprocess) { if (!is_subprocess) {
/* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&sce_copy->id); BKE_libblock_relink_to_newid(&sce_copy->id);
#ifndef NDEBUG #ifndef NDEBUG

@ -1703,9 +1703,9 @@ static void direct_link_area(BlendDataReader *reader, ScrArea *area)
BLO_read_list(reader, &sconsole->scrollback); BLO_read_list(reader, &sconsole->scrollback);
BLO_read_list(reader, &sconsole->history); BLO_read_list(reader, &sconsole->history);
/* comma expressions, (e.g. expr1, expr2, expr3) evaluate each expression, /* Comma expressions, (e.g. expr1, expr2, expr3) evaluate each expression,
* from left to right. the right-most expression sets the result of the comma * from left to right. the right-most expression sets the result of the comma
* expression as a whole*/ * expression as a whole. */
LISTBASE_FOREACH_MUTABLE (ConsoleLine *, cl, &sconsole->history) { LISTBASE_FOREACH_MUTABLE (ConsoleLine *, cl, &sconsole->history) {
BLO_read_data_address(reader, &cl->line); BLO_read_data_address(reader, &cl->line);
if (cl->line) { if (cl->line) {

@ -109,11 +109,11 @@ typedef struct ReferenceVert {
} ReferenceVert; } ReferenceVert;
typedef struct ReferenceState { typedef struct ReferenceState {
float com[3]; /* center of mass*/ float com[3]; /* Center of mass. */
ReferenceVert *ivert; /* list of initial values */ ReferenceVert *ivert; /* List of initial values. */
} ReferenceState; } ReferenceState;
/*private scratch pad for caching and other data only needed when alive*/ /* Private scratch pad for caching and other data only needed when alive. */
typedef struct SBScratch { typedef struct SBScratch {
GHash *colliderhash; GHash *colliderhash;
short needstobuildcollider; short needstobuildcollider;
@ -162,9 +162,9 @@ static float SoftHeunTol = 1.0f;
/* local prototypes */ /* local prototypes */
static void free_softbody_intern(SoftBody *sb); static void free_softbody_intern(SoftBody *sb);
/*+++ frame based timing +++*/ /*+++ frame based timing +++ */
/*physical unit of force is [kg * m / sec^2]*/ /* Physical unit of force is `kg * m / sec^2`. */
/** /**
* Since unit of g is [m/sec^2] and F = mass * g we re-scale unit mass of node to 1 gram * Since unit of g is [m/sec^2] and F = mass * g we re-scale unit mass of node to 1 gram
@ -207,7 +207,7 @@ static float sb_time_scale(Object *ob)
} }
/*--- frame based timing ---*/ /*--- frame based timing ---*/
/* helper functions for everything is animatable jow_go_for2_5 +++++++*/ /* helper functions for everything is animatable jow_go_for2_5 +++++++ */
/* introducing them here, because i know: steps in properties ( at frame timing ) /* introducing them here, because i know: steps in properties ( at frame timing )
* will cause unwanted responses of the softbody system (which does inter frame calculations ) * will cause unwanted responses of the softbody system (which does inter frame calculations )
* so first 'cure' would be: interpolate linear in time .. * so first 'cure' would be: interpolate linear in time ..
@ -217,7 +217,7 @@ static float sb_time_scale(Object *ob)
*/ */
/* animate sb->maxgoal, sb->mingoal */ /* animate sb->maxgoal, sb->mingoal */
static float _final_goal(Object *ob, BodyPoint *bp) /*jow_go_for2_5 */ static float _final_goal(Object *ob, BodyPoint *bp) /* jow_go_for2_5 */
{ {
float f = -1999.99f; float f = -1999.99f;
if (ob) { if (ob) {
@ -235,7 +235,7 @@ static float _final_goal(Object *ob, BodyPoint *bp) /*jow_go_for2_5 */
} }
} }
CLOG_ERROR(&LOG, "sb or bp == NULL"); CLOG_ERROR(&LOG, "sb or bp == NULL");
return f; /*using crude but spot able values some times helps debuggin */ return f; /* Using crude but spot able values some times helps debugging. */
} }
static float _final_mass(Object *ob, BodyPoint *bp) static float _final_mass(Object *ob, BodyPoint *bp)
@ -251,7 +251,7 @@ static float _final_mass(Object *ob, BodyPoint *bp)
} }
/* helper functions for everything is animateble jow_go_for2_5 ------*/ /* helper functions for everything is animateble jow_go_for2_5 ------*/
/*+++ collider caching and dicing +++*/ /* +++ collider caching and dicing +++ */
/* /*
* for each target object/face the axis aligned bounding box (AABB) is stored * for each target object/face the axis aligned bounding box (AABB) is stored
@ -311,7 +311,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
/* blow it up with forcefield ranges */ /* blow it up with forcefield ranges */
hull = max_ff(ob->pd->pdef_sbift, ob->pd->pdef_sboft); hull = max_ff(ob->pd->pdef_sbift, ob->pd->pdef_sboft);
/* alloc and copy verts*/ /* Allocate and copy verts. */
pccd_M->mvert = MEM_dupallocN(cmd->xnew); pccd_M->mvert = MEM_dupallocN(cmd->xnew);
/* note that xnew coords are already in global space, */ /* note that xnew coords are already in global space, */
/* determine the ortho BB */ /* determine the ortho BB */
@ -328,7 +328,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
pccd_M->bbmax[1] = max_ff(pccd_M->bbmax[1], v[1] + hull); pccd_M->bbmax[1] = max_ff(pccd_M->bbmax[1], v[1] + hull);
pccd_M->bbmax[2] = max_ff(pccd_M->bbmax[2], v[2] + hull); pccd_M->bbmax[2] = max_ff(pccd_M->bbmax[2], v[2] + hull);
} }
/* alloc and copy faces*/ /* Allocate and copy faces. */
pccd_M->tri = MEM_dupallocN(cmd->tri); pccd_M->tri = MEM_dupallocN(cmd->tri);
/* OBBs for idea1 */ /* OBBs for idea1 */
@ -401,7 +401,7 @@ static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M)
MEM_freeN((void *)pccd_M->mprevvert); MEM_freeN((void *)pccd_M->mprevvert);
} }
pccd_M->mprevvert = pccd_M->mvert; pccd_M->mprevvert = pccd_M->mvert;
/* alloc and copy verts*/ /* Allocate and copy verts. */
pccd_M->mvert = MEM_dupallocN(cmd->xnew); pccd_M->mvert = MEM_dupallocN(cmd->xnew);
/* note that xnew coords are already in global space, */ /* note that xnew coords are already in global space, */
/* determine the ortho BB */ /* determine the ortho BB */
@ -598,7 +598,7 @@ static int count_mesh_quads(Mesh *me)
static void add_mesh_quad_diag_springs(Object *ob) static void add_mesh_quad_diag_springs(Object *ob)
{ {
Mesh *me = ob->data; Mesh *me = ob->data;
/*BodyPoint *bp;*/ /*UNUSED*/ // BodyPoint *bp; /* UNUSED */
int a; int a;
if (ob->soft) { if (ob->soft) {
@ -618,7 +618,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
/* fill the tail */ /* fill the tail */
a = 0; a = 0;
bs = &ob->soft->bspring[ob->soft->totspring]; bs = &ob->soft->bspring[ob->soft->totspring];
/*bp= ob->soft->bpoint; */ /*UNUSED*/ // bp = ob->soft->bpoint; /* UNUSED */
for (a = me->totpoly; a > 0; a--, mp++) { for (a = me->totpoly; a > 0; a--, mp++) {
if (mp->totloop == 4) { if (mp->totloop == 4) {
bs->v1 = mloop[mp->loopstart + 0].v; bs->v1 = mloop[mp->loopstart + 0].v;
@ -640,7 +640,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings) static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings)
{ {
/*assume we have a softbody*/ /* Assume we have a softbody. */
SoftBody *sb = ob->soft; /* is supposed to be there */ SoftBody *sb = ob->soft; /* is supposed to be there */
BodyPoint *bp, *bpo; BodyPoint *bp, *bpo;
BodySpring *bs, *bs2, *bs3 = NULL; BodySpring *bs, *bs2, *bs3 = NULL;
@ -654,7 +654,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
bs3 = ob->soft->bspring + ob->soft->totspring; bs3 = ob->soft->bspring + ob->soft->totspring;
} }
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) { for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
/*scan for neighborhood*/ /* Scan for neighborhood. */
bpo = NULL; bpo = NULL;
v0 = (sb->totpoint - a); v0 = (sb->totpoint - a);
for (b = bp->nofsprings; b > 0; b--) { for (b = bp->nofsprings; b > 0; b--) {
@ -678,7 +678,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
for (c = bpo->nofsprings; c > 0; c--) { for (c = bpo->nofsprings; c > 0; c--) {
bs2 = sb->bspring + bpo->springs[c - 1]; bs2 = sb->bspring + bpo->springs[c - 1];
if ((bs2->v1 != notthis) && (bs2->v1 > v0)) { if ((bs2->v1 != notthis) && (bs2->v1 > v0)) {
(*counter)++; /*hit */ (*counter)++; /* hit */
if (addsprings) { if (addsprings) {
bs3->v1 = v0; bs3->v1 = v0;
bs3->v2 = bs2->v1; bs3->v2 = bs2->v1;
@ -698,7 +698,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
} }
} }
} }
/*scan for neighborhood done*/ /* Scan for neighborhood done. */
} }
} }
@ -772,8 +772,8 @@ static void build_bps_springlist(Object *ob)
if (((sb->totpoint - a) == bs->v2)) { if (((sb->totpoint - a) == bs->v2)) {
add_bp_springlist(bp, sb->totspring - b); add_bp_springlist(bp, sb->totspring - b);
} }
} /*for springs*/ } /* For springs. */
} /*for bp*/ } /* For bp. */
} }
static void calculate_collision_balls(Object *ob) static void calculate_collision_balls(Object *ob)
@ -825,7 +825,7 @@ static void calculate_collision_balls(Object *ob)
else { else {
bp->colball = 0; bp->colball = 0;
} }
} /*for bp*/ } /* For bp. */
} }
/* creates new softbody if didn't exist yet, makes new points and springs arrays */ /* creates new softbody if didn't exist yet, makes new points and springs arrays */
@ -905,7 +905,7 @@ static void free_scratch(SoftBody *sb)
if (sb->scratch->colliderhash) { if (sb->scratch->colliderhash) {
BLI_ghash_free(sb->scratch->colliderhash, BLI_ghash_free(sb->scratch->colliderhash,
NULL, NULL,
(GHashValFreeFP)ccd_mesh_free); /*this hoepfully will free all caches*/ (GHashValFreeFP)ccd_mesh_free); /* This hopefully will free all caches. */
sb->scratch->colliderhash = NULL; sb->scratch->colliderhash = NULL;
} }
if (sb->scratch->bodyface) { if (sb->scratch->bodyface) {
@ -976,7 +976,7 @@ static void free_softbody_intern(SoftBody *sb)
* since that would only valid for 'slow' moving collision targets and dito particles * since that would only valid for 'slow' moving collision targets and dito particles
*/ */
/* +++ dependency information functions*/ /* +++ dependency information functions. */
/** /**
* \note collection overrides scene when not NULL. * \note collection overrides scene when not NULL.
@ -990,9 +990,9 @@ static int query_external_colliders(Depsgraph *depsgraph, Collection *collection
return (numobjects != 0); return (numobjects != 0);
} }
/* --- dependency information functions*/ /* --- dependency information functions. */
/* +++ the aabb "force" section*/ /* +++ the aabb "force" section. */
static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
struct Object *vertexowner, struct Object *vertexowner,
float UNUSED(time)) float UNUSED(time))
@ -1036,7 +1036,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
deflected = 2; deflected = 2;
} }
else { else {
/*aye that should be cached*/ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error"); CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
continue; continue;
@ -1048,9 +1048,9 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
BLI_ghashIterator_free(ihash); BLI_ghashIterator_free(ihash);
return deflected; return deflected;
} }
/* --- the aabb section*/ /* --- the aabb section. */
/* +++ the face external section*/ /* +++ the face external section. */
static int sb_detect_face_pointCached(const float face_v1[3], static int sb_detect_face_pointCached(const float face_v1[3],
const float face_v2[3], const float face_v2[3],
const float face_v3[3], const float face_v3[3],
@ -1104,13 +1104,13 @@ static int sb_detect_face_pointCached(const float face_v1[3],
} }
} }
else { else {
/*aye that should be cached*/ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error"); CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
continue; continue;
} }
/* use mesh*/ /* Use mesh. */
if (mvert) { if (mvert) {
while (a) { while (a) {
copy_v3_v3(nv1, mvert[a - 1].co); copy_v3_v3(nv1, mvert[a - 1].co);
@ -1118,7 +1118,7 @@ static int sb_detect_face_pointCached(const float face_v1[3],
mul_v3_fl(nv1, time); mul_v3_fl(nv1, time);
madd_v3_v3fl(nv1, mprevvert[a - 1].co, 1.0f - time); madd_v3_v3fl(nv1, mprevvert[a - 1].co, 1.0f - time);
} }
/* origin to face_v2*/ /* Origin to face_v2. */
sub_v3_v3(nv1, face_v2); sub_v3_v3(nv1, face_v2);
facedist = dot_v3v3(nv1, d_nvect); facedist = dot_v3v3(nv1, d_nvect);
if (fabsf(facedist) < outerfacethickness) { if (fabsf(facedist) < outerfacethickness) {
@ -1139,7 +1139,7 @@ static int sb_detect_face_pointCached(const float face_v1[3],
} }
} }
a--; a--;
} /* while (a)*/ } /* while (a) */
} /* if (mvert) */ } /* if (mvert) */
} /* if (ob->pd && ob->pd->deflect) */ } /* if (ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
@ -1201,13 +1201,13 @@ static int sb_detect_face_collisionCached(const float face_v1[3],
} }
} }
else { else {
/*aye that should be cached*/ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error"); CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
continue; continue;
} }
/* use mesh*/ /* Use mesh. */
while (a--) { while (a--) {
if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) || if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) || (aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) ||
@ -1235,7 +1235,7 @@ static int sb_detect_face_collisionCached(const float face_v1[3],
} }
} }
/* switch origin to be nv2*/ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2); sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2); sub_v3_v3v3(edge2, nv3, nv2);
cross_v3_v3v3(d_nvect, edge2, edge1); cross_v3_v3v3(d_nvect, edge2, edge1);
@ -1272,7 +1272,7 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
bf = sb->scratch->bodyface; bf = sb->scratch->bodyface;
for (a = 0; a < sb->scratch->totface; a++, bf++) { for (a = 0; a < sb->scratch->totface; a++, bf++) {
bf->ext_force[0] = bf->ext_force[1] = bf->ext_force[2] = 0.0f; bf->ext_force[0] = bf->ext_force[1] = bf->ext_force[2] = 0.0f;
/*+++edges intruding*/ /*+++edges intruding. */
bf->flag &= ~BFF_INTERSECT; bf->flag &= ~BFF_INTERSECT;
zero_v3(feedback); zero_v3(feedback);
if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos, if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,
@ -1289,9 +1289,9 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
bf->flag |= BFF_INTERSECT; bf->flag |= BFF_INTERSECT;
choke = min_ff(max_ff(damp, choke), 1.0f); choke = min_ff(max_ff(damp, choke), 1.0f);
} }
/*---edges intruding*/ /*---edges intruding. */
/*+++ close vertices*/ /*+++ close vertices. */
if ((bf->flag & BFF_INTERSECT) == 0) { if ((bf->flag & BFF_INTERSECT) == 0) {
bf->flag &= ~BFF_CLOSEVERT; bf->flag &= ~BFF_CLOSEVERT;
tune = -1.0f; tune = -1.0f;
@ -1311,7 +1311,7 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
choke = min_ff(max_ff(damp, choke), 1.0f); choke = min_ff(max_ff(damp, choke), 1.0f);
} }
} }
/*--- close vertices*/ /*--- close vertices. */
} }
bf = sb->scratch->bodyface; bf = sb->scratch->bodyface;
for (a = 0; a < sb->scratch->totface; a++, bf++) { for (a = 0; a < sb->scratch->totface; a++, bf++) {
@ -1324,9 +1324,9 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
} }
} }
/* --- the face external section*/ /* --- the face external section. */
/* +++ the spring external section*/ /* +++ the spring external section. */
static int sb_detect_edge_collisionCached(const float edge_v1[3], static int sb_detect_edge_collisionCached(const float edge_v1[3],
const float edge_v2[3], const float edge_v2[3],
@ -1377,13 +1377,13 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3],
} }
} }
else { else {
/*aye that should be cached*/ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error"); CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
continue; continue;
} }
/* use mesh*/ /* Use mesh. */
while (a--) { while (a--) {
if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) || if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) || (aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) ||
@ -1411,7 +1411,7 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3],
} }
} }
/* switch origin to be nv2*/ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2); sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2); sub_v3_v3v3(edge2, nv3, nv2);
@ -1469,12 +1469,12 @@ static void _scan_for_ext_spring_forces(
} }
/* ---- springs colliding */ /* ---- springs colliding */
/* +++ springs seeing wind ... n stuff depending on their orientation*/ /* +++ springs seeing wind ... n stuff depending on their orientation. */
/* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/ /* NOTE: we don't use `sb->mediafrict` but use `sb->aeroedge` for magnitude of effect. */
if (sb->aeroedge) { if (sb->aeroedge) {
float vel[3], sp[3], pr[3], force[3]; float vel[3], sp[3], pr[3], force[3];
float f, windfactor = 0.25f; float f, windfactor = 0.25f;
/*see if we have wind*/ /* See if we have wind. */
if (effectors) { if (effectors) {
EffectedPoint epoint; EffectedPoint epoint;
float speed[3] = {0.0f, 0.0f, 0.0f}; float speed[3] = {0.0f, 0.0f, 0.0f};
@ -1543,7 +1543,7 @@ static void sb_sfesf_threads_run(struct Depsgraph *depsgraph,
/* figure the number of threads while preventing pretty pointless threading overhead */ /* figure the number of threads while preventing pretty pointless threading overhead */
totthread = BKE_scene_num_threads(scene); totthread = BKE_scene_num_threads(scene);
/* what if we got zillions of CPUs running but less to spread*/ /* What if we got zillions of CPUs running but less to spread. */
while ((totsprings / totthread < lowsprings) && (totthread > 1)) { while ((totsprings / totthread < lowsprings) && (totthread > 1)) {
totthread--; totthread--;
} }
@ -1590,7 +1590,7 @@ static void sb_sfesf_threads_run(struct Depsgraph *depsgraph,
BKE_effectors_free(effectors); BKE_effectors_free(effectors);
} }
/* --- the spring external section*/ /* --- the spring external section. */
static int choose_winner( static int choose_winner(
float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc) float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc)
@ -1683,7 +1683,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
} }
} }
else { else {
/*aye that should be cached*/ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error"); CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash); BLI_ghashIterator_step(ihash);
continue; continue;
@ -1697,7 +1697,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
fa *= fa; fa *= fa;
fa = 1.0f / fa; fa = 1.0f / fa;
avel[0] = avel[1] = avel[2] = 0.0f; avel[0] = avel[1] = avel[2] = 0.0f;
/* use mesh*/ /* Use mesh. */
while (a--) { while (a--) {
if ((opco[0] < mima->minx) || (opco[0] > mima->maxx) || (opco[1] < mima->miny) || if ((opco[0] < mima->minx) || (opco[0] > mima->maxx) || (opco[1] < mima->miny) ||
(opco[1] > mima->maxy) || (opco[2] < mima->minz) || (opco[2] > mima->maxz)) { (opco[1] > mima->maxy) || (opco[2] < mima->minz) || (opco[2] > mima->maxz)) {
@ -1733,7 +1733,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
} }
} }
/* switch origin to be nv2*/ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2); sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2); sub_v3_v3v3(edge2, nv3, nv2);
/* Abuse dv1 to have vertex in question at *origin* of triangle. */ /* Abuse dv1 to have vertex in question at *origin* of triangle. */
@ -2068,7 +2068,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
bp->force[1] += -ks * (auxvect[1]); bp->force[1] += -ks * (auxvect[1]);
bp->force[2] += -ks * (auxvect[2]); bp->force[2] += -ks * (auxvect[2]);
/* calculate damping forces generated by goals*/ /* Calculate damping forces generated by goals. */
sub_v3_v3v3(velgoal, bp->origS, bp->origE); sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob); kd = sb->goalfrict * sb_fric_force_scale(ob);
add_v3_v3v3(auxvect, velgoal, bp->vec); add_v3_v3v3(auxvect, velgoal, bp->vec);
@ -2113,7 +2113,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint - bp, &epoint); pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint - bp, &epoint);
BKE_effectors_apply(effectors, NULL, sb->effector_weights, &epoint, force, NULL, speed); BKE_effectors_apply(effectors, NULL, sb->effector_weights, &epoint, force, NULL, speed);
/* apply forcefield*/ /* Apply force-field. */
mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale); mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale);
add_v3_v3(bp->force, force); add_v3_v3(bp->force, force);
@ -2125,7 +2125,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
/* now we'll have nice centrifugal effect for vortex */ /* now we'll have nice centrifugal effect for vortex */
} }
else { else {
/* BP friction in media (not) moving*/ /* BP friction in media (not) moving. */
float kd = sb->mediafrict * sb_fric_force_scale(ob); float kd = sb->mediafrict * sb_fric_force_scale(ob);
/* assume it to be proportional to actual velocity */ /* assume it to be proportional to actual velocity */
bp->force[0] -= bp->vec[0] * kd; bp->force[0] -= bp->vec[0] * kd;
@ -2160,7 +2160,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
/* +++springs */ /* +++springs */
iks = 1.0f / (1.0f - sb->inspring) - 1.0f; /* inner spring constants function */ iks = 1.0f / (1.0f - sb->inspring) - 1.0f; /* inner spring constants function */
if (ob->softflag & OB_SB_EDGES) { if (ob->softflag & OB_SB_EDGES) {
if (sb->bspring) { /* spring list exists at all ? */ if (sb->bspring) { /* Spring list exists at all? */
int b; int b;
BodySpring *bs; BodySpring *bs;
for (b = bp->nofsprings; b > 0; b--) { for (b = bp->nofsprings; b > 0; b--) {
@ -2173,13 +2173,13 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
} }
// sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime) // sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime)
sb_spring_force(ob, ilast - bb, bs, iks, forcetime); sb_spring_force(ob, ilast - bb, bs, iks, forcetime);
} /* loop springs */ } /* loop springs. */
} /* existing spring list */ } /* existing spring list. */
} /*any edges*/ } /* Any edges. */
/* ---springs */ /* ---springs */
} /*omit on snap */ } /* Omit on snap. */
} /*loop all bp's*/ } /* Loop all bp's. */
return 0; /*done fine*/ return 0; /* Done fine. */
} }
static void *exec_softbody_calc_forces(void *data) static void *exec_softbody_calc_forces(void *data)
@ -2220,7 +2220,7 @@ static void sb_cf_threads_run(Scene *scene,
/* figure the number of threads while preventing pretty pointless threading overhead */ /* figure the number of threads while preventing pretty pointless threading overhead */
totthread = BKE_scene_num_threads(scene); totthread = BKE_scene_num_threads(scene);
/* what if we got zillions of CPUs running but less to spread*/ /* What if we got zillions of CPUs running but less to spread. */
while ((totpoint / totthread < lowpoints) && (totthread > 1)) { while ((totpoint / totthread < lowpoints) && (totthread > 1)) {
totthread--; totthread--;
} }
@ -2275,11 +2275,11 @@ static void softbody_calc_forces(
* this will ruin adaptive stepsize AKA heun! (BM) * this will ruin adaptive stepsize AKA heun! (BM)
*/ */
SoftBody *sb = ob->soft; /* is supposed to be there */ SoftBody *sb = ob->soft; /* is supposed to be there */
/*BodyPoint *bproot;*/ /* UNUSED */ // BodyPoint *bproot; /* UNUSED */
/* float gravity; */ /* UNUSED */ // float gravity; /* UNUSED */
/* float iks; */ // float iks;
float fieldfactor = -1.0f, windfactor = 0.25; float fieldfactor = -1.0f, windfactor = 0.25;
int do_deflector /*, do_selfcollision*/, do_springcollision, do_aero; int do_deflector /*, do_selfcollision */, do_springcollision, do_aero;
/* gravity = sb->grav * sb_grav_force_scale(ob); */ /* UNUSED */ /* gravity = sb->grav * sb_grav_force_scale(ob); */ /* UNUSED */
@ -2292,8 +2292,8 @@ static void softbody_calc_forces(
(ob->softflag & OB_SB_EDGECOLL); (ob->softflag & OB_SB_EDGECOLL);
do_aero = ((sb->aeroedge) && (ob->softflag & OB_SB_EDGES)); do_aero = ((sb->aeroedge) && (ob->softflag & OB_SB_EDGES));
/* iks = 1.0f/(1.0f-sb->inspring)-1.0f; */ /* inner spring constants function */ /* UNUSED */ // iks = 1.0f / (1.0f - sb->inspring) - 1.0f; /* Inner spring constants function. */ /* UNUSED */
/* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */ // bproot = sb->bpoint; /* Need this for proper spring addressing. */ /* UNUSED */
if (do_springcollision || do_aero) { if (do_springcollision || do_aero) {
sb_sfesf_threads_run(depsgraph, scene, ob, timenow, sb->totspring, NULL); sb_sfesf_threads_run(depsgraph, scene, ob, timenow, sb->totspring, NULL);
@ -2489,7 +2489,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* used by heun when it overshoots */ /* used by heun when it overshoots */
static void softbody_restore_prev_step(Object *ob) static void softbody_restore_prev_step(Object *ob)
{ {
SoftBody *sb = ob->soft; /* is supposed to be there*/ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp; BodyPoint *bp;
int a; int a;
@ -2502,7 +2502,7 @@ static void softbody_restore_prev_step(Object *ob)
#if 0 #if 0
static void softbody_store_step(Object *ob) static void softbody_store_step(Object *ob)
{ {
SoftBody *sb = ob->soft; /* is supposed to be there*/ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp; BodyPoint *bp;
int a; int a;
@ -2515,7 +2515,7 @@ static void softbody_store_step(Object *ob)
/* used by predictors and correctors */ /* used by predictors and correctors */
static void softbody_store_state(Object *ob, float *ppos, float *pvel) static void softbody_store_state(Object *ob, float *ppos, float *pvel)
{ {
SoftBody *sb = ob->soft; /* is supposed to be there*/ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp; BodyPoint *bp;
int a; int a;
float *pp = ppos, *pv = pvel; float *pp = ppos, *pv = pvel;
@ -2533,7 +2533,7 @@ static void softbody_store_state(Object *ob, float *ppos, float *pvel)
/* used by predictors and correctors */ /* used by predictors and correctors */
static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel) static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
{ {
SoftBody *sb = ob->soft; /* is supposed to be there*/ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp; BodyPoint *bp;
int a; int a;
float *pp = ppos, *pv = pvel; float *pp = ppos, *pv = pvel;
@ -2551,7 +2551,7 @@ static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
/* used by predictors and correctors */ /* used by predictors and correctors */
static void softbody_swap_state(Object *ob, float *ppos, float *pvel) static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
{ {
SoftBody *sb = ob->soft; /* is supposed to be there*/ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp; BodyPoint *bp;
int a; int a;
float *pp = ppos, *pv = pvel; float *pp = ppos, *pv = pvel;
@ -2773,7 +2773,7 @@ static void mesh_faces_to_scratch(Object *ob)
MLoopTri *looptri, *lt; MLoopTri *looptri, *lt;
BodyFace *bodyface; BodyFace *bodyface;
int a; int a;
/* alloc and copy faces*/ /* Allocate and copy faces. */
sb->scratch->totface = poly_to_tri_count(me->totpoly, me->totloop); sb->scratch->totface = poly_to_tri_count(me->totpoly, me->totloop);
looptri = lt = MEM_mallocN(sizeof(*looptri) * sb->scratch->totface, __func__); looptri = lt = MEM_mallocN(sizeof(*looptri) * sb->scratch->totface, __func__);
@ -3000,8 +3000,8 @@ static void curve_surf_to_softbody(Object *ob)
bp = sb->bpoint; bp = sb->bpoint;
bs = sb->bspring; bs = sb->bspring;
/* weights from bpoints, same code used as for mesh vertices */ /* Weights from bpoints, same code used as for mesh vertices. */
/* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) 2.4x hack*/ /* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) 2.4x hack. */
/* new! take the weights from curve vertex anyhow */ /* new! take the weights from curve vertex anyhow */
if (ob->softflag & OB_SB_GOAL) { if (ob->softflag & OB_SB_GOAL) {
setgoal = 1; setgoal = 1;
@ -3022,10 +3022,10 @@ static void curve_surf_to_softbody(Object *ob)
if (setgoal) { if (setgoal) {
bp->goal *= bezt->weight; bp->goal *= bezt->weight;
/* all three triples */ /* All three triples. */
(bp + 1)->goal = bp->goal; (bp + 1)->goal = bp->goal;
(bp + 2)->goal = bp->goal; (bp + 2)->goal = bp->goal;
/*do not collide handles */ /* Do not collide handles. */
(bp + 1)->loc_flag |= SBF_OUTOFCOLLISION; (bp + 1)->loc_flag |= SBF_OUTOFCOLLISION;
(bp + 2)->loc_flag |= SBF_OUTOFCOLLISION; (bp + 2)->loc_flag |= SBF_OUTOFCOLLISION;
} }
@ -3137,7 +3137,7 @@ SoftBody *sbNew(void)
sb->inspring = 0.5f; sb->inspring = 0.5f;
sb->infrict = 0.5f; sb->infrict = 0.5f;
/*todo backward file compat should copy inspring to inpush while reading old files*/ /* TODO: backward file compat should copy `inspring` to `inpush` while reading old files. */
sb->inpush = 0.5f; sb->inpush = 0.5f;
sb->colball = 0.49f; sb->colball = 0.49f;
@ -3150,7 +3150,7 @@ SoftBody *sbNew(void)
sb->choke = 3; sb->choke = 3;
sb_new_scratch(sb); sb_new_scratch(sb);
/*todo backward file compat should set sb->shearstiff = 1.0f while reading old files*/ /* TODO: backward file compat should set `sb->shearstiff = 1.0f` while reading old files. */
sb->shearstiff = 1.0f; sb->shearstiff = 1.0f;
sb->solverflags |= SBSO_OLDERR; sb->solverflags |= SBSO_OLDERR;
@ -3311,7 +3311,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
for (a = 0, bp = sb->bpoint; a < numVerts; a++, bp++) { for (a = 0, bp = sb->bpoint; a < numVerts; a++, bp++) {
copy_v3_v3(bp->pos, vertexCos[a]); copy_v3_v3(bp->pos, vertexCos[a]);
mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/ mul_m4_v3(ob->obmat, bp->pos); /* Yep, soft-body is global coords. */
copy_v3_v3(bp->origS, bp->pos); copy_v3_v3(bp->origS, bp->pos);
copy_v3_v3(bp->origE, bp->pos); copy_v3_v3(bp->origE, bp->pos);
copy_v3_v3(bp->origT, bp->pos); copy_v3_v3(bp->origT, bp->pos);
@ -3493,18 +3493,18 @@ static void softbody_step(
else if (sb->solver_ID == 2) { else if (sb->solver_ID == 2) {
/* do semi "fake" implicit euler */ /* do semi "fake" implicit euler */
/* removed */ /* removed */
} /*SOLVER SELECT*/ } /* SOLVER SELECT */
else if (sb->solver_ID == 4) { else if (sb->solver_ID == 4) {
/* do semi "fake" implicit euler */ /* do semi "fake" implicit euler */
} /*SOLVER SELECT*/ } /* SOLVER SELECT */
else if (sb->solver_ID == 3) { else if (sb->solver_ID == 3) {
/* do "stupid" semi "fake" implicit euler */ /* do "stupid" semi "fake" implicit euler */
/* removed */ /* removed */
} /*SOLVER SELECT*/ } /* SOLVER SELECT */
else { else {
CLOG_ERROR(&LOG, "softbody no valid solver ID!"); CLOG_ERROR(&LOG, "softbody no valid solver ID!");
} /*SOLVER SELECT*/ } /* SOLVER SELECT */
if (sb->plastic) { if (sb->plastic) {
apply_spring_memory(ob); apply_spring_memory(ob);
} }

@ -1116,7 +1116,7 @@ typedef struct AverageGridsCornerData {
SubdivCCG *subdiv_ccg; SubdivCCG *subdiv_ccg;
CCGKey *key; CCGKey *key;
/* Optional lookup table. Maps task range index to index in subdiv_ccg->adjacent_vertices*/ /* Optional lookup table. Maps task range index to index in `subdiv_ccg->adjacent_vertices`. */
const int *adjacent_vert_index_map; const int *adjacent_vert_index_map;
} AverageGridsCornerData; } AverageGridsCornerData;

@ -580,16 +580,16 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
#endif #endif
MVert *mvert = dm->getVertArray(dm); MVert *mvert = dm->getVertArray(dm);
MEdge *medge = dm->getEdgeArray(dm); MEdge *medge = dm->getEdgeArray(dm);
/* MFace *mface = dm->getTessFaceArray(dm); */ /* UNUSED */ // MFace *mface = dm->getTessFaceArray(dm); /* UNUSED */
MVert *mv; MVert *mv;
MEdge *me; MEdge *me;
MLoop *mloop = dm->getLoopArray(dm), *ml; MLoop *mloop = dm->getLoopArray(dm), *ml;
MPoly *mpoly = dm->getPolyArray(dm), *mp; MPoly *mpoly = dm->getPolyArray(dm), *mp;
/*MFace *mf;*/ /*UNUSED*/ // MFace *mf; /* UNUSED */
int totvert = dm->getNumVerts(dm); int totvert = dm->getNumVerts(dm);
int totedge = dm->getNumEdges(dm); int totedge = dm->getNumEdges(dm);
/*int totface = dm->getNumTessFaces(dm);*/ /*UNUSED*/ // int totface = dm->getNumTessFaces(dm); /* UNUSED */
/*int totpoly = dm->getNumFaces(dm);*/ /*UNUSED*/ // int totpoly = dm->getNumFaces(dm); /* UNUSED */
int i, j; int i, j;
int *index; int *index;
@ -641,10 +641,10 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
fVerts[j] = POINTER_FROM_UINT(ml->v); fVerts[j] = POINTER_FROM_UINT(ml->v);
} }
/* this is very bad, means mesh is internally inconsistent. /* This is very bad, means mesh is internally inconsistent.
* it is not really possible to continue without modifying * it is not really possible to continue without modifying
* other parts of code significantly to handle missing faces. * other parts of code significantly to handle missing faces.
* since this really shouldn't even be possible we just bail.*/ * since this really shouldn't even be possible we just bail. */
if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), mp->totloop, fVerts, &f) == if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), mp->totloop, fVerts, &f) ==
eCCGError_InvalidValue) { eCCGError_InvalidValue) {
static int hasGivenError = 0; static int hasGivenError = 0;
@ -1008,11 +1008,11 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
int gridFaces = gridSideEdges * gridSideEdges; int gridFaces = gridSideEdges * gridSideEdges;
int i; int i;
CCGFace *f; CCGFace *f;
/*int numVerts;*/ // int numVerts;
int offset; int offset;
int grid; int grid;
int x, y; int x, y;
/*int lastface = ccgSubSurf_getNumFaces(ss) - 1;*/ /*UNUSED*/ // int lastface = ccgSubSurf_getNumFaces(ss) - 1; /* UNUSED */
DMFlagMat *faceFlags = ccgdm->faceFlags; DMFlagMat *faceFlags = ccgdm->faceFlags;
memset(mf, 0, sizeof(*mf)); memset(mf, 0, sizeof(*mf));
@ -1023,7 +1023,7 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
i = ccgdm->reverseFaceMap[faceNum]; i = ccgdm->reverseFaceMap[faceNum];
f = ccgdm->faceMap[i].face; f = ccgdm->faceMap[i].face;
/*numVerts = ccgSubSurf_getFaceNumVerts(f);*/ /*UNUSED*/ // numVerts = ccgSubSurf_getFaceNumVerts(f); /* UNUSED */
offset = faceNum - ccgdm->faceMap[i].startFace; offset = faceNum - ccgdm->faceMap[i].startFace;
grid = offset / gridFaces; grid = offset / gridFaces;
@ -1781,7 +1781,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
numGrids = ccgDM_getNumGrids(dm); numGrids = ccgDM_getNumGrids(dm);
numFaces = ccgSubSurf_getNumFaces(ss); numFaces = ccgSubSurf_getNumFaces(ss);
/*gridSize = ccgDM_getGridSize(dm);*/ /*UNUSED*/ // gridSize = ccgDM_getGridSize(dm); /* UNUSED */
/* compute offset into grid array for each face */ /* compute offset into grid array for each face */
gridOffset = MEM_mallocN(sizeof(int) * numFaces, "ccgdm.gridOffset"); gridOffset = MEM_mallocN(sizeof(int) * numFaces, "ccgdm.gridOffset");
@ -2089,7 +2089,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
vertidx[s] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v)); vertidx[s] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
} }
/*I think this is for interpolating the center vert?*/ /* I think this is for interpolating the center vert? */
w2 = w; // + numVerts*(g2_wid-1) * (g2_wid-1); //numVerts*((g2_wid-1) * g2_wid+g2_wid-1); w2 = w; // + numVerts*(g2_wid-1) * (g2_wid-1); //numVerts*((g2_wid-1) * g2_wid+g2_wid-1);
DM_interp_vert_data(dm, &ccgdm->dm, vertidx, w2, numVerts, vertNum); DM_interp_vert_data(dm, &ccgdm->dm, vertidx, w2, numVerts, vertNum);
if (vertOrigIndex) { if (vertOrigIndex) {
@ -2099,7 +2099,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
vertNum++; vertNum++;
/*interpolate per-vert data*/ /* Interpolate per-vert data. */
for (s = 0; s < numVerts; s++) { for (s = 0; s < numVerts; s++) {
for (x = 1; x < gridFaces; x++) { for (x = 1; x < gridFaces; x++) {
w2 = w + s * numVerts * g2_wid * g2_wid + x * numVerts; w2 = w + s * numVerts * g2_wid * g2_wid + x * numVerts;
@ -2114,7 +2114,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
} }
} }
/*interpolate per-vert data*/ /* Interpolate per-vert data. */
for (s = 0; s < numVerts; s++) { for (s = 0; s < numVerts; s++) {
for (y = 1; y < gridFaces; y++) { for (y = 1; y < gridFaces; y++) {
for (x = 1; x < gridFaces; x++) { for (x = 1; x < gridFaces; x++) {
@ -2138,7 +2138,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
} }
for (s = 0; s < numVerts; s++) { for (s = 0; s < numVerts; s++) {
/*interpolate per-face data*/ /* Interpolate per-face data. */
for (y = 0; y < gridFaces; y++) { for (y = 0; y < gridFaces; y++) {
for (x = 0; x < gridFaces; x++) { for (x = 0; x < gridFaces; x++) {
w2 = w + s * numVerts * g2_wid * g2_wid + (y * g2_wid + x) * numVerts; w2 = w + s * numVerts * g2_wid * g2_wid + (y * g2_wid + x) * numVerts;
@ -2161,10 +2161,10 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
&dm->loopData, &ccgdm->dm.loopData, loopidx, w2, NULL, numVerts, loopindex2); &dm->loopData, &ccgdm->dm.loopData, loopidx, w2, NULL, numVerts, loopindex2);
loopindex2++; loopindex2++;
/*copy over poly data, e.g. mtexpoly*/ /* Copy over poly data, e.g. mtexpoly. */
CustomData_copy_data(&dm->polyData, &ccgdm->dm.polyData, origIndex, faceNum, 1); CustomData_copy_data(&dm->polyData, &ccgdm->dm.polyData, origIndex, faceNum, 1);
/*set original index data*/ /* Set original index data. */
if (faceOrigIndex) { if (faceOrigIndex) {
/* reference the index in 'polyOrigIndex' */ /* reference the index in 'polyOrigIndex' */
*faceOrigIndex = faceNum; *faceOrigIndex = faceNum;

@ -105,8 +105,8 @@ static void workspace_blend_read_data(BlendDataReader *reader, ID *id)
BLO_read_list(reader, &workspace->tools); BLO_read_list(reader, &workspace->tools);
LISTBASE_FOREACH (WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations) { LISTBASE_FOREACH (WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations) {
/* parent pointer does not belong to workspace data and is therefore restored in lib_link step /* Parent pointer does not belong to workspace data and is therefore restored in lib_link step
* of window manager.*/ * of window manager. */
BLO_read_data_address(reader, &relation->value); BLO_read_data_address(reader, &relation->value);
} }

@ -105,8 +105,9 @@ void _bli_array_grow_func(void **arr_p,
((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item)) ((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item))
/** /**
* appends an item to the array and returns a pointer to the item in the array. * Appends an item to the array and returns a pointer to the item in the array.
* item is not a pointer, but actual data value.*/ * item is not a pointer, but actual data value.
*/
#define BLI_array_append_r(arr, item) \ #define BLI_array_append_r(arr, item) \
((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item), (&arr[_##arr##_len - 1])) ((void)BLI_array_grow_one(arr), (void)(arr[_##arr##_len - 1] = item), (&arr[_##arr##_len - 1]))

@ -42,7 +42,7 @@ enum {
BLI_Buffer name_ = { \ BLI_Buffer name_ = { \
(name_##_static_), sizeof(type_), 0, static_count_, BLI_BUFFER_USE_STATIC | (flag_)} (name_##_static_), sizeof(type_), 0, static_count_, BLI_BUFFER_USE_STATIC | (flag_)}
/* never use static*/ /* Never use static. */
#define BLI_buffer_declare(type_, name_, flag_) \ #define BLI_buffer_declare(type_, name_, flag_) \
bool name_##user; /* warn for free only */ \ bool name_##user; /* warn for free only */ \
BLI_Buffer name_ = {NULL, sizeof(type_), 0, 0, (flag_)} BLI_Buffer name_ = {NULL, sizeof(type_), 0, 0, (flag_)}

@ -30,7 +30,7 @@
# pragma GCC diagnostic error "-Wconversion" # pragma GCC diagnostic error "-Wconversion"
# endif # endif
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
/* gcc4.8+ only (behavior changed to ignore globals)*/ /* gcc4.8+ only (behavior changed to ignore globals). */
# pragma GCC diagnostic error "-Wshadow" # pragma GCC diagnostic error "-Wshadow"
/* older gcc changed behavior with ternary */ /* older gcc changed behavior with ternary */
# pragma GCC diagnostic error "-Wsign-conversion" # pragma GCC diagnostic error "-Wsign-conversion"

@ -38,7 +38,7 @@ struct ListBase;
/* Threading API */ /* Threading API */
/*this is run once at startup*/ /* This is run once at startup. */
void BLI_threadapi_init(void); void BLI_threadapi_init(void);
void BLI_threadapi_exit(void); void BLI_threadapi_exit(void);

@ -298,8 +298,8 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
bool isect; bool isect;
float tot_x = 0.0f, tot_y = 0.0f; float tot_x = 0.0f, tot_y = 0.0f;
BoxPack *box, *box_test; /*current box and another for intersection tests*/ BoxPack *box, *box_test; /* Current box and another for intersection tests. */
BoxVert *vert; /* the current vert */ BoxVert *vert; /* The current vert. */
struct VertSortContext vs_ctx; struct VertSortContext vs_ctx;

@ -199,7 +199,7 @@ MINLINE float scalenorm(float a, float b, float x)
return (x * (b - a)) + a; return (x * (b - a)) + a;
} }
/* used for zoom values*/ /* Used for zoom values. */
MINLINE float power_of_2(float val) MINLINE float power_of_2(float val)
{ {
return (float)pow(2.0, ceil(log((double)val) / M_LN2)); return (float)pow(2.0, ceil(log((double)val) / M_LN2));

@ -478,7 +478,7 @@ void minmax_rgb(short c[3])
* accessible from the given triple of primaries. Desaturate * accessible from the given triple of primaries. Desaturate
* it by adding white, equal quantities of R, G, and B, enough * it by adding white, equal quantities of R, G, and B, enough
* to make RGB all positive. The function returns 1 if the * to make RGB all positive. The function returns 1 if the
* components were modified, zero otherwise.*/ * components were modified, zero otherwise. */
int constrain_rgb(float *r, float *g, float *b) int constrain_rgb(float *r, float *g, float *b)
{ {
/* Amount of white needed */ /* Amount of white needed */

@ -856,7 +856,7 @@ void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *pre
} }
#else #else
if (!isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction)) { if (!isect_plane_plane_v3(px, py, precalc->ray_origin, precalc->ray_direction)) {
/* Matrix with weird coplanar planes. Undetermined origin.*/ /* Matrix with weird co-planar planes. Undetermined origin. */
zero_v3(precalc->ray_origin); zero_v3(precalc->ray_origin);
precalc->ray_direction[0] = precalc->pmat[0][3]; precalc->ray_direction[0] = precalc->pmat[0][3];
precalc->ray_direction[1] = precalc->pmat[1][3]; precalc->ray_direction[1] = precalc->pmat[1][3];
@ -2133,7 +2133,7 @@ bool isect_ray_line_v3(const float ray_origin[3],
const float nlen = len_squared_v3(n); const float nlen = len_squared_v3(n);
if (nlen == 0.0f) { if (nlen == 0.0f) {
/* the lines are parallel.*/ /* The lines are parallel. */
return false; return false;
} }
@ -2903,7 +2903,7 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
/*---test edges---*/ /*---test edges---*/
sub_v3_v3v3(e3, v2, v1); /* wasn't yet calculated */ sub_v3_v3v3(e3, v2, v1); /* wasn't yet calculated */
/*e1*/ /* `e1` */
sub_v3_v3v3(bv, v0, p1); sub_v3_v3v3(bv, v0, p1);
elen2 = dot_v3v3(e1, e1); elen2 = dot_v3v3(e1, e1);
@ -2926,8 +2926,8 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
} }
} }
/*e2*/ /* `e2` */
/*bv is same*/ /* `bv` is same. */
elen2 = dot_v3v3(e2, e2); elen2 = dot_v3v3(e2, e2);
edotv = dot_v3v3(e2, vel); edotv = dot_v3v3(e2, vel);
edotbv = dot_v3v3(e2, bv); edotbv = dot_v3v3(e2, bv);
@ -2948,11 +2948,11 @@ bool isect_sweeping_sphere_tri_v3(const float p1[3],
} }
} }
/*e3*/ /* `e3` */
/* sub_v3_v3v3(bv, v0, p1); */ /* UNUSED */ // sub_v3_v3v3(bv, v0, p1); /* UNUSED */
/* elen2 = dot_v3v3(e1, e1); */ /* UNUSED */ // elen2 = dot_v3v3(e1, e1); /* UNUSED */
/* edotv = dot_v3v3(e1, vel); */ /* UNUSED */ // edotv = dot_v3v3(e1, vel); /* UNUSED */
/* edotbv = dot_v3v3(e1, bv); */ /* UNUSED */ // edotbv = dot_v3v3(e1, bv); /* UNUSED */
sub_v3_v3v3(bv, v1, p1); sub_v3_v3v3(bv, v1, p1);
elen2 = dot_v3v3(e3, e3); elen2 = dot_v3v3(e3, e3);
@ -4642,7 +4642,7 @@ void resolve_quad_uv_v2_deriv(float r_uv[2],
(st3[0] * st0[1] - st3[1] * st0[0]); (st3[0] * st0[1] - st3[1] * st0[0]);
/* X is 2D cross product (determinant) /* X is 2D cross product (determinant)
* A = (p0 - p) X (p0 - p3)*/ * A = (p0 - p) X (p0 - p3) */
const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]); const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]);
/* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */ /* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */
@ -4731,7 +4731,7 @@ float resolve_quad_u_v2(const float st[2],
(st3[0] * st0[1] - st3[1] * st0[0]); (st3[0] * st0[1] - st3[1] * st0[0]);
/* X is 2D cross product (determinant) /* X is 2D cross product (determinant)
* A = (p0 - p) X (p0 - p3)*/ * A = (p0 - p) X (p0 - p3) */
const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]); const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - st[1]) * (st0[0] - st3[0]);
/* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */ /* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */

@ -2665,7 +2665,7 @@ void loc_eul_size_to_mat4(float R[4][4],
size_to_mat3(smat, size); size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat); mul_m3_m3m3(tmat, rmat, smat);
/* copy rot/scale part to output matrix*/ /* Copy rot/scale part to output matrix. */
copy_m4_m3(R, tmat); copy_m4_m3(R, tmat);
/* copy location to matrix */ /* copy location to matrix */
@ -2686,18 +2686,18 @@ void loc_eulO_size_to_mat4(float R[4][4],
{ {
float rmat[3][3], smat[3][3], tmat[3][3]; float rmat[3][3], smat[3][3], tmat[3][3];
/* initialize new matrix */ /* Initialize new matrix. */
unit_m4(R); unit_m4(R);
/* make rotation + scaling part */ /* Make rotation + scaling part. */
eulO_to_mat3(rmat, eul, rotOrder); eulO_to_mat3(rmat, eul, rotOrder);
size_to_mat3(smat, size); size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat); mul_m3_m3m3(tmat, rmat, smat);
/* copy rot/scale part to output matrix*/ /* Copy rot/scale part to output matrix. */
copy_m4_m3(R, tmat); copy_m4_m3(R, tmat);
/* copy location to matrix */ /* Copy location to matrix. */
R[3][0] = loc[0]; R[3][0] = loc[0];
R[3][1] = loc[1]; R[3][1] = loc[1];
R[3][2] = loc[2]; R[3][2] = loc[2];
@ -2722,7 +2722,7 @@ void loc_quat_size_to_mat4(float R[4][4],
size_to_mat3(smat, size); size_to_mat3(smat, size);
mul_m3_m3m3(tmat, rmat, smat); mul_m3_m3m3(tmat, rmat, smat);
/* copy rot/scale part to output matrix*/ /* Copy rot/scale part to output matrix. */
copy_m4_m3(R, tmat); copy_m4_m3(R, tmat);
/* copy location to matrix */ /* copy location to matrix */

@ -45,7 +45,7 @@ int BLI_windows_get_executable_dir(char *str)
{ {
char dir[FILE_MAXDIR]; char dir[FILE_MAXDIR];
int a; int a;
/*change to utf support*/ /* Change to utf support. */
GetModuleFileName(NULL, str, FILE_MAX); GetModuleFileName(NULL, str, FILE_MAX);
BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */ BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */
a = strlen(dir); a = strlen(dir);

@ -2,7 +2,7 @@
#include "testing/testing.h" #include "testing/testing.h"
/* TODO: ray intersection, overlap ... etc.*/ /* TODO: ray intersection, overlap ... etc. */
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"

@ -2474,7 +2474,7 @@ static void direct_link_id_common(
BKE_asset_metadata_read(reader, id->asset_data); BKE_asset_metadata_read(reader, id->asset_data);
} }
/*link direct data of ID properties*/ /* Link direct data of ID properties. */
if (id->properties) { if (id->properties) {
BLO_read_data_address(reader, &id->properties); BLO_read_data_address(reader, &id->properties);
/* this case means the data was written incorrectly, it should not happen */ /* this case means the data was written incorrectly, it should not happen */
@ -2843,7 +2843,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
} }
/* TODO: restore path pointers: T40046 /* TODO: restore path pointers: T40046
* (complicated because this contains data pointers too, not just ID)*/ * (complicated because this contains data pointers too, not just ID). */
MEM_SAFE_FREE(sbuts->path); MEM_SAFE_FREE(sbuts->path);
} }
else if (sl->spacetype == SPACE_FILE) { else if (sl->spacetype == SPACE_FILE) {

@ -2052,7 +2052,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
} }
} }
/* replace 'rim material' option for in offset*/ /* Replace 'rim material' option for in offset. */
for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (ob = bmain->objects.first; ob; ob = ob->id.next) {
ModifierData *md; ModifierData *md;
for (md = ob->modifiers.first; md; md = md->next) { for (md = ob->modifiers.first; md; md = md->next) {

@ -2616,7 +2616,7 @@ void do_versions_after_linking_260(Main *bmain)
float output_locx = -1000000.0f, output_locy = 0.0f; float output_locx = -1000000.0f, output_locy = 0.0f;
/* rough guess, not nice but we don't have access to UI constants here ... */ /* rough guess, not nice but we don't have access to UI constants here ... */
static const float offsetx = 42 + 3 * 20 + 20; static const float offsetx = 42 + 3 * 20 + 20;
/*static const float offsety = 0.0f;*/ // static const float offsety = 0.0f;
if (create_io_nodes) { if (create_io_nodes) {
if (ntree->inputs.first) { if (ntree->inputs.first) {

@ -1652,7 +1652,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
* which exact version fully deprecated tessfaces, so think we can keep that one here, no * which exact version fully deprecated tessfaces, so think we can keep that one here, no
* harm to be expected anyway for being over-conservative. */ * harm to be expected anyway for being over-conservative. */
for (Mesh *me = bmain->meshes.first; me != NULL; me = me->id.next) { for (Mesh *me = bmain->meshes.first; me != NULL; me = me->id.next) {
/*check if we need to convert mfaces to mpolys*/ /* Check if we need to convert mfaces to mpolys. */
if (me->totface && !me->totpoly) { if (me->totface && !me->totpoly) {
/* temporarily switch main so that reading from /* temporarily switch main so that reading from
* external CustomData works */ * external CustomData works */
@ -3557,7 +3557,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
} }
} }
/* Fix anamorphic bokeh eevee rna limits.*/ /* Fix anamorphic bokeh eevee rna limits. */
for (Camera *ca = bmain->cameras.first; ca; ca = ca->id.next) { for (Camera *ca = bmain->cameras.first; ca; ca = ca->id.next) {
if (ca->gpu_dof.ratio < 0.01f) { if (ca->gpu_dof.ratio < 0.01f) {
ca->gpu_dof.ratio = 0.01f; ca->gpu_dof.ratio = 0.01f;
@ -4924,7 +4924,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
} }
} }
/* Corrective smooth modifier scale*/ /* Corrective smooth modifier scale. */
if (!DNA_struct_elem_find(fd->filesdna, "CorrectiveSmoothModifierData", "float", "scale")) { if (!DNA_struct_elem_find(fd->filesdna, "CorrectiveSmoothModifierData", "float", "scale")) {
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
@ -4973,7 +4973,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
} }
} }
/* Surface deform modifier strength*/ /* Surface deform modifier strength. */
if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "strength")) { if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "strength")) {
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {

@ -2026,7 +2026,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
} }
} }
/* Initialize the spread parameter for area lights*/ /* Initialize the spread parameter for area lights. */
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "area_spread")) { if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "area_spread")) {
LISTBASE_FOREACH (Light *, la, &bmain->lights) { LISTBASE_FOREACH (Light *, la, &bmain->lights) {
la->area_spread = DEG2RADF(180.0f); la->area_spread = DEG2RADF(180.0f);

@ -363,7 +363,7 @@ static void customdata_version_242(Mesh *me)
BKE_mesh_update_customdata_pointers(me, true); BKE_mesh_update_customdata_pointers(me, true);
} }
/*only copy render texface layer from active*/ /* Only copy render texface layer from active. */
static void customdata_version_243(Mesh *me) static void customdata_version_243(Mesh *me)
{ {
CustomDataLayer *layer; CustomDataLayer *layer;
@ -1266,8 +1266,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
} }
cam = cam->id.next; cam = cam->id.next;
} }
/* force oops draw if depgraph was set*/ /* Force oops draw if depgraph was set. */
/* set time line var */ /* Set time line var. */
/* softbody init new vars */ /* softbody init new vars */
for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (ob = bmain->objects.first; ob; ob = ob->id.next) {
@ -2021,7 +2021,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
/* fix all versions before 2.45 */ /* fix all versions before 2.45 */
if (bmain->versionfile != 245) { if (bmain->versionfile != 245) {
/* repair preview from 242 - 244*/ /* Repair preview from 242 - 244. */
for (ima = bmain->images.first; ima; ima = ima->id.next) { for (ima = bmain->images.first; ima; ima = ima->id.next) {
ima->preview = NULL; ima->preview = NULL;
} }

Some files were not shown because too many files have changed in this diff Show More